	/************************************************************************
	*	File Name: 			onramper.js										*
	*	Author Name: 		Nabeel Bin Ezad									*
	*	Description:		Used for on ramper javascript functionality		*	
	*	Created Date:		25 February 2007.								*
	*	Modified Date: 		05 Nov 2008.		    						*
	*	Last Modified By:	Ramish Hashmi	 								*
	*																		*
	*************************************************************************/	
	var strFunctionalArea="";
	/************************************************************************
	*
	*	Function Name:	GetDashBoad									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	
	function GetOnDashBoad(pIntUserId,pStrUserName,pStrPassword,pIntCompanyId)
	{
		var url = 'GUIService/OnRamperService.php?action=select&uid='+pIntUserId+'&un='+pStrUserName+'&ut='+pStrPassword; 
			// notice the use of a proxy to circumvent the Same Origin Policy. 
			document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
			var myRequest= new Ajax.Request(
				url, 
			{   
				method: 'post',
				onSuccess: function(transport) 
				{     
					var strResponse=transport.responseText;
					strResponse=strResponse.split("+");
					document.getElementById("divDashBoard").innerHTML=strResponse[0];
					var strEventsDate=strResponse[1];
					strEventsDate=strEventsDate.split(",");
					
					var dA = new Array(); 
					var x=0;
					for (j=0;j<strEventsDate.length-1;j++)
					{
					
						dA[x++] = strEventsDate[j];
					}
					loaded('calendar',start,dA);
				} 
			});
		
		
	}
	/****************************************************************************************************
    * 	Function Name	: 	editLoginInfoForm() 
	* 	Author			: 	Ramish Hashmi
	* 	Synopsis		: 	Gets the login info form along with the info from database
	*****************************************************************************************************/
   	function editLoginInfoForm(pIntUserId)
   	{
	   var par ='userid='+pIntUserId;
		var url = 'GUIService/UserInfoService.php?action=loginInfoForm'; 
	
		//
		document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							parameters:par,
							onSuccess: function(transport) 
							{      
								document.getElementById("divDashBoard").innerHTML=transport.responseText;
							} 
						}); 

   	}
	/****************************************************************************************************
    * 	Function Name	: 	editLoginInfo() 
	* 	Author			: 	Ramish Hashmi
	* 	Synopsis		: 	Saves the editted login info to the database
	*****************************************************************************************************/
	/*
	function editLogInfo()
	{
		
		document.getElementById("passwordError").innerHTML="";
		document.getElementById("rePasswordError").innerHTML="";
		document.getElementById("emailError").innerHTML="";
		var strEmail= document.getElementById("email").value;
		
		if(document.getElementById("password").value=='')
		{
			document.getElementById("passwordError").innerHTML="Field Required";
			return;
		}
		else if(!CheckSpaces(document.getElementById("password").value))
		 {
				document.getElementById("passwordError").innerHTML="Invalid Data Entry";
				return;
		 }
		else if(document.getElementById("rePassword").value=='')
		{
			document.getElementById("rePasswordError").innerHTML="Field Required";
			return;
		}
		else if(!CheckSpaces(document.getElementById("rePassword").value))
		 {
				document.getElementById("rePasswordError").innerHTML="Invalid Data Entry";
				return;
		 }
		else if((document.getElementById("password").value)!=(document.getElementById("rePassword").value))
			{
				document.getElementById("rePasswordError").innerHTML="Password fields do not match, please re-enter password";
				return;
			}
		else if(strEmail=='')
		{
			document.getElementById("emailError").innerHTML="Field Required";
			return;
		}
		else if(strEmail.indexOf('@')==-1) //arslanyahoo.com no @ aign
		{
			document.getElementById("emailError").innerHTML="Invalid email address";
			return;
		}
		else if(strEmail.indexOf('@')!=strEmail.lastIndexOf('@'))
		{
			document.getElementById("emailError").innerHTML="Invalid email address";
			return;
		}
		else
		{
			var chunks=strEmail.split('@');
			var user=chunks[0];
			if(!user || user.length==0)
			{
				document.getElementById("emailError").innerHTML="Invalid email address";
				return;
			}
			//get the user part of the email address and check it should not start with '.' or '-' also should not end with '.'
			if(user.substring(0,1)=='.'||user.substring(0,1)=='-'||user.substr(user.length-1,1)=='.')	
			{
				document.getElementById("emailError").innerHTML="Invalid email address";
				return;
			}
			if(!CheckValidCharacters(user))//check user name contains all valid characters
			{
				document.getElementById("emailError").innerHTML="Invalid email address";
				return;		
			}					
			//now get the domain part of the email address
			domain=chunks[1];
			if(!CheckDomain(domain))
			{
				document.getElementById("emailError").innerHTML="Invalid email address";
				return;
			}
			else
			{
				var url = 'GUIService/UserInfoService.php?action=editLoginInfo'; 
				var par='userName='+document.getElementById("username").value+'&password='+document.getElementById("password").	
				value+'&email='+document.getElementById("email").value;
				var myRequest= new Ajax.Request(
									url, 
									{   
										method: 'post',
										parameters:par,
										onSuccess: function(transport) 
										{   
											if(transport.responseText==1)
											{
												window.location="index.php?q=onramper";	
											}
										} 
									});
			}//else ends
		}//outer else ends
	}//function ends
	*/
	/****************************************************************************************************
    * 	Function Name	: 	editPersonalInfoForm() 
	* 	Author			: 	Ramish Hashmi
	* 	Synopsis		: 	Gets the personal info form along with the info from database
	*****************************************************************************************************/
	/*function editPersonalInfoForm(pIntUserId)
	{
		var par='userId='+pIntUserId;
		var url = 'GUIService/UserInfoService.php?action=personalInfoForm'; 
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							parameters:par,
							onSuccess: function(transport) 
							{      
									strResponse=transport.responseText;//;
									strResponse=strResponse.split("+");
									document.getElementById("divDashBoard").innerHTML=strResponse[2];
									
									GetStatesByCountryId(strResponse[0],strResponse[1]);
							} 
						}); 
	}*/
	/************************************************************************
	*	Function Name:	GetStatesByCountryId									
	*	Author Name: 	Ramish Hashmi										
	*************************************************************************/	
	/*function GetStatesByCountryId(pIntCountryId,pIntStateId)
	{
		if(pIntCountryId==0)
		{
			pIntCountryId=document.getElementById("cmbCountry").value;	
		}
		var url = 'GUIService/CountryService.php?action=editstate&cid='+pIntCountryId+'&sid='+pIntStateId;
		document.getElementById("DivState").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
		var myRequest= new Ajax.Request(
			url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{     
				document.getElementById("DivState").innerHTML=transport.responseText;
				//GetCitiesByStateId(document.getElementById("cmbState").value);
			} 
		});
		
	}*/
	
	
	/************************************************************************
	*
	*	Function Name:	GetCitiesByStateId									
	*	Author Name: 	Ramish Hashmi
	*																		
	*************************************************************************/	
	/*function GetCitiesByStateId(pIntStateId)
	{
		if(pIntStateId==0)
		{
			pIntStateId=document.getElementById("cmbState").value;	
		}
		
		var url = 'GUIService/CountryService.php?action=city&sid='+pIntStateId;
		document.getElementById("DivCity").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
		var myRequest= new Ajax.Request(
			url, 
		{   
			method: 'post',
			
			onSuccess: function(transport) 
			{     
				document.getElementById("DivCity").innerHTML=transport.responseText;
			} 
		});
			
	}*/
	/****************************************************************************************************
    * 	Function Name	: 	editPerInfo() 
	* 	Author			: 	Ramish Hashmi
	* 	Synopsis		: 	Updates the personal info in the database
	*****************************************************************************************************/
    /* function editPerInfo(pIntUserId)
	 {
		
	
		 document.getElementById('firstNameError').innerHTML="";
		 document.getElementById('middleNameError').innerHTML="";
		 document.getElementById('lastNameError').innerHTML="";
		 document.getElementById('address1Error').innerHTML="";
		 document.getElementById('address2Error').innerHTML="";
		 document.getElementById('phone1Error').innerHTML="";
		 document.getElementById('cityError').innerHTML="";
		 document.getElementById('stateError').innerHTML="";
		
		if(document.getElementById("firstName").value=='')
			{
				document.getElementById("firstNameEror").innerHTML="Field Required";
				return;
			}
		else if(!CheckSpaces(document.getElementById("firstName").value))
		 	{
				document.getElementById("firstNameError").innerHTML="Invalid Data Entry";
				return;
		 	}
		else if(document.getElementById("middleName").value!='')
			{
				if(!CheckSpaces(document.getElementById("middleName").value))
		 		{
					document.getElementById("middleNameError").innerHTML="Invalid Data Entry";
					return;
		 		}
			}
			
	  if(document.getElementById("lastName").value=='')
		   {
				document.getElementById("lastNameError").innerHTML="Field Required";
				return;
		   }
		
		else if(!CheckSpaces(document.getElementById("lastName").value))
		   {
				document.getElementById("lastNameError").innerHTML="Invalid Data Entry";
				return;
		   }
		 
		else if(document.getElementById("address1").value=='')
		   {
				document.getElementById("address1Error").innerHTML="Field Required";
				return;
		   }
		 
		else if(!CheckSpaces(document.getElementById("address1").value))
		   {
				document.getElementById("address1Error").innerHTML="Invalid Data Entry";
				return;
		   }
		else if(document.getElementById("address2").value!='')
		 	{
		 	   if(!CheckSpaces(document.getElementById('address2').value))
		 		  {
					document.getElementById("address2Error").innerHTML="Invalid Data Entry";
					return;
		 		 }
		   }
		   
		if(document.getElementById('city').value=='')
		 	{	
				document.getElementById("cityError").innerHTML="Field Required";
				return;
		   }
		   
	   else if(!CheckSpaces(document.getElementById('city').value))
		   {
				document.getElementById("cityError").innerHTML="Invalid Data Entry";
				return;
		   }
	  
	  else if((document.getElementById('cmbCountry').value==3)&&(document.getElementById('cmbState').value==''))
		 {
			
			document.getElementById("stateError").innerHTML="Field Required";
			return;
		 }	   
	 
	 else if(document.getElementById("zipCode").value=='')
		   {
				document.getElementById("zipCodeError").innerHTML="Field Required";
				return;
		   }
	  
	 else if(document.getElementById("zipCode").value.length<5)
		  {
				document.getElementById("zipCodeError").innerHTML="Invalid Zip Code";
				return;
		  }
	
	  var strZip = document.getElementById('zipCode').value;
	 
	 if(!CheckNumbers(strZip))
		 {
			document.getElementById("zipCodeError").innerHTML="Invalid data entry, please enter the correct code";
			return;
		 }
		
	  
	  else if(document.getElementById("phone1").value=='')
		 {
			document.getElementById("phone1Error").innerHTML="Field Required";
			return;
		 }
	  else if(!CheckSpaces(document.getElementById('phone1').value))
		{
			document.getElementById("phone1Error").innerHTML="Invalid Data Entry";
			return;
		}
		else //save to the database... HERE!!!!
		 {

			 var url = 'GUIService/UserInfoService.php?action=editPersonalInfo&uid='+pIntUserId; 
			
			 var par='userName='+pIntUserId
			 		 +'&firstName='+document.getElementById("firstName").value
			 		 +'&middleName='+document.getElementById("middleName").value
					 +'&lastName='+document.getElementById("lastName").value
					 +'&suffix='+document.getElementById("suffix").value
					 +'&address1='+document.getElementById("address1").value
					 +'&address2='+document.getElementById("address2").value
					 +'&country='+document.getElementById("cmbCountry").value
					 +'&city='+document.getElementById("city").value
					 +'&state='+document.getElementById("cmbState").value
					 +'&zipCode='+document.getElementById("zipCode").value
					 +'&phone1='+document.getElementById("phone1").value
					 +'&phone2='+document.getElementById("phone2").value;

			 var myRequest= new Ajax.Request(
				url, 
				{   
					method: 'post',
					parameters:par,
					onSuccess: function(transport) 
					{   
						if(transport.responseText==1)
						{
							window.location="index.php?q=onramper";
						}
						//document.getElementById("divDashBoard").innerHTML=transport.responseText;
						
					} 
				});
		}
	}
 */
	/************************************************************************
	*
	*	Function Name:	GetCitiesByCountryId									
	*	Author Name: 	Ramish Hashmi																		
	*************************************************************************/	
	function GetCitiesByCountryId(pIntCountryId)
	{
		if(pIntCountryId==0)
		{
			pIntCountryId=document.getElementById("country").value;	
		}
		
		var url = 'GUIService/OffRamperService.php?action=city&cid='+pIntCountryId;
		document.getElementById("DivCity").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
		var myRequest= new Ajax.Request(
			url, 
		{   
			method: 'post',
			
			onSuccess: function(transport) 
			{     
				document.getElementById("DivCity").innerHTML=transport.responseText;
			} 
		});
		
	}
	/****************************************************************************************************
    * 	Function Name	: 	addEducationRecordForm() 
	* 	Author			: 	Ramish Hashmi
	* 	Synopsis		: 	Gets the educational info form to add educational record
	*****************************************************************************************************/
	function addEducationRecordForm(pIntUserId)
	{
		var par='userId='+pIntUserId;
		var url = 'GUIService/EducationService.php?action=educationAddForm'; 
		
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							parameters:par,
							onSuccess: function(transport) 
							{      
								
								document.getElementById("divDashBoard").innerHTML=transport.responseText;
							} 
						}); 
	}
	/****************************************************************************************************
    * 	Function Name	: 	addEdRecord() 
	* 	Author			: 	Ramish Hashmi
	* 	Synopsis		: 	Adds the Educational Record for the
	*****************************************************************************************************/
   	function addEdRecord(pIntUserId)
   	{
		 document.getElementById('collegeError').innerHTML="";
		 document.getElementById('degreeTypeError').innerHTML="";
		 document.getElementById('conAreaError').innerHTML="";
		 document.getElementById('certificationsError').innerHTML="";
		 document.getElementById('eduLevelError').innerHTML="";
		
		if(document.getElementById("eduLevel").value=='')
		{
			document.getElementById("eduLevelError").innerHTML="Field Required";
			return;
		}
		else if(!CheckSpaces(document.getElementById('eduLevel').value))
		{
			document.getElementById("eduLevelError").innerHTML="Invalid Data Entry";
			return;
		}
		else if(document.getElementById("college").value=='')
		{
			document.getElementById("collegeError").innerHTML="Field Required";
			return;
		}
		else if(!CheckSpaces(document.getElementById('college').value))
		{
			document.getElementById("collegeError").innerHTML="Invalid Data Entry";
			return;
		}
		else if(document.getElementById("degreeType").value=='')
		{
			document.getElementById("degreeTypeError").innerHTML="Field Required";
			return;
		}
		else if(!CheckSpaces(document.getElementById('degreeType').value))
		{
			document.getElementById("degreeTypeError").innerHTML="Invalid Data Entry";
			return;
		}
		else if(document.getElementById("conArea").value=='')
		{
			document.getElementById("conAreaError").innerHTML="Field Required";
			return;
		}
		else if(!CheckSpaces(document.getElementById('conArea').value))
		{
			document.getElementById("conAreaError").innerHTML="Invalid Data Entry";
			return;
		}
		
	    if(document.getElementById("certifications").value!='')
		{
			if(!CheckSpaces(document.getElementById('certifications').value))
			{
				document.getElementById("certificationsError").innerHTML="Invalid Data Entry";
				return;
			}
		}
		
		//else
		//{
			var url = 'GUIService/EducationService.php?action=addEducationInfo&uid='+pIntUserId; 
			
			 var par='userId='+pIntUserId
			 		 +'&eduLevel='+document.getElementById("eduLevel").value	
			 		 +'&college='+document.getElementById("college").value
			 		 +'&degreeType='+document.getElementById("degreeType").value
					 +'&conArea='+document.getElementById("conArea").value
					 +'&certifications='+document.getElementById("certifications").value
					 +'&awards='+document.getElementById("awards").value
					 +'&experience='+document.getElementById("experience").value;
			
			 var myRequest= new Ajax.Request(
				url, 
				{   
					method: 'post',
					parameters:par,
					onSuccess: function(transport) 
					{   
						if(transport.responseText==1)
						{
							window.location="index.php?q=onramper";
						}
						//document.getElementById("divDashBoard").innerHTML=transport.responseText;
					} 
				});
			//}
		}
	/****************************************************************************************************
    * 	Function Name	: 	viewEducationForm() 
	* 	Author			: 	Ramish Hashmi
	* 	Synopsis		: 	Gets the eductional record from the database
	*****************************************************************************************************/
	function viewEducationForm(pIntUserId)
	{
		var par='userId='+pIntUserId;
		var url = 'GUIService/EducationService.php?action=educationalInfoView'; 
	   
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							parameters:par,
							onSuccess: function(transport) 
							{      
								document.getElementById("divDashBoard").innerHTML=transport.responseText;
							} 
						}); 
		
	}
	/****************************************************************************************************
    * 	Function Name	: 	ViewEducationRecord() 
	* 	Author			: 	Ramish Hashmi
	* 	Synopsis		: 	Gets one single eductional record from the database
	*****************************************************************************************************/
	 function ViewEducationRecord(pEducationId)
	 {
		var url = 'GUIService/EducationService.php?action=educationalInfoComplete'; 
		var par='edId='+pEducationId;
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							parameters:par,
							onSuccess: function(transport) 
							{      
								document.getElementById("divDashBoard").innerHTML=transport.responseText;
							} 
						}); 
	}
	/****************************************************************************************************
    * 	Function Name	: 	EditEducationRecord() 
	* 	Author			: 	Ramish Hashmi
	* 	Synopsis		: 	gets the educational record edit form						              
	*************************************************************************************************/	 
	function EditEducationRecord(pEducationId)
	{
		var url = 'GUIService/EducationService.php?action=editEducationInfoForm'; 
		var par='edId='+pEducationId;

		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							parameters:par,
							onSuccess: function(transport) 
							{      
								
								document.getElementById("divDashBoard").innerHTML=transport.responseText;
							} 
						}); 
	}
	/****************************************************************************************************
    * 	Function Name	: 	editEdRecord() 
	* 	Author			: 	Ramish Hashmi
	* 	Synopsis		: 	edit the educational record and save to  database					              
	*************************************************************************************************/	 
	/* function editEdRecord(pEducationId)
	 {
		 document.getElementById('collegeError').innerHTML="";
		 document.getElementById('degreeTypeError').innerHTML="";
		 document.getElementById('conAreaError').innerHTML="";
		 document.getElementById('certificationsError').innerHTML="";
		 document.getElementById('eduLevelError').innerHTML="";
		
		if(document.getElementById("eduLevel").value=='')
		{
			document.getElementById("eduLevelError").innerHTML="Field Required";
			return;
		}
		
		else if(!CheckSpaces(document.getElementById('eduLevel').value))
		{
			document.getElementById("eduLevelError").innerHTML="Invalid Data Entry";
			return;
		}
		
		else if(document.getElementById("college").value=='')
		{
			document.getElementById("collegeError").innerHTML="Field Required";
			return;
		}
		
		else if(!CheckSpaces(document.getElementById('college').value))
		{
			document.getElementById("collegeError").innerHTML="Invalid Data Entry";
			return;
		}
		
		else if(document.getElementById("degreeType").value=='')
		{
			document.getElementById("degreeTypeError").innerHTML="Field Required";
			return;
		}
		
		else if(!CheckSpaces(document.getElementById('degreeType').value))
		{
			document.getElementById("degreeTypeError").innerHTML="Invalid Data Entry";
			return;
		}
		
		else if(document.getElementById("conArea").value=='')
		{
			document.getElementById("conAreaError").innerHTML="Field Required";
			return;
		}
		
		else if(!CheckSpaces(document.getElementById('conArea').value))
		{
			document.getElementById("conAreaError").innerHTML="Invalid Data Entry";
			return;
		}
		
	   if(document.getElementById("certifications").value!='')
		{
			 if(!CheckSpaces(document.getElementById('certifications').value))
			 {
				document.getElementById("certificationsError").innerHTML="Invalid Data Entry";
				return;
			 }
		}
		//else
		//{
			var url = 'GUIService/EducationService.php?action=editEducation'; 
			 var par='pEducationId='+pEducationId
			 		 +'&eduLevel='+document.getElementById("eduLevel").value	
			 		 +'&college='+document.getElementById("college").value
			 		 +'&degreeType='+document.getElementById("degreeType").value
					 +'&conArea='+document.getElementById("conArea").value
					 +'&certifications='+document.getElementById("certifications").value
					 +'&awards='+document.getElementById("awards").value
					 +'&experience='+document.getElementById("experience").value;
			

			var myRequest= new Ajax.Request(
				url, 
				{   
					method: 'post',
					parameters:par,
					onSuccess: function(transport) 
					{
						if(transport.responseText==1)
						{
							window.location="index.php?q=onramper";
						}
					} 
				});
			//} 
	 }*/
	/****************************************************************************************************
    * 	Function Name	: 	addWorkRecordForm() 
	* 	Author			: 	Ramish Hashmi
	* 	Synopsis		: 	work record info form						              
	*************************************************************************************************/ 
	function addWorkRecordForm(pIntUserId)
	{
			
		var url = 'GUIService/OnRamperService.php?action=workRecord'; 
		var par='userId='+pIntUserId;

		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							parameters:par,
							onSuccess: function(transport) 
							{      
								
								document.getElementById("divDashBoard").innerHTML=transport.responseText;
								document.getElementById("DivFunctArea").innerHTML=getFunctionalArea(0);
							} 
						});
	}
	
	/****************************************************************************************************
    * 	Function Name	: 	viewWorkRecordForm() 
	* 	Author			: 	Ramish Hashmi
	* 	Synopsis		: 	view the professional record form				              
	*************************************************************************************************/
	/*function viewWorkRecordForm(pIntUserId)
	{
			var url = 'GUIService/OnRamperService.php?action=viewProfInfo'; 
			var par='userId='+pIntUserId;
			
			var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							parameters:par,
							onSuccess: function(transport) 
							{      
								document.getElementById("divDashBoard").innerHTML=transport.responseText;
							} 
						});
	}*/
	/****************************************************************************************************
    * 	Function Name	: 	ViewProfesionalRecordForm() 
	* 	Author			: 	Ramish Hashmi
	* 	Synopsis		: 	view the professional record detail				              
	*************************************************************************************************/
	/*function ViewProfesionalRecordForm(pIntExperienceId)
	{
		
		var url = 'GUIService/OnRamperService.php?action=viewEditProfInfo'; 
			var par='expId='+pIntExperienceId;
			
			var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							parameters:par,
							onSuccess: function(transport) 
							{      
								document.getElementById("divDashBoard").innerHTML=transport.responseText;
							} 
						});
		
	}*/
	/****************************************************************************************************
    * 	Function Name	: 	EditProfRecord() 
	* 	Author			: 	Ramish Hashmi
	* 	Synopsis		: 	edit professional record in the database		              
	*************************************************************************************************/
	function EditProfRecord(pIntExId)
	{
		 document.getElementById('empNameError').innerHTML="";
		 document.getElementById('fromDateError').innerHTML="";
		 document.getElementById('toDateError').innerHTML="";
		 document.getElementById('titleError').innerHTML="";
		 
		 document.getElementById('industryExpError').innerHTML="";
		
		
		if(document.getElementById("empName").value=='')
		{
			document.getElementById("empNameError").innerHTML="Field Required";
			return;
		}
		else if(document.getElementById("fromDate").value=='')
		{
			document.getElementById("fromDateError").innerHTML="Field Required";
			return;
		}
		else if(document.getElementById("toDate").value=='')
		{
			document.getElementById("toDateError").innerHTML="Field Required";
			return;
		}
		else if(document.getElementById("title").value=='')
		{
			document.getElementById("titleError").innerHTML="Field Required";
			return;
		}
		
		else if(document.getElementById("industryExp").value=='')
		{
			document.getElementById("industryExpError").innerHTML="Field Required";
			return;
		}
		else
		{
			var url = 'GUIService/OnRamperService.php?action=editProfInfo'; 
			 var par='expId='+pIntExId
			 		 +'&empName='+document.getElementById("empName").value	
			 		 +'&fromDate='+document.getElementById("fromDate").value
			 		 +'&toDate='+document.getElementById("toDate").value
					 +'&title='+document.getElementById("title").value
					 +'&industryExp='+document.getElementById("industryExp").value
					 +'&acomplishments='+document.getElementById("acomplishments").value
					 
			
			
			var myRequest= new Ajax.Request(
				url, 
				{   
					method: 'post',
					parameters:par,
					onSuccess: function(transport) 
					{
						
						if(transport.responseText==1)
						{
							window.location="index.php?q=onramper";
						}
					} 
				});
			} 
		
	}
	/****************************************************************************************************
    * 	Function Name	: 	addProfRecord() 
	* 	Author			: 	Ramish Hashmi
	* 	Synopsis		: 	add professional record to database						              
	*************************************************************************************************/ 

	function AddProfessionalRecord(pIntUserId)
	{
		document.getElementById("empNameError").innerHTML="";
		document.getElementById("fromDateError").innerHTML="";
		document.getElementById("toDateError").innerHTML="";
		document.getElementById("titleError").innerHTML="";
		document.getElementById("industryError").innerHTML="";
		document.getElementById("functAreaWorkError").innerHTML="";
		document.getElementById("industryExpError").innerHTML="";
		document.getElementById("keywordError").innerHTML="";
		document.getElementById("acomplishmentError").innerHTML="";
		var strFunctionalArea="";
		var strOrg="";
		if(document.getElementById("empName").value=='')
		 {
			document.getElementById("empNameError").innerHTML="Field Required";
			return;
		 }
		 
		else if(!CheckSpaces(document.getElementById('empName').value))
		 {
				document.getElementById("empNameError").innerHTML="Invalid Data Entry";
				return;
		 }
		 
		else if(document.getElementById("fromDate").value=='')
		 { 
			document.getElementById("fromDateError").innerHTML="Field Required";
			return;
		 }
		 
		else if(!CheckSpaces(document.getElementById('fromDate').value))
		 {
			document.getElementById("fromDateError").innerHTML="Invalid Data Entry";
			return;
		 }
		 
	    else if(document.getElementById("toDate").value=='')
		 {
			document.getElementById("toDateError").innerHTML="Field Required";
			return;
		 }
		 
		else if(!CheckSpaces(document.getElementById('toDate').value))
		 {
			document.getElementById("toDateError").innerHTML="Invalid Data Entry";
			return;
		 }
		 
	    else if(document.getElementById("title").value=='')
		 {
			document.getElementById("titleError").innerHTML="Field Required";
			return;
		 }
		 
		else if(!CheckSpaces(document.getElementById('title').value))
		 {
			document.getElementById("titleError").innerHTML="Invalid Data Entry";
			return;
		 } 
		else
		 {
			
			strFunctionalArea="";
			var boxes = document.frmWorkForm.functionalArea.length;
			
			for (i = 0; i < boxes; i++) 
			{
					if (document.frmWorkForm.functionalArea[i].checked)
					{
						strFunctionalArea = strFunctionalArea + document.frmWorkForm.functionalArea[i].value + ",";
					}
			} 
			if(strFunctionalArea=='')
			{
				document.getElementById("functAreaWorkError").innerHTML="Field Required";
				return;
			}
			
		}
		
		if(document.getElementById("cmbIndustry").value=='')
		{
			document.getElementById("industryError").innerHTML="Field Required";
		}
		
		else if(document.getElementById("industryExp").value=='')
		{
			document.getElementById("industryExpError").innerHTML="Field Required";
		}
		
		else if(document.getElementById("keyword").value=='')
		{
			document.getElementById("keywordError").innerHTML="Field Required";
		}
		
		else if(!CheckSpaces(document.getElementById('keyword').value))
		{
			document.getElementById("keywordError").innerHTML="Invalid Data Entry";
			return;
		}
		
		else if(document.getElementById("acomplishment").value=='')
		{
			document.getElementById("acomplishmentError").innerHTML="Field Required";
			return;
		}
		else if(!CheckSpaces(document.getElementById('acomplishment').value))
		 {
			document.getElementById("acomplishmentError").innerHTML="Invalid Data Entry";
			return;
		 }
		 else
		 {
			
			strOrg="";
			if(document.getElementById('organization1').value!='')
			{
				strOrg = strOrg + document.getElementById('organization1').value;
			}
			
			if(document.getElementById('organization2').value!='')
			{
				strOrg = strOrg + document.getElementById('organization2').value;
			}
			
			if(document.getElementById('organization3').value!='')
			{
				strOrg = strOrg + document.getElementById('organization3').value;
			}
			
			if(document.getElementById('organization4').value!='')
			{
				strOrg = strOrg + document.getElementById('organization4').value;
			}
			
			if(document.getElementById('organization5').value!='')
			{
				strOrg = strOrg + document.getElementById('organization5').value;
			}
			
			if(document.getElementById('organization6').value!='')
			{
				strOrg = strOrg + document.getElementById('organization6').value;
			}
			
			
			 var url = 'GUIService/OnRamperService.php?action=addProfInfo'; 
			
			var par='userId='+pIntUserId
					+'&epmName='+document.getElementById('empName').value
					+'&fromDate='+document.getElementById('fromDate').value
					+'&toDate='+document.getElementById('toDate').value
					+'&title='+document.getElementById('title').value
					+'&functionalArea='+strFunctionalArea
					+'&cmbIndustry='+document.getElementById('cmbIndustry').value
					+'&industryExp='+document.getElementById('industryExp').value
					+'&keyword='+document.getElementById('keyword').value
					+'&acomplishment='+document.getElementById('acomplishment').value
					+'&organizations='+strOrg;
			var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							parameters:par,
							onSuccess: function(transport) 
							{      
								if(transport.responseText==1)
								  {
									  window.location="index.php?q=onramper";
								  }
							} 
						});
			
		 }
		
	}
	/****************************************************************************************************
    * 	Function Name	: 	dreamJobForm() 
	* 	Author			: 	Ramish Hashmi
	* 	Synopsis		: 	gets the dream job info in an editable form			              
	*************************************************************************************************/
	function dreamJobForm(pIntUserId)
	{
		var url = 'GUIService/OnRamperService.php?action=viewDreamJobInfo'; 
		var par='userId='+pIntUserId;
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							parameters:par,
							onSuccess: function(transport) 
							{      
								document.getElementById("divDashBoard").innerHTML=transport.responseText;
								Specify()
							} 
						});
	}
	/***************************************************************************
		 * Function Name	: 	Specify() 
		 * 	Author			: 	Ramish Hashmi
		 * 	Synopsis		:   Once full-time modified work selected
	****************************************************************************/
	function Specify()
	{
		document.getElementById("DivModFullTimeReq").style.display="none";
		document.getElementById("DivModFullTimeLabel").style.display="none";	
		if(document.getElementById("workSeeked").value=="Modified Full-Time")
		{
			document.getElementById("DivModFullTimeReq").style.display="inline";	
			document.getElementById("DivModFullTimeLabel").style.display="inline";	
			var url = 'GUIService/OnRamperService.php?action=modWorkTime';	
			document.getElementById("DivModFullTime").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
			var myRequest= new Ajax.Request(
				url, 
				{   
					method: 'post',
					onSuccess: function(transport) 
					{ 
						document.getElementById("DivModFullTime").innerHTML=transport.responseText;	
					} 
				});
			
			}
		else
		{
			document.getElementById("DivModFullTime").innerHTML="";
			document.getElementById("DivModFullTimeReq").style.display="none";
			document.getElementById("DivModFullTimeLabel").style.display="none";	
		}
		
	}
	
	/***************************************************************************
		 * Function Name	: 	saveDreamJob() 
		 * 	Author			: 	Ramish Hashmi
		 * 	Synopsis		:   Saves the Dream Job Updates
	****************************************************************************/
	function saveDreamJob(pIntUserId)
	{
		document.getElementById("workSeekedError").innerHTML="";
		document.getElementById("availibiltyError").innerHTML="";
		document.getElementById("availableDateError").innerHTML="";
		document.getElementById("dreamJobError").innerHTML="";
		document.getElementById("leaveactivityError").innerHTML="";
		document.getElementById("funcAreaDreamJobError").innerHTML="";
		document.getElementById("modFulltimeWorkError").innerHTML="";
		
		var strWork='';
		var strModFullTime='';
		if(document.getElementById('workSeeked').value=='')
		{	
			document.getElementById("workSeekedError").innerHTML="Field Required";
			return;										 
		}
		
		var strWork='';
		if(document.getElementById('workSeeked').value=='')
		  {	
			document.getElementById("workSeekedError").innerHTML="Field Required";
			return;										 
		  }
		
		else if(document.getElementById('workSeeked').value=="Modified Full-Time")
		 {
			strModFullTime="";
			var boxes = document.form1.modWork.length;
			
			for (i = 0; i < boxes; i++) 
			{
					if (document.form1.modWork[i].checked)
					{
						strModFullTime = strModFullTime + document.form1.modWork[i].value + ",";
					}
				} 

			if(strModFullTime=='')
			{
				document.getElementById("modFulltimeWorkError").innerHTML="Field Required";
				return;
			}
		  }
		
		if(document.getElementById('availibilty').value=='')
		{
			document.getElementById("availibiltyError").innerHTML="Field Required";
			return;
		}
		else if(!(document.getElementById('adminDreamJob').checked)&&(!document.getElementById('managementDreamJob').checked)&&(!	
		document.getElementById('financeDreamJob').checked)&&(!document.getElementById('IS/ITDreamJob').checked)&&(!document.
		getElementById('legalDreamJob').checked)&&(!document.getElementById('marketingDreamJob').checked)&&(!document.		
		getElementById('nursingDreamJob').checked)&&(!document.getElementById('salesDreamJob').checked))
		  {
		  	document.getElementById("funcAreaDreamJobError").innerHTML="Field Required";
			return;
		  }
		else if(document.getElementById('availableDate').value=='')
		  {
			document.getElementById("availableDateError").innerHTML="Field Required";
			return;
		  }
		else if (document.getElementById('leaveactivity').value=='')
		  {
			document.getElementById("leaveactivityError").innerHTML="Field Required";
			return;
		 }
		
		else if(!CheckSpaces(document.getElementById('leaveactivity').value))
		  {
			document.getElementById("leaveactivityError").innerHTML="Invalid Data Entry";
			return;
		  }
		
		else if (document.getElementById('dreamJob').value=='')
		  {
			document.getElementById("dreamJobError").innerHTML="Field Required";
			return;
		  }
		
		else if(!CheckSpaces(document.getElementById('dreamJob').value))
		  {
			document.getElementById("dreamJobError").innerHTML="Invalid Data Entry";
			return;
		  }
	
		else
		{
			var admin=0;
			var management=0;
			var IS=0;
			var legal=0;
			var nursing=0;
			var sales=0;
			var finance=0;
			var marketing=0;
			if(document.getElementById("adminDreamJob").checked)
			    admin=1;
			
			if(document.getElementById("managementDreamJob").checked)
				management=1;
			
			if(document.getElementById("IS/ITDreamJob").checked)
			    IS=1;
				
			if(document.getElementById("legalDreamJob").checked)
			    legal=1;
			   
			if(document.getElementById("nursingDreamJob").checked)
			    nursing=1;
				
			if(document.getElementById("salesDreamJob").checked)
			    sales=1;
				
			if(document.getElementById("financeDreamJob").checked)
				finance=1;
				
			if(document.getElementById("marketingDreamJob").checked)
			    marketing=1;
			 
			 var url = 'GUIService/OnRamperService.php?action=editDreamJob'; 
			
			var par='userId='+pIntUserId
					+'&admin='+ admin
					+'&management='+management
					+'&IS='+IS
					+'&legal='+legal
					+'&nursing='+nursing
					+'&sales='+sales
					+'&finance='+finance
					+'&marketing='+marketing
					+'&workSeeked='+document.getElementById('workSeeked').value
					+'&modFulltimeWork='+strModFullTime
					+'&availibilty='+document.getElementById("availibilty").value
					+'&availableDate='+document.getElementById("availableDate").value
					+'&dreamJob='+document.getElementById("dreamJob").value
					+'&leaveactivity='+document.getElementById("leaveactivity").value ;
			
			
			var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							parameters:par,
							onSuccess: function(transport) 
							{      
							   if(transport.responseText==1)
								{
								   window.location="index.php?q=onramper";
								 }
							} 
						});
			
		}
		
		
	}
	/****************************************************************************************************
    * 	Function Name	: 	backToDashboard() 
	* 	Author			: 	Ramish Hashmi
	* 	Synopsis		: 	take back to the  dashboard						              
	*************************************************************************************************/
	/*
	function backToDashboard()
	{
		window.location="index.php?q=onramper";
	}
		*/ 
	/***************************************************************************
    * 	Function Name	: 	CheckDomain() 
	* 	Synopsis		: 	Check for valid domain
	****************************************************************************/
	function CheckDomain(domain)
	{
		var flag = true;
		if(!domain || domain.length==0)
			flag = false;
		
		/*domain name should not start or end with . or -*/
		if(domain.substring(0,1)=='.' || domain.substring(0,1)=='-' || domain.substr(domain.length-1,1)=='.' || domain.substr(																														
		   domain.length-1,1)=='-')
			flag =  false;
		
		if(domain.indexOf('.')==-1)/*msn.co.uk , yahoo.com*/
			flag =  false;
		
		/*domain name should contain valid characters*/
		if(!CheckValidCharacters(domain))
			flag =  false;
		
		return flag;
	}//end function
			
	/***************************************************************************
    * 	Function Name	: 	CheckValidCharacters() 
	* 	Synopsis		: 	Check for valid input string charecters
	****************************************************************************/
	function CheckValidCharacters(string)
	{
		if(!string || string.length==0)
		{
			return false;
		}
		for(var i=0;i<string.length;i++)
		{
			code=string.charCodeAt(i);
			/*if user name has . or - or _ in anywhere in user name, and also between a-z,0-9, caps does not matter*/
			if(code==45 || code==46 || code==95 || (code>47 && code<58) || (code>96 && code<123) || (code>64 && code<91))
			{
				continue;
			}
			else
			{
				return false;
			}		
		}
		return true;
	}//end function
	/************************************************************************
	*
	*	Function Name:	PaggingOnJobOpportunities									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/		
	function PaggingOnJobOpportunities(pIntUserId,pIntStartIndex,pIndeEndIndex,pIntPageNo,pIntTotalPage,pStatus,pIntTotalRecord,pIntLimit,pIntDashBoard,pIntSort)
	{
		
		if(pStatus==2)
		{
				pIntPageNo=pIntPageNo-1;
				pIntStartIndex=pIntStartIndex-pIntLimit;
				pIndeEndIndex=pIntLimit;
		}
		else
		{
			if(pIntPageNo==pIntTotalPage)
			{
				pIntStartIndex=pIntTotalRecord-pIntLimit;
				pIndeEndIndex=pIntLimit;
			}
			else
			{
				pIntPageNo=pIntPageNo+1;
				pIntStartIndex=pIntStartIndex+pIntLimit;
				pIndeEndIndex=pIntLimit;
			}	
		}
		
		if(pStatus==4)
		{
			pIntStartIndex=pIntTotalPage*pIntLimit-pIntLimit;	
			
		}
		if(pStatus==1)
		{
			pIntStartIndex=0;	
			pIndeEndIndex=pIntLimit;
			
		}
		
		if(pIntDashBoard==0)
		{
			document.getElementById("divJobOpportunities").innerHTML="<img src=ImageFiles/indicator_medium.gif>"; 
		}
		else
		{
			document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>"; 
		}
		var url = 'GUIService/JobsService.php?action=jobopp&pStart='+pIntStartIndex+'&pEnd='+pIndeEndIndex+'&uid='+pIntUserId+'&pPid='+pIntPageNo+'&pStatus='+pIntDashBoard+'&pSort='+pIntSort; 
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							onSuccess: function(transport) 
							{ 
								if(pIntDashBoard==0)
								{	
									document.getElementById("divJobOpportunities").innerHTML=transport.responseText;
								}
								else
								{
									document.getElementById("divDashBoard").innerHTML=transport.responseText;
								}
								
							} 
						}); 
	}
	
	/************************************************************************
	*
	*	Function Name:	ApplyForJob									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	/*
	function ApplyForJob(pIntJobId,pIntUserId,pIntStatus)
	{
		var strResponse='';
		var url = 'GUIService/OnRamperService.php?action=add&func=apply&userid='+pIntUserId+'&jobid='+pIntJobId; 
		document.getElementById("DivMsgJobOppt").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
		var myRequest= new Ajax.Request(
			url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{     
				
				strResponse=transport.responseText;//;
			
				strResponse=strResponse.split("+");
				
				if(strResponse[0]==-1)
				{
					document.getElementById("DivMsgJobOppt").innerHTML="<span class=BodyTextMessageError>Error</span>";	
				}
				else if(strResponse[0]==-2)
				{
					document.getElementById("DivMsgJobOppt").innerHTML="<span class=BodyTextMessageError>You have already applied for this job</span>";	
				}
				
				else
				{
					if(pIntStatus==1)
					{
						document.getElementById("DivMsgJobOppt").innerHTML="<span class=BodyTextMessage>Your application has been submited</span>";
					}
					else
					{
						document.getElementById("divJobOpportunities").innerHTML=strResponse[0];
						document.getElementById("DivMyJobs").innerHTML=strResponse[1];
						document.getElementById("DivJobsWishList").innerHTML=strResponse[2];

						document.getElementById("DivMsgMyJob").innerHTML="";
						document.getElementById("DivMsgWishListJob").innerHTML="";
						document.getElementById("DivMsgJobOppt").innerHTML="<span class=BodyTextMessage>Your application has been submited</span>";
					}
				}
			} 
		});
	}*/
	/************************************************************************
	*
	*	Function Name:	AddOnWishList									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function AddOnWishList(pIntJobId,pIntUserId,pIntStatus)
	{
		
		var strResponse='';
		document.getElementById("OnRampMessage").innerHTML="";
		var url = 'GUIService/OnRamperService.php?action=add&func=wishlist&userid='+pIntUserId+'&jobid='+pIntJobId; 
		var myRequest= new Ajax.Request(
			url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{     
				strResponse=transport.responseText;//;
				
				if(strResponse==-1)
				{
					document.getElementById("OnRampMessage").innerHTML="";
					document.getElementById("OnRampMessage").innerHTML="<span class=BodyTextMessageError>Error</span>";	
				}
				else if(strResponse==-2)
				{
					document.getElementById("OnRampMessage").innerHTML="";
					document.getElementById("OnRampMessage").innerHTML="<span class=BodyTextMessageError>Job is already in wishlist</span>";	
				}
				
				else 
				{
					if(pIntStatus==0)
					{
						document.getElementById("DivJobsWishList").innerHTML=strResponse;
						document.getElementById("OnRampMessage").innerHTML="";
						document.getElementById("OnRampMessage").innerHTML="<span class=BodyTextMessage>Job has been saved in wish list</span>";
					}
					else if (pIntStatus==1);
					{
						document.getElementById("OnRampMessage").innerHTML="";
						document.getElementById("OnRampMessage").innerHTML="<span class=BodyTextMessage>Job has been saved in wish list</span>";	
					}
				}
			} 
		});
	}
	/************************************************************************
	*
	*	Function Name:	DeleteMyJob									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	/*
	function DeleteMyJob(pIntMyJobId,pIntJobId,pIntUserId)
	{
		
			var strResponse='';
			var url = 'GUIService/OnRamperService.php?action=delete&func=myjob&userid='+pIntUserId+'&jobid='+pIntJobId+'&myJobId='+pIntMyJobId; 
			if(confirm("Are you sure you want to delete from My Jobs?"))
			{
				document.getElementById("DivMsgMyJob").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
				var myRequest= new Ajax.Request(
					url, 
					{   
						method: 'post',
						onSuccess: function(transport) 
						{     
							strResponse=transport.responseText;//;
				
							if(strResponse==-1)
							{
								document.getElementById("DivMsgMyJob").innerHTML="<span class=errorsmsg>Error</span>";	
							}
							else 
							{
								document.getElementById("DivMyJobs").innerHTML=strResponse;
								document.getElementById("DivMsgWishListJob").innerHTML="";
								document.getElementById("DivMsgJobOppt").innerHTML="";
								document.getElementById("DivMsgMyJob").innerHTML="<span class=successmsg>Record deleted from My Jobs.</span>";
							}
						} 
					});
			}//if ends
		
	}
	*/
	/************************************************************************
	*
	*	Function Name:	DeleteWishlistJob									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function DeleteOnWishlistJob(pIntJobWishListId,pIntUserId,pIntStatus)
	{
		if(confirm('Are you sure want to delete?'))
		{
			var strResponse='';
			var url = 'GUIService/OnRamperService.php?action=delete&func=wishlist&jobwishid='+pIntJobWishListId+'&uid='+pIntUserId; 
			document.getElementById("OnRampMessage").innerHTML="";
			document.getElementById("OnRampMessage").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
			var myRequest= new Ajax.Request(
				url, 
			{   
				method: 'post',
				onSuccess: function(transport) 
				{     
					strResponse=transport.responseText;
	
					
					if(strResponse==-1)
					{
						document.getElementById("OnRampMessage").innerHTML="";
						document.getElementById("OnRampMessage").innerHTML="<span class=BodyTextMessageError>Error</span>";	
					}
					else 
					{
						if(pIntStatus==0)
						{
							document.getElementById("DivJobsWishList").innerHTML=strResponse;
							document.getElementById("OnRampMessage").innerHTML="";
							document.getElementById("OnRampMessage").innerHTML="<span class=BodyTextMessage>Record deleted from My Wishlist.</span>";
						}
						else if(pIntStatus==1)
						{
							document.getElementById("OnRampMessage").innerHTML="";
							document.getElementById("OnRampMessage").innerHTML="<span class=BodyTextMessage>Record deleted from My Wishlist.</span>";
						}
					}
					
				} 
			});
		}
	}
	/************************************************************************
	*
	*	Function Name:	GetJobDetail									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/		
	function GetJobDetail(pIntUserId,pIntJobId)
	{
		var url = 'GUIService/JobsService.php?action=jobdetail&jobId='+pIntJobId+'&uid='+pIntUserId; 
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							onSuccess: function(transport) 
							{ 
								
								document.getElementById("divDashBoard").innerHTML=transport.responseText;
							} 
						}); 
	}
	/************************************************************************
	*
	*	Function Name:	GetResponseDetail									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function GetResponseDetail(pIntScheduleId,pIntUserId)
	{
		
		var url = 'GUIService/OnRamperService.php?action=responsedetail&schid='+pIntScheduleId+'&userid='+pIntUserId; 
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							onSuccess: function(transport) 
							{ 
								
								document.getElementById("divDashBoard").innerHTML=transport.responseText;
							} 
						}); 
			
	}
	/************************************************************************
	*
	*	Function Name:	UpdateScheduleStatus									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	

	function UpdateScheduleStatus(pIntScheduleId,pIntStatus,pIntUserId)
	{
		
		var url = 'GUIService/ResponsesService.php?action=updateschedule&scheId='+pIntScheduleId+'&intStatus='+pIntStatus+'&uid='+pIntUserId; 
			document.getElementById("OnRampMessage").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							onSuccess: function(transport) 
							{ 
								
					 			document.getElementById("OnRampMessage").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
								
								document.getElementById("OnRampMessage").innerHTML=transport.responseText;
								if(transport.responseText==1)
								{

									if(pIntStatus==2)
									{
										document.getElementById("OnRampMessage").innerHTML="";
										if(document.getElementById("OffRampMessage"))
											document.getElementById("OffRampMessage").innerHTML="";
									
										document.getElementById("OnRampMessage").innerHTML="<span class=BodyTextMessage>Your request has been accepted</span>";
									}
									else if (pIntStatus==3)
									{
										document.getElementById("OnRampMessage").innerHTML="";
										document.getElementById("OnRampMessage").innerHTML="<span class=BodyTextMessage>Your request has been rejected</span>";
									}
								}
							} 
						}); 	
	}
	/************************************************************************
	*
	*	Function Name:	GetScheduleUpdateHtml									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function GetScheduleUpdateHtml(pIntScheduleId,pIntStatus)
	{

		var strHtml='';
		strHtml+='<form id="frmUpdateSchedule" name="frmUpdateSchedule">';
		strHtml+='<table width="100%" border="0" cellspacing="0" cellpadding="2">';
		strHtml+='<tr>';
		strHtml+='<td width="35%" align="left" valign="top" class="BodyHeadingFive">Interview Date:</td>';
		strHtml+='<td width="65%" align="left"><input type="text" value="" id="txtInterviewDate" name="txtInterviewDate" class="BodyInputTextOne" />';
		strHtml+='&nbsp;<a href="#" onclick="displayCalendar(document.forms[0].txtInterviewDate,\'mm/dd/yyyy\',this)"><img src="../../IncludeFiles/CSS/images/clender-icon.png"  onMouseOver= "this.src =\'../../IncludeFiles/CSS/images/clender-icon-rollover.png\'"';
		strHtml+='onMouseOut= "this.src =\'../../IncludeFiles/CSS/images/clender-icon.png\'"></a>';
		strHtml+='</td>';
		strHtml+='</tr>';
		strHtml+='<tr>';
		strHtml+='<td align="left" valign="top" class="BodyHeadingFive">Interview Time:</td>';
		strHtml+='<td><span class="BodyText">Hours: ';
		strHtml+='<select name="cmbHours" id="cmbHours" class="BodyText">';
		strHtml+='<option value="00">00</option>';
		strHtml+='<option value="01">01</option>';
		strHtml+='<option value="02">02</option>';
		strHtml+='<option value="03">03</option>';
		strHtml+='<option value="04">04</option>';
		strHtml+='<option value="05">05</option>';
		strHtml+='<option value="06">06</option>';
		strHtml+='<option value="07">07</option>';
		strHtml+='<option value="08">08</option>';
		strHtml+='<option value="09">09</option>';
		strHtml+='<option value="10">10</option>';
		strHtml+='<option value="11">11</option>';
		strHtml+='<option value="12">12</option>';
		strHtml+='</select>';
		strHtml+='&nbsp;';
		strHtml+='Minutes:&nbsp;</span>';
		strHtml+='<select class="eBodyText" name="cmbMinutes" id="cmbMinutes">';
			
		for(var i=0;i<60;i+=15)
		{
			if(i==0)
			{
				 strHtml+='<option value="00">00</option>';
			}
			else
			{
				 strHtml+='<option value='+i+'>'+i+'</option>';
			}	
		}
		strHtml+='</select>';
		strHtml+='&nbsp;&nbsp;';
		strHtml+='<select id="cmbTimeFormat" name="cmbTimeFormat">';
		strHtml+='<option value="AM" selected>AM</option>';
		strHtml+='<option value="PM">PM</option>';
		strHtml+='</select></td>';
		strHtml+='</tr>';
		strHtml+='<tr>';
		strHtml+='<td>&nbsp;</td>';
		strHtml+='<td>&nbsp;</td>';
		strHtml+='</tr>';
		strHtml+='</table></form>';
		document.getElementById("DivScheHtml").innerHTML=strHtml;

		var strButtonHtml='<a href="#" onClick="UpdateInterivew('+pIntScheduleId+','+pIntStatus+');"><img src="../../IncludeFiles/CSS/images/update-button.jpg"></a>&nbsp;';
		strButtonHtml+='<a href="#" onClick="BackDashBoard();"><img src="../../IncludeFiles/CSS/images/backtoboard-button.jpg"></a>';
	
		document.getElementById("DivButton").innerHTML=strButtonHtml;
	}
	
	/************************************************************************
	*
	*	Function Name:	UpdateInterivew									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function UpdateInterivew(pIntScheduleId,pIntStatus)
	{
		var url = 'GUIService/ResponsesService.php?action=changeschedule'; 
		var strNtime=document.getElementById("cmbHours").value+':'+document.getElementById("cmbMinutes").value+' '+document.getElementById("cmbTimeFormat").value;
		var par='sceid='+pIntScheduleId+'&status='+pIntStatus+'&ndate='+document.getElementById("txtInterviewDate").value+'&ntime='+strNtime;
	
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							parameters:par,
							onSuccess: function(transport) 
							{ 
								document.getElementById("OnRampMessage").innerHTML="";
								
								document.getElementById("OnRampMessage").innerHTML="<span class='BodyTextMessage'>Your schedule has been updated successfully.</span>";
							} 
						}); 	
	}
	/************************************************************************
	*	Function Name	:	SearchJob									
	*	Author Name		: 	Ramish Hashmi
	*	 Synopsis		:	 Searches various jobs posted on the portal 																
	*************************************************************************/	
	function SearchJob(pIntUserId)
	{
		var keyword = document.getElementById("txtJobSearch").value;
		if(keyword=='')
		   {
			   alert("Please enter keyword for search");
			   document.getElementById("txtCandidateSearch").focus();		
			   return false;
		   }
		   
		else
			{
				var url = 'GUIService/JobsService.php?action=searchjob'; 
				var par='keyword='+keyword
						+'&userId='+pIntUserId;
			document.getElementById("divJobOpportunities").innerHTML="";
			document.getElementById("divJobOpportunities").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
				var myRequest= new Ajax.Request(
					url, 
					{   
						method: 'post',
						parameters:par,
						onSuccess: function(transport) 
						{ 
							document.getElementById("divJobOpportunities").innerHTML=transport.responseText;
						} 
					}); 
				
		}
		
	}
	/************************************************************************
	*	Function Name	:	resumeUploadForm									
	*	Author Name		: 	Ramish Hashmi
	*	 Synopsis		:	 resume uploading form 																
	*************************************************************************/	
	function resumeUploadForm(pIntUserId)
	{
		var par='userId='+pIntUserId;
		var url='GUIService/OnRamperService.php?action=uploadresumeform';
		document.getElementById("divJobOpportunities").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
				var myRequest= new Ajax.Request(
					url, 
					{   
						method: 'post',
						parameters:par,
						onSuccess: function(transport) 
						{ 
							document.getElementById("divDashBoard").innerHTML=transport.responseText;
						} 
					}); 
	}
	/************************************************************************
	*	Function Name	:	UploadResume									
	*	Author Name		: 	Ramish Hashmi
	*	 Synopsis		:	 Save Resume path to the databse 																
	*************************************************************************/	
	function UploadResume(pIntUserId)
	{
	
		var path = document.getElementById("image_path").value;
		var par='userId='+pIntUserId
				 +'&resume='+path;
		var url='GUIService/OnRamperService.php?action=uploadresume';
		//document.getElementById("divJobOpportunities").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
		var myRequest= new Ajax.Request(
				url, 
				{   
					method: 'post',
					parameters:par,
					onSuccess: function(transport) 
					{
						
						if(transport.responseText==1)
							{
								window.location="index.php?q=onramper";
							}
						
					} 
				}); 		 
		
	}
	/************************************************************************
	*	Function Name	:	BackToJobs									
	*	Author Name		: 	Ramish Hashmi
	*	 Synopsis		:	After Search goes back to jobs																
	*************************************************************************/	
	function BackToJobs(pIntUserId)
	{
		document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
		var myRequest= new Ajax.Request(
				url, 
				{   
					method: 'post',
					parameters:par,
					onSuccess: function(transport) 
					{
						document.getElementById("divJobOpportunities").innerHTML=transport.responseText;
						
					} 
				}); 		 
		
		
	}
	/***************************************************************************
    * 	Function Name	: 	CheckSpaces() 
	* 	Synopsis		: 	Check for spaces and valid string input
	*	Author			:	Ramish Hashmi
	****************************************************************************/
	function CheckSpaces(string)
	{
		if(!string || string.length==0)
		{
			return false;
		}
		code=string.charCodeAt(0);
		if(code == 32)
		{
			return false
		}
		else
		{
			return true;
		}
	}
	/***************************************************************************
    * 	Function Name	: 	CheckNumbers() 
	* 	Synopsis		: 	Check for valid input string charecters
	****************************************************************************/
	function CheckNumbers(string)
	{
		
		
		for(var i=0;i<string.length;i++)
		{
			code=string.charCodeAt(i);
			/*if user name has . or - or _ in anywhere in user name, and also between a-z,0-9, caps does not matter*/
			
			if((code>=48) &&(code<=57))
			{
				continue;
			}
			else
			{
				return false;
			}		
		}
		return true;
	}//end function
    /***************************************************************************
    * 	Function Name	: 	getFunctionalArea()
	* 	Author			: 	Ramish Hashmi
	* 	Synopsis		: 	Gets the functional area details
	****************************************************************************/
	function getFunctionalArea(pIntIndustryId)
	{ 
		
		if(pIntIndustryId==0)
		{
			var par ='industryId='+1;
		}
		else
		{
			var par ='industryId='+document.getElementById('cmbIndustry').value;
		}

		var url = 'GUIService/onRamperService.php?action=functionalArea';	
		

		document.getElementById("DivFunctArea").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
		var myRequest= new Ajax.Request(
			url, 
		{   
			method: 'post',
			parameters:par,
			onSuccess: function(transport) 
			{ 
		
			
				//document.getElementById("dummyCityState").style.visibility="hidden";
				//document.getElementById("dummyCityState").style.display="none";
				document.getElementById("DivFunctArea").innerHTML=transport.responseText;
			} 
		});
		
	}
	/************************************************************************
	*
	*	Function Name:	BackDashBoard									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	/*
	function BackDashBoard()
	{
		window.location="index.php?q=onramper";	
	}
	*/
	/************************************************************************
	*
	*	Function Name:	GetEventDetailById									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function GetEventDetailById(pIntEventId, pIntUserId)
	{

		var url = 'GUIService/EventService.php?action=eventdetail&eventid='+pIntEventId+'&uid='+pIntUserId;
		var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{     
				document.getElementById("divDashBoard").innerHTML=transport.responseText;
			} 
		});
	}
	
	/************************************************************************
	*
	*	Function Name:	PaggingMyJobs									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/		
	function PaggingMyJobs(pIntUserId,pIntStartIndex,pIndeEndIndex,pIntPageNo,pIntTotalPage,pStatus,pIntTotalRecord,pIntLimit,pIntDashBoard)
	{
		if(pStatus==2)
		{
				pIntPageNo=pIntPageNo-1;
				pIntStartIndex=pIntStartIndex-pIntLimit;
				pIndeEndIndex=pIntLimit;
		}
		else
		{
			if(pIntPageNo==pIntTotalPage)
			{
				pIntStartIndex=pIntTotalRecord-pIntLimit;
				pIndeEndIndex=5;
			}
			else
			{
				pIntPageNo=pIntPageNo+1;
				pIntStartIndex=pIntStartIndex+pIntLimit;
				pIndeEndIndex=pIntLimit;
			}	
		}
		
		if(pStatus==4)
		{
			pIntStartIndex=pIntTotalPage*pIntLimit-pIntLimit;	
			
		}
		if(pStatus==1)
		{
			pIntStartIndex=0;	
			pIndeEndIndex=pIntLimit;
			
		}
		
		if(pIntDashBoard==0)
		{
			document.getElementById("DivMyJobs").innerHTML="<img src=ImageFiles/indicator_medium.gif>"; 
		}
		else
		{
			document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>"; 
		}
		var url = 'GUIService/JobsService.php?action=pagemyjob&pStart='+pIntStartIndex+'&pEnd='+pIndeEndIndex+'&uid='+pIntUserId+'&pPid='+pIntPageNo+'&pStatus='+pIntDashBoard; 
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							onSuccess: function(transport) 
							{ 
								if(pIntDashBoard==0)
								{	
									document.getElementById("DivMyJobs").innerHTML=transport.responseText;
								}
								else
								{
									document.getElementById("divDashBoard").innerHTML=transport.responseText;
								}
							} 
						}); 
	}
	/************************************************************************
	*
	*	Function Name:	GetAllMyJobs									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/		
	function GetAllMyJobs(pIntUserId)
	{
		var url = 'GUIService/JobsService.php?action=getAllMyJobs';
		var par = 'userId='+pIntUserId;
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							parameters:par,
							onSuccess: function(transport) 
							{      
								document.getElementById("divDashBoard").innerHTML=transport.responseText;
							} 
						});	
	}
	/************************************************************************
	*
	*	Function Name:	GetAllMyJobs									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/		
	function GetAllOnJobsOppertunities(pIntUserId)
	{
		var url = 'GUIService/JobsService.php?action=morejob';
		var par = 'userId='+pIntUserId;
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							parameters:par,
							onSuccess: function(transport) 
							{      
								document.getElementById("divDashBoard").innerHTML=transport.responseText;
							} 
						});	
	}
	/************************************************************************
	*
	*	Function Name:	PaggingOnJobsWishList									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/		
	function PaggingOnJobsWishList(pIntUserId,pIntStartIndex,pIndeEndIndex,pIntPageNo,pIntTotalPage,pStatus,pIntTotalRecord,pIntLimit,pIntDashBoard)
	{
		if(pStatus==2)
		{
				pIntPageNo=pIntPageNo-1;
				pIntStartIndex=pIntStartIndex-pIntLimit;
				pIndeEndIndex=pIntLimit;
		}
		else
		{
			if(pIntPageNo==pIntTotalPage)
			{
				pIntStartIndex=pIntTotalRecord-pIntLimit;
				pIndeEndIndex=5;
			}
			else
			{
				pIntPageNo=pIntPageNo+1;
				pIntStartIndex=pIntStartIndex+pIntLimit;
				pIndeEndIndex=pIntLimit;
			}	
		}
		
		if(pStatus==4)
		{
			pIntStartIndex=pIntTotalPage*pIntLimit-pIntLimit;	
			
		}
		if(pStatus==1)
		{
			pIntStartIndex=0;	
			pIndeEndIndex=pIntLimit;
			
		}
		
		if(pIntDashBoard==0)
		{
			document.getElementById("DivJobsWishList").innerHTML="<img src=ImageFiles/indicator_medium.gif>"; 
		}
		else
		{
			document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>"; 
		}
		var url = 'GUIService/JobsService.php?action=pagejobwishlist&pStart='+pIntStartIndex+'&pEnd='+pIndeEndIndex+'&uid='+pIntUserId+'&pPid='+pIntPageNo+'&pStatus='+pIntDashBoard; 
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							onSuccess: function(transport) 
							{ 
								if(pIntDashBoard==0)
								{	
									document.getElementById("DivJobsWishList").innerHTML=transport.responseText;
								}
								else
								{
									document.getElementById("divDashBoard").innerHTML=transport.responseText;
								}
							} 
						}); 
	}
	/************************************************************************
	*
	*	Function Name:	GetAllMyJobs									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/		
	function GetAllOnJobsWishList(pIntUserId)
	{
		var url = 'GUIService/JobsService.php?action=getAllOnJobsWishList';
		var par = 'userId='+pIntUserId;
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							parameters:par,
							onSuccess: function(transport) 
							{      
								document.getElementById("divDashBoard").innerHTML=transport.responseText;
							} 
						});	
	}
	/************************************************************************
	*
	*	Function Name:	showOnPopup									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/		

	var baseText = null; 
	function showOnPopup(pIntJobId,pIntUserId,pIntStatus,w,h,pStrJobTitle,pStrJobDescription,pIntDashboardStatus,pStart,pEnd,pPage)
	{   
		var e = window.event;
		
		var y=100;
		var x=(GetBrowserWidth()- w)/2;

		var popUp = document.getElementById("popupcontent");    
		popUp.style.top = y+"px";   
		popUp.style.left =x+"px";   
		popUp.style.width = w + "px";   
		popUp.style.height = h + "px";    
		if (baseText == null) 
		baseText = popUp.innerHTML;   
		var strText='<div id=\"statusbar\" valign="top">';
		strText+='<table border=0 cellspacing=2 cellpading=2 width=525>';
		strText+='<tr>';
		strText+='<td valign="top" align=center colspan=2 width=525>';
		strText+='<span class="BodyHeadingOne">Job Details</span>';
		strText+='</td>';
		strText+='</tr>';
		
		strText+='<tr>';
		strText+='<td valign=top align=left width=150>';
		strText+='<span class="BodyHeadingTwo">Job Title:</span>';
		strText+='</td>';
		strText+='<td valign=top align=left><span class="BodyText">';
		strText+=pStrJobTitle;
		strText+='</span></td>';
		strText+='</tr>';
		
		strText+='<tr>';
		strText+='<td valign=top align=left>';
		strText+='<span class="BodyHeadingTwo">Job Description:</span>';
		strText+='</td>';
		strText+='<td valign=top align=left><span class="BodyText">';
		strText+=pStrJobDescription;
		strText+='</span></td>';
		strText+='</tr>';
		
		strText+='<tr>';
		strText+='<td valign=top align=left>';
		strText+='<span class="BodyHeadingTwo">Cover Letter:</span>';
		strText+='</td>';
		strText+='<td valign=top align=left><span class="BodyText">';
		strText+='<textarea id="txtCoverLetter" name="txtCoverLetter" rows=10 cols=50></textarea>';
		strText+='</span></td>';
		strText+='</tr>';
		
		strText+='<tr>';
		strText+='<td valign=top align=center></td>';
		strText+='<td valign=top align=left>';
		strText+='<span class="BodyTextMessageError">';
		strText+='Are you sure you want to apply?';
		strText+='</span></td>';
		strText+='</tr>';
		strText+='<tr>';
		strText+='<td valign=top align=center colspan=2 width=525 height=10>';
		strText+='<span class="BodyText">';
		strText+='';
		strText+='</span></td>';
		strText+='</tr>';
		strText+='<tr>';
		strText+='<td valign=top align=center width=525 colspan=2>';
		strText+='<a href="#" onClick="ApplyOnForJob('+pIntJobId+','+pIntUserId+','+pIntStatus+','+pIntDashboardStatus+','+pStart+','+pEnd+','+pPage+')"><img src="../IncludeFiles/CSS/images/yes-button.jpg"></a>';
		
		strText+='&nbsp;<a href="#" onclick=hidePopup();><img src="../IncludeFiles/CSS/images/no-button.jpg"></a>';
		strText+='</td>';
		strText+='</tr>';
	
		strText+='</table></div>';
		popUp.innerHTML = baseText+strText;
		
		//<input type="button" onclick=\"hidePopup();\">Close window<button></div>";
		var sbar = document.getElementById("statusbar");   
		sbar.style.marginTop = 0 + "px";  
		 popUp.style.visibility = "visible";
	}
	function hidePopup()
	{   
		var popUp = document.getElementById("popupcontent");   
		popUp.style.visibility = "hidden";
	}
	/************************************************************************
	*
	*	Function Name:	ApplyOnForJob									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function ApplyOnForJob(pIntJobId,pIntUserId,pIntStatus,pIntDashBoardStatus,pStart,pEnd,pPage)
	{
		
		var strCoverLetter=document.getElementById("txtCoverLetter").value;
		var strResponse='';
		
		if(document.getElementById("OnRampMessage"))
			document.getElementById("OnRampMessage").innerHTML="";
		
		var url = 'GUIService/OnRamperService.php?action=add&func=apply&userid='+pIntUserId+'&jobid='+pIntJobId+'&pStart='+pStart+'&pEnd='+pEnd+'&pPage='+pPage; 
		// notice the use of a proxy to circumvent the Same Origin Policy. 
		var par='cover='+strCoverLetter;
		if(document.getElementById("OnRampMessage"))
			document.getElementById("OnRampMessage").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
		
		var myRequest= new Ajax.Request(
			url, 
		  {   
			method: 'post',
			parameters:par,
			onSuccess: function(transport) 
			{    
				hidePopup();
				strResponse=transport.responseText;//;
				strResponse=strResponse.split("+");
				
				if(strResponse[0]==-1)
				{
				  if(document.getElementById("OnRampMessage"))
				  {
					document.getElementById("OnRampMessage").innerHTML="";
					document.getElementById("OnRampMessage").innerHTML="<span class=BodyTextMessageError>Error</span>";
				  }
				}
				else if(strResponse[0]==-2)
				{
				  if(document.getElementById("OnRampMessage"))
				  {
					document.getElementById("OnRampMessage").innerHTML="";
					document.getElementById("OnRampMessage").innerHTML="<span class=BodyTextMessageError>You have already applied for this job</span>";
				  }
				}
				
				else
				{
					if(pIntStatus==1)
					{
						document.getElementById("OnRampMessage").innerHTML="";
						document.getElementById("OnRampMessage").innerHTML="<span class=BodyTextMessage>Your application has been submitted</span>";
					}
					else
					{
						
						if(pIntDashBoardStatus==0)
						{
							document.getElementById("divJobOpportunities").innerHTML=strResponse[0];
							document.getElementById("DivMyJobs").innerHTML=strResponse[1];
							document.getElementById("DivJobsWishList").innerHTML=strResponse[2];
							document.getElementById("OnRampMessage").innerHTML="";
							document.getElementById("OnRampMessage").innerHTML="<span class=BodyTextMessage>Your application has been submitted</span>";
						}
						else if(pIntDashBoardStatus==1)
						{
							
							document.getElementById("OnRampMessage").innerHTML="";
							document.getElementById("OnRampMessage").innerHTML="<span class=BodyTextMessage>Your application has been submitted</span>";
						}
					}
				}
			} 
		});
	}
	
	/************************************************************************
	*	Function Name	:	keywords									
	*	Author Name		: 	Ramish Hashmi																		
	*************************************************************************/	
	function keywords(pIntUserId)
	{
		var url = 'GUIService/UserInfoService.php?action=getkeywords&uid='+pIntUserId;
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							//parameters:par,
							onSuccess: function(transport) 
							{      
								document.getElementById("divDashBoard").innerHTML=transport.responseText;
							} 
						});	
	}
	/************************************************************************
	*	Function Name	:	editKeywords									
	*	Author Name		: 	Ramish Hashmi																		
	*************************************************************************/	
	function editKeywords(pIntUserId)
	{
		
		document.getElementById("keywordError").innerHTML="";
		
		if(document.getElementById("keywords").value=='')
		 {
			document.getElementById("keywordError").innerHTML="Field Required";
			return;
		 }
		
		else if(!CheckSpaces(document.getElementById("keywords").value))
		 {
			document.getElementById("keywordError").innerHTML="Invalid Data Entry";
			return;
		 }
		 
		 var url = 'GUIService/UserInfoService.php?action=editKeywords';
		 var par = 'userId='+pIntUserId+
		 			'&keywords='+document.getElementById("keywords").value;
		
		 var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							parameters:par,
							onSuccess: function(transport) 
							{ 
							//document.getElementById("divDashBoard").innerHTML=transport.responseText;
								if(transport.responseText==1)    
								  {
									  window.location="index.php?q=onramper";
								  }
							} 
						});	
	   }
	  /************************************************************************
	   *		Function Name	:	RegisterForEvent									
	   *		Author Name		: 	Ramish Hashmi																		
	   *************************************************************************/	
	   function RegisterForEvent(pIntEventId, pIntUserId)
	   {
		 var url = 'GUIService/EventService.php?action=eventregister';
		 var par = 'userId='+pIntUserId+'&eventid='+pIntEventId;
		
		 var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							parameters:par,
							onSuccess: function(transport) 
							{ 
							  document.getElementById("DivMsgEvent").innerHTML="";	
					   		  document.getElementById("DivMsgEvent").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
							  if(transport.responseText==1)    
							    {
								  document.getElementById("DivMsgEvent").innerHTML="<span class=BodyTextMessage>Your request has been submitted</span>";

								  //window.location="index.php?q=onramper";
								}
							} 
						});	 
	   }
	   /************************************************************************
	   *		Function Name	:	WithdrawFromEvent									
	   *		Author Name		: 	Ramish Hashmi																		
	   *************************************************************************/
	   function WithdrawFromEvent(pIntEventId,pIntUserId)
	    {
		 if(confirm("Are you sure you want to withdraw from the event?"))
		  {
			var pIntStatus = -2;
			var url = 'GUIService/EventService.php?action=eventwithdraw';
		 	var par = 'userId='+pIntUserId+'&eventid='+pIntEventId+'&status='+pIntStatus;
		 	var myRequest= new Ajax.Request(
					url, 
					{   
					   method: 'post',
					   parameters:par,
					   onSuccess: function(transport) 
						{ 
						   document.getElementById("DivMsgEvent").innerHTML="";	
				   		   document.getElementById("DivMsgEvent").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
						   document.getElementById("DivMsgEvent").innerHTML=transport.responseText;
							if(transport.responseText==1)    
						    {
							  document.getElementById("DivMsgEvent").innerHTML="<span class=BodyTextMessage>Successfully withdrawn</span>";
							}
						} 
				  });	 
			}
		  }
		 /************************************************************************
	      *		Function Name	:	AdvanceJobSearchForm									
	      *		Author Name		: 	Ramish Hashmi																		
	      *************************************************************************/
		 function AdvanceJobSearchForm(pIntUserId,pIntCompanyId)
		 {	
		 	var url = 'GUIService/JobsService.php?action=advancesearchjobform&uid='+pIntUserId+'&compid='+pIntCompanyId; 
		 	var myRequest= new Ajax.Request(
				url, 
				{   
					method: 'post',
					onSuccess: function(transport) 
					{      
						document.getElementById("divDashBoard").innerHTML=transport.responseText;
						document.getElementById("DivJobSearch").innerHTML="";
					} 
				});
		 }
		 /************************************************************************
	     *
		 *		Function Name	:	AdvanceJobSearchForm									
	     *		Author Name		: 	Ramish Hashmi																		
	     *
		 *************************************************************************/
         function AdvancedSearchJob(pIntUserId,pIntCompanyId)
		 {
		    document.getElementById("DivJobSearch").innerHTML="";
			document.getElementById("titleError").innerHTML="";
			document.getElementById("jobTypeError").innerHTML="";
			document.getElementById("skillsError").innerHTML="";
			document.getElementById("educationError").innerHTML="";
			document.getElementById("cityError").innerHTML="";
			
			if(document.getElementById("title").value!='')
			{
				if(!CheckSpaces(document.getElementById("title").value))
		 		 {
					document.getElementById("titleError").innerHTML="Invalid Data Entry";
					return;
		 		 }
				else if(!CheckStringLength(document.getElementById("title").value))
		 		 {
					document.getElementById("titleError").innerHTML="String length too large. Only 255 characters allowed";
					return;
		 		 }
			}
			
			if(document.getElementById("education").value!='')
			{
				if(!CheckSpaces(document.getElementById("education").value))
		 		 {
					document.getElementById("educationError").innerHTML="Invalid Data Entry";
					return;
		 		 }
				else if(!CheckStringLength(document.getElementById("education").value))
		 		 {
					document.getElementById("educationError").innerHTML="String length too large. Only 255 characters allowed";
					return;
		 		 }
			}
			
			if(document.getElementById("skills").value!='')
			{
				if(!CheckSpaces(document.getElementById("skills").value))
		 		 {
					document.getElementById("skillsError").innerHTML="Invalid Data Entry";
					return;
		 		 }
				else if(!CheckStringLength(document.getElementById("skills").value))
		 		 {
					document.getElementById("skillsError").innerHTML="String length too large. Only 255 characters allowed";
					return;
		 		 }
			}
			if(document.getElementById("city").value!='')
			{
				if(!CheckSpaces(document.getElementById("city").value))
		 		 {
					document.getElementById("cityError").innerHTML="Invalid Data Entry";
					return;
		 		 }
				else if(!CheckStringLength(document.getElementById("city").value))
		 		 {
					document.getElementById("cityError").innerHTML="String length too large. Only 255 characters allowed";
					return;
		 		 }
			}
			
		  var url = 'GUIService/JobsService.php?action=advancesearchresult';
		  var par = 'userId='+pIntUserId+
		  			'&title='+document.getElementById("title").value+
					'&jobType='+document.getElementById("cmbJobType").value+
					'&department='+document.getElementById("cmbDepartment").value+
					'&industry='+document.getElementById("cmbIndustry").value+
					'&industryExp='+document.getElementById("industryExp").value+
					'&skills='+document.getElementById("skills").value+
					'&education='+document.getElementById("education").value+
					'&city='+document.getElementById("city").value+
					'&state='+document.getElementById("cmbState").value+
					'&state='+document.getElementById("cmbState").value+
					'&compId='+pIntCompanyId;
		
		  document.getElementById("DivJobSearch").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
		  var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							parameters:par,
							onSuccess: function(transport) 
							{ 
							  document.getElementById("DivJobSearch").innerHTML=transport.responseText;
							  
							} 
						});	 
			
			 
		 }
	   /************************************************************************
 	    *
	    *	Function Name:	CheckStringLength									
	    *	Author Name: 	Nabeel Bin Ezad
	    *																		
	    *************************************************************************/	
		function CheckStringLength(pStrObject)
		{
			if(pStrObject.length>50)
			{
				return false;
			}
		  return true;
		} 
		/************************************************************************
 	    *
	    *	Function Name:	DeleteResumeId									
	    *	Author Name: 	Nabeel Bin Ezad
	    *																		
	    *************************************************************************/	
		function DeleteResumeId(pIntResumeId)
		{
				if(confirm("Are you sure you want to delete resume"))
				{
					 var url = 'GUIService/JobsService.php?action=deleteresume&resumeid='+pIntResumeId;
					   var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							onSuccess: function(transport) 
							{ 
								backToDashboard();
							} 
						});	 
				}
		}
		/************************************************************************
 	    *
	    *	Function Name:	JobOptionsSort									
	    *	Author Name: 	Ramish Hashmi
	    *																		
	    *************************************************************************/	
		function JobOptionsSort(pIntUserId,pIntStartIndex,pIntEndIndex,pIntStatus,pIntPageNo,pIntSort)
		{	
			var url = 'GUIService/JobsService.php?action=jobonsort&pStart='+pIntStartIndex+'&pEnd='+pIntEndIndex+'&uid='+pIntUserId+'&pPid='+pIntPageNo+'&pStatus='+pIntStatus+'&pSort='+pIntSort; 
		    document.getElementById("divJobOpportunities").innerHTML="<img src=ImageFiles/indicator_medium.gif>";

			var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							onSuccess: function(transport) 
							{ 
								
								   
									document.getElementById("divJobOpportunities").innerHTML=transport.responseText;
								
							} 
						}); 
		
		}
		/************************************************************************
		*
		*	Function Name:	GetJobsWishList									
		*	Author Name: 	Ramish Hashmi
		*																		
		*************************************************************************/		
		function GetJobsWishList(pIntUserId,pIntStartIndex,pIntEndIndex,pIntStatus,pIntPageNo,pIntSort)
		{
			var yPos =  document.documentElement.scrollTop;
			var url = 'GUIService/JobsService.php?action=wishlistsort&pStart='+pIntStartIndex+'&pEnd='+pIntEndIndex+'&uid='+pIntUserId+'&pPid='+pIntPageNo+'&pStatus='+pIntStatus+'&pSort='+pIntSort; 
		    document.getElementById("DivJobsWishList").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
			var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							onSuccess: function(transport) 
							{      
								window.scroll(0,yPos);
								document.getElementById("DivJobsWishList").innerHTML=transport.responseText;
							} 
						});	
		}
		/************************************************************************
		*
		*	Function Name:	GetJobsWishList									
		*	Author Name: 	Ramish Hashmi
		*																		
		*************************************************************************/		
		function GetMyJobSort(pIntUserId,pIntStartIndex,pIntEndIndex,pIntStatus,pIntPageNo,pIntSort)
		{
			var yPos =  document.documentElement.scrollTop;
			var url = 'GUIService/JobsService.php?action=myjobssort&pStart='+pIntStartIndex+'&pEnd='+pIntEndIndex+'&uid='+pIntUserId+'&pPid='+pIntPageNo+'&pStatus='+pIntStatus+'&pSort='+pIntSort; 
		    document.getElementById("DivMyJobs").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
			var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							onSuccess: function(transport) 
							{      
								window.scroll(0,yPos);
								document.getElementById("DivMyJobs").innerHTML=transport.responseText;
							} 
						});	
		}