	/************************************************************************
	*	File Name: 			programmanager.js								*
	*	Author Name: 		Nabeel Bin Ezad									*
	*	Description:		Used Program Manager javascript functionality	*	
	*	Created Date:		25 February 2008.								*
	*	Modified Date: 		19 Jan 2009.									*
	*	Last Modified By:	Adil Khan	   									*
	*																		*
	*************************************************************************/	
	var intSkillNo;
	var intEduNo;
	var intOnOfStatus=0;
	var divJobDetail;
	var intGlbOrder=0;
	var intCounterEdu=0;
	var tempY; 
	var tempX;
	/************************************************************************
	*
	*	Function Name:	GetPmDashBoad									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function GetPmDashBoad(pIntUserId,pStrUserName,pStrPassword,pIntCompanyId)
	{
		
	
		var url = 'GUIService/ProgramManagerService.php?action=select&uid='+pIntUserId+'&un='+pStrUserName+'&ut='+pStrPassword+'&compid='+pIntCompanyId; 
			// 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:	PaggingPostedJobs									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/		
	function PaggingPostedJobs(pIntUserId,pIntStartIndex,pIndeEndIndex,pIntPageNo,pIntTotalPage,pStatus,pIntTotalRecord,pIntLimit,pIntDashBoard,pIntCompanyId,pIntOrder)
	{
		xPos = document.documentElement.scrollTop;
		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(pIntDashBoard==0)
		{
			document.getElementById("DivPostedJobs").innerHTML="<img src=ImageFiles/indicator_medium.gif>"; 
		}
		else
		{
			document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>"; 
		}
		var url = 'GUIService/JobsService.php?action=pagepostjob&pStart='+pIntStartIndex+'&pEnd='+pIndeEndIndex+'&uid='+pIntUserId+'&pPid='+pIntPageNo+'&pStatus='+pIntDashBoard+'&compid='+pIntCompanyId+'&order='+pIntOrder; 
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							onSuccess: function(transport) 
							{ 
								window.scroll(0,xPos);
								if(pIntDashBoard==0)
								{	
									document.getElementById("DivPostedJobs").innerHTML=transport.responseText;
								}
								else
								{
									document.getElementById("divDashBoard").innerHTML=transport.responseText;
								}
							}
							
						}); 
	}
	
	/************************************************************************
	*
	*	Function Name:	PaggingCandidates									
	*	Author Name: 	Adil Khan
	*																		
	*************************************************************************/		
	function PaggingCandidates(pIntUserId,pIntStartIndex,pIndeEndIndex,pIntPageNo,pIntTotalPage,pStatus,pIntTotalRecord,pIntLimit,pIntDashBoard,pIntCompanyId,pIntOrder)
	{
		xPos = document.documentElement.scrollTop;
		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;	
			
		}
		
		
		document.getElementById("DivCandidatesWishList").innerHTML="<img src=ImageFiles/indicator_medium.gif>"; 
		
		var url = 'GUIService/UserInfoService.php?action=candidatewishlistsort&pStart='+pIntStartIndex+'&pEnd='+pIndeEndIndex+'&uid='+pIntUserId+'&page='+pIntPageNo+'&pStatus='+pIntDashBoard+'&sort='+pIntOrder; 
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							onSuccess: function(transport) 
							{ 
								window.scroll(0,xPos);									
								document.getElementById("DivCandidatesWishList").innerHTML=transport.responseText;
								
							}
							
						}); 
	}
	
	
	/************************************************************************
	*
	*	Function Name:	PaggingInbox									
	*	Author Name: 	Adil Khan
	*																		
	*************************************************************************/		
	function PaggingInbox(pIntUserId,pIntStartIndex,pIndeEndIndex,pIntPageNo,pIntTotalPage,pStatus,pIntTotalRecord,pIntLimit,pIntDashBoard,pIntCompanyId,pIntOrder)
	{
		xPos = document.documentElement.scrollTop;

		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;	
			
		}
		
		
		document.getElementById("DivUserMessage").innerHTML="<img src=ImageFiles/indicator_medium.gif>"; 
		
		var url = 'GUIService/MessageService.php?action=sortedinbox&pStart='+pIntStartIndex+'&pEnd='+pIndeEndIndex+'&uid='+pIntUserId+'&pPage='+pIntPageNo+'&compid='+pIntCompanyId+'&pSort='+pIntOrder+'&status=1'; 
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							onSuccess: function(transport) 
							{ 
								window.scroll(0,xPos);									
								document.getElementById("DivUserMessage").innerHTML=transport.responseText;								
							}
							
						}); 
	}
	
	/************************************************************************
	*
	*	Function Name:	GetAllMssgs									
	*	Author Name: 	Adil Khan
	*																		
	*************************************************************************/		
	function GetAllMssgs(pIntUserId,pIntCompanyId,pIntOrderStatus)
	{
		var url = 'GUIService/MessageService.php?action=getAllMssgs&compid='+pIntCompanyId+'&order='+pIntOrderStatus+'&status=1';
		var par = 'uid='+pIntUserId;
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							parameters:par,
							onSuccess: function(transport) 
							{      
								document.getElementById("divDashBoard").innerHTML=transport.responseText;
							} 
						});	
	}

	/************************************************************************
	*
	*	Function Name:	GetAllWishList									
	*	Author Name: 	Adil Khan
	*																		
	*************************************************************************/		
	function GetAllWishList(pIntUserId)
	{
		var url = 'GUIService/UserInfoService.php?action=getAllCandidatesWishList';
		var par = 'uid='+pIntUserId;
		document.getElementById("DivCandidates").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:	PostNewJob									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function PostNewJob(pIntUserId,pIntCompanyId)
	{
			
			var strResponse;
			var url = 'GUIService/JobsService.php?action=newpost&uid='+pIntUserId+'&compid='+pIntCompanyId; 
			document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
			var myRequest= new Ajax.Request(
				url, 
			{   
				method: 'post',
				onSuccess: function(transport) 
				{     
					strResponse=transport.responseText;//;
					strResponse=strResponse.split("+");
				
					intSkillNo=strResponse[0];
					intEduNo=strResponse[1];
					
					document.getElementById("divDashBoard").innerHTML=strResponse[2];
					
					GetStatesByCountryId(document.getElementById("cmbCountry").value);	
				} 
			});
	}
	/************************************************************************
	*
	*	Function Name:	GetStatesByCountryId									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function GetStatesByCountryId(pIntCountryId)
	{
		
		if(pIntCountryId==0)
		{
			pIntCountryId=document.getElementById("cmbCountry").value;	
		}
		var url = 'GUIService/CountryService.php?action=state&cid='+pIntCountryId;
		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: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	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:	AddPostJob									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function AddPostJob(pIntUserId,pIntCompanyId)
	{
		if(CheckSetting())
		{
			var arrSkilled=new Array();
			var intCounter=0;
			for(var i=1;i<=intSkillNo;i++)
			{
				var strChkName="chk"+i;
				if(document.getElementById(strChkName).checked==true)
				{
					arrSkilled[intCounter]=document.getElementById(strChkName).value;
					intCounter++;
				}
			}
			var arrEducation = new Array();
			
			for(var j=0;j<=intEduNo;j++)
			{
				
				var strChkNameSkill="chkedu"+j;
				
				if(document.getElementById(strChkNameSkill).checked==true)
				{
					arrEducation[intCounterEdu]=document.getElementById(strChkNameSkill).value;
					intCounterEdu++;
				}
			}

			var url = 'GUIService/JobsService.php?action=addjob&uid='+pIntUserId;

			var strJobTitle=document.getElementById('txtJobTitle').value;
			
			var intJobTypeId=document.getElementById('cmbJobType').value;
			
			var intDepartment=document.getElementById('cmbDepartment').value;
			var intIndustry=document.getElementById('cmbIndustry').value;
			var strExperience=document.getElementById('cmdExperience').value;
			var intCountryId=document.getElementById('cmbCountry').value;
			var intStateId=document.getElementById('cmbState').value;
			var intCityId=0;
			var strSkills=document.getElementById('txtSkills').value;
			var strJobDescription=document.getElementById('txtJobDescription').value;
			var strCity=document.getElementById('txtCity').value;		
			var strReqNo=document.getElementById('txtReqNo').value;
			var strPositionReportTo=document.getElementById('txtPositionReportTo').value;
		
			var par='skill='+strSkills+'&jobtitle='+strJobTitle+'&typeid='+intJobTypeId+'&deptid='+intDepartment+'&indid='+intIndustry+'&exp='+strExperience+'&countryid='+intCountryId+'&cityid='+intCityId+'&descrip='+strJobDescription+'&edu='+arrEducation+'&stateid='+intStateId+'&cityname='+strCity+'&compid='+pIntCompanyId+'&reqno='+strReqNo+'&reportTo='+strPositionReportTo;
			
			var myRequest= new Ajax.Request(
				url, 
			{   
				method: 'post',
				parameters:par,
				onSuccess: function(transport) 
				{     
					//document.getElementById("divDashBoard").innerHTML=transport.responseText;
					window.location="index.php?q=programmanager";
				} 
			});
		}
		
	}
	/************************************************************************
	*
	*	Function Name:	CheckSetting									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function CheckSetting()
	{
	
		if(document.getElementById('txtReqNo').value=="")
		{
			document.getElementById('DivJobReqMsg').innerHTML='<span class="ErrorMessage">Required Field</span>';
			document.getElementById('txtReqNo').focus();
			return false;
		}
		else
		{

			if(CheckStringLength(document.getElementById('txtReqNo').value))
			{
				document.getElementById('DivJobReqMsg').innerHTML="";
			}
			else
			{
				document.getElementById('DivJobReqMsg').innerHTML='<span class="ErrorMessage">String length too large. Only 255 characters allowed</span>';		
				document.getElementById('txtReqNo').focus();
				return false;	
			}
		}
		
		if(document.getElementById('txtJobTitle').value=="")
		{
			document.getElementById('DivJobTitleMsg').innerHTML='<span class="ErrorMessage">Required Field</span>';
			document.getElementById('txtJobTitle').focus();
			return false;
		}
		else
		{

			if(CheckStringLength(document.getElementById('txtJobTitle').value))
			{
				document.getElementById('DivJobTitleMsg').innerHTML="";
			}
			else
			{
				document.getElementById('DivJobTitleMsg').innerHTML='<span class="ErrorMessage">String length too large. Only 255 characters allowed</span>';		
				document.getElementById('txtJobTitle').focus();
				return false;	
			}
		}
		
		if(document.getElementById('txtPositionReportTo').value=="")
		{
			document.getElementById('DivPositionReportToMsg').innerHTML='<span class="ErrorMessage">Required Field</span>';
			document.getElementById('txtPositionReportTo').focus();
			return false;
		}
		else
		{

			if(CheckStringLength(document.getElementById('txtPositionReportTo').value))
			{
				document.getElementById('DivPositionReportToMsg').innerHTML="";
			}
			else
			{
				document.getElementById('DivPositionReportToMsg').innerHTML='<span class="ErrorMessage">String length too large. Only 255 characters allowed</span>';		
				document.getElementById('txtPositionReportTo').focus();
				return false;	
			}
		}
		
		if(document.getElementById('cmbJobType').value==-1)
		{
			document.getElementById('DivJobTypeMsg').innerHTML='<span class="ErrorMessage">Select job type</span>';
			document.getElementById('cmbJobType').focus();
			return false;
		}
		else
		{
			document.getElementById('DivJobTypeMsg').innerHTML="";		
		}
		
		if(document.getElementById('cmbDepartment').value==-1)
		{
			document.getElementById('DivJobDepartmentMsg').innerHTML='<span class="ErrorMessage">Select Department</span>';
			document.getElementById('cmbDepartment').focus();
			return false;
		}
		else
		{
			document.getElementById('DivJobDepartmentMsg').innerHTML="";		
		}
		
		if(document.getElementById('cmbIndustry').value==-1)
		{
			document.getElementById('DivJobIndustryMsg').innerHTML='<span class="ErrorMessage">Select Industry</span>';
			document.getElementById('cmbIndustry').focus();
			return false;
		}
		else
		{
			document.getElementById('DivJobIndustryMsg').innerHTML="";		
		}
		
		if(document.getElementById('cmdExperience').value==-1)
		{
			document.getElementById('divJobExpMsg').innerHTML='<span class="ErrorMessage">Select Experience</span>';
			document.getElementById('cmdExperience').focus();
			return false;
		}
		else
		{
			document.getElementById('divJobExpMsg').innerHTML="";		
		}
		
		
		if(document.getElementById('txtCity').value=="")
		{
			document.getElementById('DivCityMsg').innerHTML='<span class="ErrorMessage">Required Field</span>';		
			document.getElementById('txtCity').focus();
			return false;	
		}
		else
		{
			if(CheckStringLength(document.getElementById('txtCity').value))
			{
				document.getElementById('DivCityMsg').innerHTML="";
			}
			else
			{
				document.getElementById('DivCityMsg').innerHTML='<span class="ErrorMessage">String length too large. Only 255 characters allowed</span>';		
				document.getElementById('txtCity').focus();
				return false;	
			}
		}
		
		if(document.getElementById('cmbState').value=="")
		{
			document.getElementById('DivStateMsg').innerHTML='<span class="ErrorMessage">Select State</span>';
			document.getElementById('cmbState').focus();
			return false;
		}
		else
		{
			document.getElementById('DivStateMsg').innerHTML="";		
		}
		
		if(document.getElementById('txtSkills').value=="")
		{
			document.getElementById('DivSkillMsg').innerHTML='<span class="ErrorMessage">Required Field</span>';
			document.getElementById('txtSkills').focus();
			return false;
		}
		else
		{
			if(CheckStringLength(document.getElementById('txtSkills').value))
			{
				document.getElementById('DivSkillMsg').innerHTML="";
			}
			else
			{
				document.getElementById('DivSkillMsg').innerHTML='<span class="ErrorMessage">String length too large. Only 255 characters allowed </span>';		
				document.getElementById('txtSkills').focus();
				return false;	
			}
		}

		if(CheckEducation()==false)
		{
			document.getElementById('divEducationMsg').innerHTML='<span class="ErrorMessage">Select Education</span>';
			
			return false;	
		}
		else
		{
			document.getElementById('divEducationMsg').innerHTML='';
		}
		
		if(document.getElementById('txtJobDescription').value=="")
		{
			document.getElementById('divJobDesMsg').innerHTML='<span class="ErrorMessage">Required Field</span>';
			document.getElementById('txtJobDescription').focus();
			return false;
		}
		else
		{
			document.getElementById('divJobDesMsg').innerHTML="";
		}
		return true;
	}
	/************************************************************************
	*
	*	Function Name:	CheckEducation									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	

	function CheckEducation()
	{
		var arrEducation = new Array();
			
			for(var j=0;j<=intEduNo;j++)
			{
				
				var strChkNameSkill="chkedu"+j;

				if(document.getElementById(strChkNameSkill).checked==true)
				{
					return true;
				}
			}	
		return false;	
	}
	/************************************************************************
	*
	*	Function Name:	CheckStringLength									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function CheckStringLength(pStrObject)
	{
		if(pStrObject.length>50)
		{
			return false;
		}
		return true;
	}
	/************************************************************************
	*
	*	Function Name:	InviteUserInterview									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function InviteUserInterview(pIntJobId,pIntUserId,pIntCompanyId)
	{
		
		var url = 'GUIService/ResponsesService.php?action=inviteinterview&uid='+pIntUserId+'&jobid='+pIntJobId+'&compid='+pIntCompanyId;
		var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{     
					
					if(transport.responseText==-1)
					{
						alert('Interview already scheduled against this application.');	
					}
					else
					{
						document.getElementById("divDashBoard").innerHTML=transport.responseText;
						GetCompanyAddress(pIntCompanyId);
					}
			} 
		});

	}
	/************************************************************************
	*
	*	Function Name:	SaveInviteInterview									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function SaveInviteInterview(pIntJobApplicationId)
	{
		
		
		if(CheckSaveInterviewSetting())
		{	
			var arrParticipant=new Array();
			var intCounter=0;
			for(var i=document.getElementById('cmbParticipant').options.length-1;i>=0;i--)
			{
				if(document.getElementById('cmbParticipant').options[i].selected)
				{
					arrParticipant[intCounter]=document.getElementById('cmbParticipant').options[i].value;
					intCounter++;
				}	
			}	
		
			var dteInterviewDate=document.getElementById('theDate').value;
			var dteInterviewTime=document.getElementById('cmbHours').value+':'+document.getElementById('cmbMinutes').value+' '+document.getElementById('cmbTimeFormat').value;
			var dteInterviewEndTime=document.getElementById('cmbEndHours').value+':'+document.getElementById('cmbEndMinutes').value+' '+document.getElementById('cmbEndTimeFormat').value;
			var intOnPhone=0;
			
			if(document.getElementById('chkPhone').checked==true)
			{
				intOnPhone=1;	
			}
			else
			{
				intOnPhone=0;				
			}
			/*if(intOnPhone==1)
			{
	
				//if(intOnOfStatus==0)
				//{
				
					var strAddress=document.getElementById('txthaddress').value;
					var intCity=0;
					var intCountry=document.getElementById('txthcountry').value;
					var strPhonrNumber=document.getElementById('txthphone').value;
					var intStateId=document.getElementById('txthstate').value;
					var strCity=document.getElementById('txthCityname').value;

				}
				
				else if (intOnOfStatus==1)
				{
					var strAddress=document.getElementById('txtAddress').value;
					
					var intStateId=document.getElementById('intStateId').value;
					var intCountry=document.getElementById('cmbCountry').value;
					var strPhonrNumber=document.getElementById('txtPhone').value;
					var strCity=document.getElementById('txthCityname').value;
				}
			}*/
			//else if(intOnPhone==0)
			//{
				if(document.getElementById('rdoOnSide').checked==true)
				{
					strAddress=document.getElementById("txthaddress").value;
					intCountry=document.getElementById("intCountryId").value;
					strPhonrNumber=document.getElementById("txthphone").value;;
					intStateId=document.getElementById("intStateId").value;
					strCity=document.getElementById("txthCityname").value;
				}
				else
				{
					strAddress=document.getElementById("txtAddress").value;
					intCountry=document.getElementById("cmbCountry").value;
					strPhonrNumber=document.getElementById("txtPhone").value;;
					intStateId=document.getElementById("cmbState").value;
					strCity=document.getElementById("txtCity").value;
				}
			//}
			var strDetail=document.getElementById('txtDetail').value;
			var url = 'GUIService/ResponsesService.php?action=saveinterview';
			
			var par = 'jobappid='+pIntJobApplicationId+'&idate='+dteInterviewDate+'&itime='+dteInterviewTime+'&onphone='+intOnPhone+'&add='+strAddress+'&country='+intCountry+'&phone='+strPhonrNumber+'&partic='+arrParticipant+'&detail='+strDetail+'&stateid='+intStateId+'&cityname='+strCity+'&iendtime='+dteInterviewEndTime;
			document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>"
			
			
			var myRequest= new Ajax.Request(
			url, 
			{   
				method: 'post',
				parameters:par,
				onSuccess: function(transport) 
				{     
					//alert(transport.responseText);
					//document.getElementById("divDashBoard").innerHTML=transport.responseText;
					
					if(transport.responseText==-1)
					{
						document.getElementById("DivErrMsg").innerHTML="<span class=successmsg>Interview already scheduled against this application.</span>";
					}
					else
					{
						 window.location="index.php?q=programmanager";							
					}
				} 
			});
		}
	}
	/************************************************************************
	*
	*	Function Name:	CheckSaveInterviewSetting									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function CheckSaveInterviewSetting()
	{
		
		if(document.getElementById('theDate').value=="")
		{
			document.getElementById("diveDateMsg").innerHTML='<span class="eBodyEroorText">Required Filed</span>';
			document.getElementById('theDate').focus();
			return false;
		}
		else
		{
			document.getElementById("diveDateMsg").innerHTML='';
			return true;
		}
		return true;
	}
	/************************************************************************
	*	Function Name:	BackDashBoard									
	*	Author Name: 	Nabeel Bin Ezad																		
	*************************************************************************/	
	function BackDashBoard()
	{
		strUrl=	"index.php?q=programmanager";
		window.location=strUrl;	
	}
	
	
	/************************************************************************
	 *	Function Name:	backToDashboard									
	 *	Author Name: 	Nabeel Bin Ezad																		
	 *************************************************************************/
	function backToDashboard()
	 {
		 strUrl=	"index.php?q=programmanager";
		window.location=strUrl;		
	
	 }
	/************************************************************************
	*
	*	Function Name:	InviterNewUser									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function InviterNewUser(pIntCompanyId)
	{
		var url = 'GUIService/UserInfoService.php?action=inviteuser&compId='+pIntCompanyId;
		var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{     
				document.getElementById("divDashBoard").innerHTML=transport.responseText;
			} 
		});
		
	}
	/************************************************************************
	*
	*	Function Name:	SaveInviteNewUser									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function SaveInviteNewUser(pIntCompanyId)
	{
		CheckInviteUserSetting(pIntCompanyId);
	}
	function InviteUser(pIntCompanyId)
	{
			var strFirstName=document.getElementById('txtFirstName').value;
			var strLastName =document.getElementById('txtLastName').value;
			var strEmailAddress=document.getElementById('txtEmailAddress').value;
			var strOtherDetail=document.getElementById('txtOtherDetail').value;
			var intUserType=document.getElementById('cmbType').value;
			var par='fname='+strFirstName+'&lname='+strLastName+'&eaddress='+strEmailAddress+'&other='+strOtherDetail+'&utype='+intUserType+'&compId='+pIntCompanyId;
			var url = 'GUIService/ResponsesService.php?action=inviteusersave';
			document.getElementById("divInviteMsg").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
			var myRequest= new Ajax.Request(
			url, 
			{   
				method: 'post',
				parameters:par,
				onSuccess: function(transport) 
				{     
					//document.getElementById("divInviteMsg").innerHTML= transport.responseText; 
					if(transport.responseText==1)
					{
					   document.getElementById("divInviteMsg").innerHTML= transport.responseText;     //'Request has been sent successfully';
						//window.location='index.php?q=programmanager';
						

						var strHtml='<table border=0 cellspacing=5 cellpading=5 width=700>';
						strHtml+='<tr>';
						strHtml+='<td align="center"><br><br>';
						strHtml+='<span class="BodyTextMessage">Invitation has been sent successfully</span>';
						strHtml+='</td>';
						strHtml+='</tr>';
						strHtml+='<tr>';
						strHtml+='<td align="center">';
						strHtml+='<a href="#" onclick="backToDashboard()">';
						strHtml+='<img border=0 src="../../IncludeFiles/CSS/images/backtoboard-button.jpg"  onMouseOver= "this.src =\'../../IncludeFiles/CSS/images/backtoboard-hover.jpg\'" onMouseOut= "this.src =\'../../IncludeFiles/CSS/images/backtoboard-hover.jpg\'"">	</a>';
						strHtml+='</td>';
						strHtml+='</tr>';
						strHtml+='</table>';
						document.getElementById("divDashBoard").innerHTML=strHtml;

					}
					else
					{
						//document.getElementById("divInviteMsg").innerHTML= transport.responseText;
						document.getElementById("divInviteMsg").innerHTML='<span class="ErrorMessage">Network failure, please contact your network administrator.</span>';
					}
					
				} 
			});
			
		//}
	}//
	/************************************************************************
	*
	*	Function Name:	CheckInviteUserSetting									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function CheckInviteUserSetting(pIntCompanyId)
	{
		
		if(document.getElementById('txtFirstName').value=="")
		{
			document.getElementById('divFirstNameMsg').innerHTML='<span class="ErrorMessage">Required Field</span>';
			document.getElementById('txtFirstName').focus();
			return false;
		}
		if(!CheckSpaces(document.getElementById('txtFirstName').value))
		{
			document.getElementById('divFirstNameMsg').innerHTML='<span class="ErrorMessage">Invalid Data Entry</span>';
			document.getElementById('txtFirstName').focus();
			return false;
		}
		else
		{
				
			if(CheckStringLength(document.getElementById('txtFirstName').value))
			{
				document.getElementById('divFirstNameMsg').innerHTML="";
			}
			else
			{
				document.getElementById('divFirstNameMsg').innerHTML='<span class="ErrorMessage">String length too large. Only 255 characters allowed</span>';		
				document.getElementById('txtFirstName').focus();
				return false;	
			}
		}
		
		if(document.getElementById('txtLastName').value=="")
		{
			document.getElementById('divLastNameMsg').innerHTML='<span class="ErrorMessage">Required Field</span>';
			document.getElementById('txtLastName').focus();
			return false;
		}
		
		if(!CheckSpaces(document.getElementById('txtLastName').value))
		{
			document.getElementById('divLastNameMsg').innerHTML='<span class="ErrorMessage">Invalid Data Entry</span>';
			document.getElementById('txtLastName').focus();
			return false;
		}
		else
		{

			if(CheckStringLength(document.getElementById('txtLastName').value))
			{
				document.getElementById('divLastNameMsg').innerHTML="";
			}
			else
			{
				document.getElementById('divLastNameMsg').innerHTML='<span class="ErrorMessage">String length too large. Only 255 characters allowed</span>';		
				document.getElementById('txtLastName').focus();
				return false;	
			}
		}
		
		if(document.getElementById('txtEmailAddress').value=="")
		{
			document.getElementById('divEmailAddressMsg').innerHTML='<span class="ErrorMessage">Required Field</span>';
			document.getElementById('txtEmailAddress').focus();
			return false;
		}
		else if(!CheckEmail(document.getElementById('txtEmailAddress').value))
		 {
			document.getElementById("divEmailAddressMsg").innerHTML='<span class="ErrorMessage">Invalid Email Address</span>';
			document.getElementById('txtEmailAddress').focus();
			return false;
	     }
		 CheckInviteEmailAddress(pIntCompanyId);
	}
		 /*
		else if(!CheckEmailAddress(document.getElementById('txtEmailAddress').value)) 
		{
			document.getElementById("divEmailAddressMsg").innerHTML='<span class="ErrorMessage">Email address already registered</span>';
   			document.getElementById("txtEmailAddress").focus();
			return false;
		}
			
		else
		{
					
			if(CheckStringLength(document.getElementById('txtEmailAddress').value))
			{
				document.getElementById('divEmailAddressMsg').innerHTML="";
			}
			
			else
			{
				document.getElementById('divEmailAddressMsg').innerHTML='<span class="ErrorMessage">String length too large. Only 255 characters allowed</span>';		
				document.getElementById('txtEmailAddress').focus();
				return false;	
			}
			
		}
		return true;		
	}
	/************************************************************************
	*
	*	Function Name:	PaggingUsers									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/		
	function PaggingUsers(pIntUserId,pIntStartIndex,pIndeEndIndex,pIntPageNo,pIntTotalPage,pStatus,pIntTotalRecord,pIntLimit,pIntDashBoard,pIntOrder)
	{
		xPos = document.documentElement.scrollTop;
		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(pIntDashBoard==0)
		{
			document.getElementById("DivMessages").innerHTML="<img src=ImageFiles/indicator_medium.gif>"; 
		}
		else
		{
			document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>"; 
		}
		
		
		var url = 'GUIService/ResponsesService.php?action=pageuser&pStart='+pIntStartIndex+'&pEnd='+pIndeEndIndex+'&uid='+pIntUserId+'&pPid='+pIntPageNo+'&pOrder='+pIntOrder+'&pStatus='+pIntDashBoard; 
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							onSuccess: function(transport) 
							{ 
								//window.scroll(0,xPos);
								if(pIntDashBoard==0)
								{	
									document.getElementById("DivMessages").innerHTML=transport.responseText;
								}
								else
								{
									document.getElementById("divDashBoard").innerHTML=transport.responseText;
								}
							
							} 
						}); 
	}
	/************************************************************************
	*
	*	Function Name:	PaggingEvents									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/		
	function PaggingEvents(pIntUserId,pIntStartIndex,pIndeEndIndex,pIntPageNo,pIntTotalPage,pStatus,pIntTotalRecord,pIntLimit,pIntDashBoard,pIntCompanyId)
	{
	
		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(pIntDashBoard==0)
		{
			document.getElementById("DivEvents").innerHTML="<img src=ImageFiles/indicator_medium.gif>"; 
		}
		else
		{
			document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>"; 
		}
		var url = 'GUIService/EventService.php?action=pageevent&pStart='+pIntStartIndex+'&pEnd='+pIndeEndIndex+'&uid='+pIntUserId+'&pPid='+pIntPageNo+'&pStatus='+pIntDashBoard+'&compid='+pIntCompanyId; 
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							onSuccess: function(transport) 
							{ 
								if(pIntDashBoard==0)
								{	
								//	document.getElementById("DivEvents").innerHTML=transport.responseText;
									var strResponse=transport.responseText;
								
									strResponse=strResponse.split("+");
									document.getElementById("DivEvents").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);
								}
								else
								{
									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:	getUserInfo									
	*	Author Name: 	Ramish Hashmi
	*																		
	*************************************************************************/		
	function getUserInfo(pIntUserId)
	{
		var parManagerId = document.getElementById("manager").value;
		var url = 'GUIService/UserInfoService.php?action=AllUserInfo';
		var strData
		var par = 'userId='+pIntUserId+'&manager='+parManagerId;
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							parameters:par,
							onSuccess: function(transport) 
							{      
								document.getElementById("divDashBoard").innerHTML=transport.responseText;
							} 
						});
		
	}
	/****************************************************************************************************
    * 	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";
			document.getElementById("password").focus();
			return;
		}
		else if(!CheckSpaces(document.getElementById("password").value))
		{
				document.getElementById("passwordError").innerHTML="Invalid Data Entry";
				document.getElementById("password").focus();
				return;
		}
		else if(document.getElementById("password").value.length<6)
		{
			document.getElementById("password").focus();
			document.getElementById("passwordError").innerHTML="Password should be more than 6 characters";
			document.getElementById("passwordError").style.visibility="visible";
			return false;
		}
		 
		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("rePassword").value.length<6)
		{
			document.getElementById("rePassword").focus();
			document.getElementById("rePasswordError").innerHTML="Password should be more than 6 characters";
			document.getElementById("rePasswordError").style.visibility="visible";
			return false;
		}
		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)
											{
												
												var strHtml="<table border=0 cellspacing=0 cellpadding=0 width=700>";
												strHtml+="<tr>";
												strHtml+="<td align=center height=30></td>";
												strHtml+="</tr>";
												strHtml+="<tr>";
												strHtml+="<td align=center height=30><span class=BodyHeadingTwo>Your password has been changed.</span></td>";
												strHtml+="</tr>";
												strHtml+="<tr>";
												strHtml+="<td align=center height=30></td>";
												strHtml+="</tr>";
												strHtml+="<tr>";
												strHtml+="<td align=center><a href='#' onclick='BackDashBoard()' /><img src='../../IncludeFiles/CSS/images/backtoboard-button.jpg'  onMouseOver= 'this.src =\'../../IncludeFiles/CSS/images/backtoboard-hover.jpg\''  onMouseOut= 'this.src =\'../../IncludeFiles/CSS/images/backtoboard-button.jpg\'' border=0/></a></td>";
												strHtml+="</tr>";
												strHtml+="</table>";
												document.getElementById("divDashBoard").innerHTML=strHtml;
											}
										} 
									});
			}//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];
									if(strResponse[1]=='' || strResponse[1]==null)
										GetStatesByCountryId(3);
									
									else
									GetStatesByCountryIdEdit(3,strResponse[1])
									
										
							} 
						}); 
	}
	/****************************************************************************************************
    * 	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="";
		document.getElementById("zipCodeError").innerHTML="";
		document.getElementById("phone2Error").innerHTML="";
		
		if(document.getElementById("firstName").value=='')
		{
			document.getElementById("firstNameError").innerHTML="Field Required";
			document.getElementById('firstName').focus();
			return;
		}
		else if(!CheckSpaces(document.getElementById("firstName").value))
		{
			document.getElementById("firstNameError").innerHTML="Invalid Data Entry";
			document.getElementById('firstName').focus();
			return;
		}
		else if(CheckStringLength(document.getElementById('firstName').value)==false)
		{
			document.getElementById('firstNameError').innerHTML="String length too large. Only 255 characters allowed.";
			document.getElementById('firstName').focus();
			return;
		}	
	    if(document.getElementById("middleName").value!='')
		{
			if(!CheckSpaces(document.getElementById("middleName").value))
			{
				document.getElementById("middleNameError").innerHTML="Invalid Data Entry";
				document.getElementById('middleName').focus();
				return;
			}
		}
		
		if(document.getElementById("lastName").value=='')
		{
			document.getElementById("lastNameError").innerHTML="Field Required";
			document.getElementById('lastName').focus();
			return;
		}
		
		else if(!CheckSpaces(document.getElementById("lastName").value))
		{
			document.getElementById("lastNameError").innerHTML="Invalid Data Entry";
			document.getElementById('lastName').focus();
			return;
		}
		else if(CheckStringLength(document.getElementById('lastName').value)==false)
		{
			document.getElementById('lastNameError').innerHTML="String length too large. Only 255 characters allowed.";
			document.getElementById('lastName').focus();
			return;
		}	   
		
		else if(document.getElementById("address1").value=='')
		{
			document.getElementById("address1Error").innerHTML="Field Required";
			document.getElementById('address1').focus();
			return;
		}
		
		else if(!CheckSpaces(document.getElementById("address1").value))
		{
			document.getElementById("address1Error").innerHTML="Invalid Data Entry";
			document.getElementById('address1').focus();
			return;
		}
		else if(CheckStringLength(document.getElementById('address1').value)==false)
		{
			document.getElementById('address1Error').innerHTML="String length too large. Only 255 characters allowed.";
			document.getElementById('address1').focus();
			return;
		}
		else if(document.getElementById("address2").value!='')
		{
			if(!CheckSpaces(document.getElementById('address2').value))
			{
				document.getElementById("address2Error").innerHTML="Invalid Data Entry";
				document.getElementById('address2').focus();
				return;
			}
			else if(CheckStringLength(document.getElementById('address2').value)==false)
			{
				document.getElementById('address2Error').innerHTML="String length too large. Only 255 characters allowed.";
				document.getElementById('address2').focus();
				return;
			}
		}
		
		if(document.getElementById('city').value=='')
		{	
			document.getElementById("cityError").innerHTML="Field Required";
			document.getElementById('city').focus();
			return;
		}
		
		else if(!CheckSpaces(document.getElementById('city').value))
		{
			document.getElementById("cityError").innerHTML="Invalid Data Entry";
			document.getElementById('city').focus();
			return;
		}
		else if(CheckStringLength(document.getElementById('city').value)==false)
		{
			document.getElementById('cityError').innerHTML="String length too large. Only 255 characters allowed.";
			document.getElementById('city').focus();
			return;
		}
		else if((document.getElementById('cmbCountry').value==3)&&(document.getElementById('cmbState').value==''))
		{
			document.getElementById("stateError").innerHTML="Field Required";
			document.getElementById('cmbState').focus();
			return;
		}	   
		
		else if(document.getElementById("zipCode").value=='')
		{
			document.getElementById("zipCodeError").innerHTML="Field Required";
			document.getElementById('zipCode').focus();
			return;
		}
		
		else if(document.getElementById("zipCode").value.length<5)
		{
			document.getElementById("zipCodeError").innerHTML="Invalid Zip Code";
			document.getElementById('zipCode').focus();
			return;
		}
		
		var strZip = document.getElementById('zipCode').value;
		
		if(!CheckNumbers(strZip))
		{
			document.getElementById("zipCodeError").innerHTML="Invalid data entry, please enter the correct code";
			document.getElementById('zipCode').focus();
			return;
		}
		
		
		else if(document.getElementById('phone1part1').value==''|| document.getElementById('phone1part2').value==''||document.getElementById('phone1part3').value=='')
		{		
			document.getElementById("phone1Error").innerHTML="Field Required";
			document.getElementById('phone1part1').focus();
			return false;	
		}
		else if(!CheckNumbers(document.getElementById('phone1part1').value)||!CheckNumbers(document.getElementById('phone1part2').value)||!CheckNumbers(document.getElementById('phone1part3').value))
		{
			document.getElementById("phone1Error").innerHTML="Invalid Data Entry";
			document.getElementById('phone1part1').focus();
			return false;
		}
		var pIntPhone1 = document.getElementById('phone1part1').value+document.getElementById('phone1part2').value+document.getElementById('phone1part3').value;
		if(pIntPhone1.length<10)
		{
			document.getElementById("phone1Error").innerHTML="Invalid Data Entry. 10 valid digits required";
			document.getElementById('phone1part1').focus();
			return false;
		}
		
		if(document.getElementById('phone2part1').value!='')//||document.getElementById('phone2part2').value!=''||document.getElementById('phone2part3').value!='')
		{
			if(!CheckNumbers(document.getElementById('phone2part1').value)||!CheckNumbers(document.getElementById('phone2part2').value)||!CheckNumbers(document.getElementById('phone2part3').value))
			{
				document.getElementById("phone2Error").innerHTML="Invalid Data Entry";
				document.getElementById('phone2part1').focus();
				return false;
			}
			var pIntPhone2 = document.getElementById('phone2part1').value+document.getElementById('phone2part2').value+document.getElementById('phone2part3').value;
			if(pIntPhone2.length<10)
			{
				document.getElementById("phone2Error").innerHTML="Invalid Data Entry. 10 valid digits required";
				document.getElementById('phone2part1').focus();
				return false;
			}
		}
		//else 
		// {
		
		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('phone1part1').value+document.getElementById('phone1part2').value+document.getElementById('phone1part3').value
		+'&phone2='+ document.getElementById('phone2part1').value+document.getElementById('phone2part2').value+document.getElementById('phone2part3').value;
		
		var myRequest= new Ajax.Request(
		url, 
		{   
		method: 'post',
		parameters:par,
		onSuccess: function(transport) 
		{   
		if(transport.responseText==1)
		{
		  backToDashboard();//window.location="index.php?q=programmanager";
		}
		
		} 
		});
		//}
	}
	/****************************************************************************************************
    * 	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;
		}
		
	    else if(document.getElementById("certifications").value!='')
		{
			if(!CheckSpaces(document.getElementById('certifications').value))
			{
				document.getElementById("certificationsError").innerHTML="Invalid Data Entry";
				return;
			}
		
		}
		
		
		
			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=programmanager";
						}
						//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)
						{
							backToDashboard();
						}
					} 
				});
			//} 
	 }
	 /****************************************************************************************************
    * 	Function Name	: 	addWorkRecordForm() 
	* 	Author			: 	Ramish Hashmi
	* 	Synopsis		: 	work record info form						              
	*************************************************************************************************/ 
	function addWorkRecordForm(pIntUserId)
	{
			
		var url = 'GUIService/ProgramManagerService.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;
							} 
						});
	}
	/****************************************************************************************************
    * 	Function Name	: 	addProfRecord() 
	* 	Author			: 	Ramish Hashmi
	* 	Synopsis		: 	add professional record to database						              
	*************************************************************************************************/ 
	function  addProfRecord(pIntUserId)
	{
		 document.getElementById('empNameError').innerHTML="";
		 document.getElementById('fromDateError').innerHTML="";
		 document.getElementById('toDateError').innerHTML="";
		 document.getElementById('titleError').innerHTML="";
		 document.getElementById('industryError').innerHTML="";
		 document.getElementById('industryExpError').innerHTML="";
		 document.getElementById('accomplishmentError').innerHTML="";
		
		
		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(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(!CheckSpaces(document.getElementById("title").value))
		 {
				document.getElementById("titleError").innerHTML="Invalid Data Entry";
				return;
		 }

		else if(document.getElementById("cmbIndustry").value=='')
		{
			document.getElementById("industryError").innerHTML="Field Required";
			return;
		}
		else if(document.getElementById("industryExp").value=='')
		{
			document.getElementById("industryExpError").innerHTML="Field Required";
			return;
		}
		
		else if(document.getElementById("acomplishments").value=='')
		{
			document.getElementById("accomplishmentError").innerHTML="Field Required";
			return;
		}
		else if(!CheckSpaces(document.getElementById("acomplishments").value))
		 {
				document.getElementById("accomplishmentError").innerHTML="Invalid Data Entry";
				return;
		 }

		else
		{
			var url = 'GUIService/ProgramManagerService.php?action=addProfInfo'; 
			 var par='userId='+pIntUserId
			 		 +'&empName='+document.getElementById("empName").value	
			 		 +'&fromDate='+document.getElementById("fromDate").value
			 		 +'&toDate='+document.getElementById("toDate").value
					 +'&title='+document.getElementById("title").value
					 +'&cmbIndustry='+document.getElementById("cmbIndustry").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=programmanager";
						}
					} 
				});
			} 
	}
	/****************************************************************************************************
    * 	Function Name	: 	viewWorkRecordForm() 
	* 	Author			: 	Ramish Hashmi
	* 	Synopsis		: 	view the professional record form				              
	*************************************************************************************************/
	function viewWorkRecordForm(pIntUserId)
	{
			var url = 'GUIService/ProgramManagerService.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/ProgramManagerService.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="";
		document.getElementById('accomplishmentError').innerHTML="";
		
		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(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(!CheckSpaces(document.getElementById("title").value))
		 {
			document.getElementById("titleError").innerHTML="Invalid Data Entry";
			return;
		 }
		else if(document.getElementById("industryExp").value=='')
		{
			document.getElementById("industryExpError").innerHTML="Field Required";
			return;
		}
		else if(document.getElementById("acomplishments").value=='')
		{
			document.getElementById("accomplishmentError").innerHTML="Field Required";
			return;
		}
		else if(!CheckSpaces(document.getElementById("acomplishments").value))
		 {
			document.getElementById("accomplishmentError").innerHTML="Invalid Data Entry";
			return;
		 }
		else
		{
			var url = 'GUIService/ProgramManagerService.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=programmanager";
						}
					} 
				});
			} 
		
	}
	/***************************************************************************
	 *  Function Name	: 	AdvanceSearchForm() 
	 * 	Author			: 	Ramish Hashmi
	 **************************************************************************/
	 function AdvanceSearchForm(pIntCompanyId,pIntUserId)
	 {
		 var url = 'GUIService/UserInfoService.php?action=advanceSearchForm&compId='+pIntCompanyId+'&userId='+pIntUserId; 
		 
		 var myRequest= new Ajax.Request(
				url, 
				{   
					method: 'post',
					onSuccess: function(transport) 
					{      
						document.getElementById("divDashBoard").innerHTML=transport.responseText;
						document.getElementById("CmbUserType").focus();
						
					} 
				});

	 }
	 
	/***************************************************************************
	 *  Function Name	: 	AdvancedSearchReset() 
	 * 	Author			: 	Adil Khan
	 **************************************************************************/

	function AdvancedSearchReset()
	{
		document.frm1.reset(); 
		document.getElementById("DivSearch").innerHTML='';
		
	}
	
	/***************************************************************************
	 *  Function Name	: 	AdvancedSearch() 
	 * 	Author			: 	Ramish Hashmi
	 **************************************************************************/
	 function AdvancedSearch(pIntCompanyId,pIntUserId)
	 {

		 document.getElementById("DivSearch").className="BodyText";
		 document.getElementById("DivSearch").innerHTML='';
		 document.getElementById("userTypeError").innerHTML='';
		 document.getElementById("firstNameError").innerHTML='';
		 document.getElementById("lastNameError").innerHTML='';
		 document.getElementById("emailError").innerHTML='';
		 document.getElementById("cityError").innerHTML='';
		 document.getElementById("zipCodeError").innerHTML='';
		 document.getElementById("uniError").innerHTML='';
		 document.getElementById("majorError").innerHTML='';
		 document.getElementById("degreeError").innerHTML='';
		 document.getElementById("titleError").innerHTML='';
		 document.getElementById("managerError").innerHTML='';
		 document.getElementById("orgError").innerHTML='';
		 document.getElementById("deptError").innerHTML='';
		 document.getElementById("keywordError").innerHTML='';
		 
		 var strCriteria="";
		 
		 /* // client requested this condition to be taken away
		 	else if((document.getElementById("appDate").value=='')&&(document.getElementById("firstName").value=='')
			&&(document.getElementById("lastName").value=='')&&(document.getElementById("email").value=='')&&(document.getElementById("city").value=='')
			&&(document.getElementById("cmbState").value=='')&&(document.getElementById("zipCode").value=='')&&(document.getElementById("major").value=='')
			&&(document.getElementById("university").value=='')&&(document.getElementById("degree").value=='')&&(document.getElementById("title").value=='')
			&&(document.getElementById("organization").value=='')&&(document.getElementById("cmbCareerLevel").value=='')&&(document.getElementById("cmbIndustry").value=='')
			&&(document.getElementById("industryExp").value=='') &&(document.getElementById("department").value=='') &&(document.getElementById("resNeeded").value=='')
			&&(document.getElementById("cmbWorkSeeked").value=='')
			&&(document.getElementById("availableDate").value=='')&&(document.getElementById("availibilty").value=='')&&(document.getElementById("manager").value=='')
			&&(document.getElementById("cmbTransferReason").value=='')&&(document.getElementById("cmbReasonTransition").value=='')&&(document.getElementById("projectedDate").value=='')&&(document.getElementById("projectedDateFrom").value=='')
			&&(document.getElementById("keyword").value=='')&&(document.getElementById("appDateTo").value=='') &&(document.getElementById("appDateFrom").value==''))		
		   {
			  alert("Please Enter Search Criteria");
			  
			  var Pos = document.documentElement.scrollTop;
			  document.getElementById("DivSearch").className="ErrorMessage";
			  document.getElementById("DivSearch").innerHTML='Please Enter Search Criteria';
			  
			  return;
		   }	
		 */
		 
		 if(document.getElementById("CmbUserType").value=='')
		 {
			  alert("Please Select User Type");
			  
			  document.getElementById("userTypeError").innerHTML='Please Select User Type';
			  document.getElementById("DivSearch").className="ErrorMessage";
			  document.getElementById("DivSearch").innerHTML='Please Select User Type';
			  
			  document.getElementById("CmbUserType").focus();
		 }		 	 
		 else if( (document.getElementById("projectedDate").value!='' && document.getElementById("projectedDateFrom").value=='') || (document.getElementById("projectedDate").value=='' && document.getElementById("projectedDateFrom").value!='') )
		 {
			alert("Please Enter Proper Transition Search Criteria In The To And From Fields");  	  
			return;
		 }
		  else 
		  { 
			
			if( (document.getElementById("projectedDate").value!='' && document.getElementById("projectedDateFrom").value=='') || (document.getElementById("projectedDate").value=='' && document.getElementById("projectedDateFrom").value!='') )
			{
				alert("Please Enter Proper Transition Search Criteria In The To And From Fields");  	  
				document.getElementById("projectedDateError").innerHTML="Both Fields Need To Be Filled";
				document.getElementById("projectedDateFromError").innerHTML="Both Fields Need To Be Filled";
				document.getElementById("projectedDate").focus();
				return;
		 	}
			else if( document.getElementById("projectedDate").value > document.getElementById("projectedDateFrom").value )
			{
				alert("The 'To' Field In The Transition Information Should Not Be Greater Than The 'From' Field.");  	  
				document.getElementById("projectedDateError").innerHTML="This Field Can't Be Greater Than The 'From' Field";
				document.getElementById("projectedDateFromError").innerHTML="This Field Needs To Be Greater Than The 'To' Field";
				document.getElementById("projectedDate").focus();
				return;
			}
			else{
				document.getElementById("projectedDateError").innerHTML="";
				document.getElementById("projectedDateFromError").innerHTML="";
			}
			
			if(document.getElementById("firstName").value!='')  
			  {
				 if(!CheckSpaces(document.getElementById("firstName").value))
				 {
					document.getElementById("firstNameError").innerHTML="Invalid Data Entry";
					document.getElementById("firstName").focus();
					return;
				 }
				else if(CheckStringLength(document.getElementById('firstName').value)==false)
		  		 {
			 		document.getElementById('firstNameError').innerHTML="String length too large. Only 255 characters allowed.";
		     		document.getElementById("firstName").focus();
					return;
		  		 }
			  }
			  
			   if(document.getElementById("lastName").value!='')  
			  {
				 if(!CheckSpaces(document.getElementById("lastName").value))
				{
					document.getElementById("lastNameError").innerHTML="Invalid Data Entry";
					document.getElementById("lastName").focus();
					return;
				}
				if(CheckStringLength(document.getElementById('lastName').value)==false)
		  		{
			 		document.getElementById('lastNameError').innerHTML="String length too large. Only 255 characters allowed.";
					document.getElementById("lastName").focus();
					return;
		  		}
			  }
			  
			  if(document.getElementById("email").value!='')  
			  {
				if(!CheckSpaces(document.getElementById('email').value))
				 {
					document.getElementById("emailError").innerHTML="Invalid Data Entry";
					document.getElementById("email").focus();
					return;
				 }
		   
	 			else if(!CheckStringLength(document.getElementById('email').value))
				{
					document.getElementById('emailError').innerHTML="String length too large. Only 255 characters allowed";
					document.getElementById("email").focus();
					return;
				}
			   
			   else if(!CheckEmail(document.getElementById('email').value))
			    {
				 	document.getElementById("emailError").innerHTML="Invalid Email Address";
					document.getElementById("email").focus();
					return;
			    }
			  }
			  
			   if(document.getElementById("city").value!='')  
			  {
				 if(!CheckSpaces(document.getElementById("city").value))
				{
					document.getElementById("cityError").innerHTML="Invalid Data Entry";
					document.getElementById("city").focus();
					return;
				}
				if(CheckStringLength(document.getElementById('city').value)==false)
		  		{
			 		document.getElementById('cityError').innerHTML="String length too large. Only 255 characters allowed.";
		     		document.getElementById("city").focus();
					return;
		  		}
			  }
			  
			  if(document.getElementById("zipCode").value!='')  
			  {
				 if(!CheckSpaces(document.getElementById("zipCode").value))
				{
					document.getElementById("zipCodeError").innerHTML="Invalid Data Entry";
					document.getElementById("zipCode").focus();
					return;
				}
				if(CheckStringLength(document.getElementById('zipCode').value)==false)
		  		{
			 		document.getElementById('zipCodeError').innerHTML="String length too large. Only 255 characters allowed.";
					document.getElementById("zipCode").focus();
					return;
		  		}
			  }
			   if(document.getElementById("university").value!='')  
			  {
				 if(!CheckSpaces(document.getElementById("university").value))
				{
					document.getElementById("uniError").innerHTML="Invalid Data Entry";
					document.getElementById("university").focus();
					return;
				}
				if(CheckStringLength(document.getElementById('university').value)==false)
		  		{
			 		document.getElementById('uniError').innerHTML="String length too large. Only 255 characters allowed.";
		     		document.getElementById("university").focus();
					return;
		  		}
			  }
			   if(document.getElementById("major").value!='')  
			  {
				 if(!CheckSpaces(document.getElementById("major").value))
				{
					document.getElementById("majorError").innerHTML="Invalid Data Entry";
					document.getElementById("major").focus();
					return;
				}
				if(CheckStringLength(document.getElementById('major').value)==false)
		  		{
			 		document.getElementById('majorError').innerHTML="String length too large. Only 255 characters allowed.";
		     		document.getElementById("major").focus();
					return;
		  		}
			  }
			 
			  if(document.getElementById("degree").value!='')  
			  {
				 if(!CheckSpaces(document.getElementById("degree").value))
				{
					document.getElementById("degreeError").innerHTML="Invalid Data Entry";
					document.getElementById("degree").focus();
					return;
				}
				if(CheckStringLength(document.getElementById('degree').value)==false)
		  		{
			 		document.getElementById('degreeError').innerHTML="String length too large. Only 255 characters allowed.";
		     		document.getElementById("degree").focus();
					return;
		  		}
			  }
			     if(document.getElementById("title").value!='')  
			  {
				 if(!CheckSpaces(document.getElementById("title").value))
				{
					document.getElementById("titleError").innerHTML="Invalid Data Entry";
					document.getElementById("title").focus();
					return;
				}
				if(CheckStringLength(document.getElementById('title').value)==false)
		  		{
			 		document.getElementById('titleError').innerHTML="String length too large. Only 255 characters allowed.";
		     		document.getElementById("title").focus();
					return;
		  		}
			  }
			 
			 if(document.getElementById("manager").value!='')  
			  {
				if(!CheckSpaces(document.getElementById('manager').value))
				 {
					document.getElementById("managerError").innerHTML="Invalid Data Entry";
					document.getElementById("manager").focus();
					return;
				 }
		   
	 			else if(!CheckStringLength(document.getElementById('manager').value))
				{
					document.getElementById('managerError').innerHTML="String length too large. Only 255 characters allowed";
					document.getElementById("manager").focus();
					return;
				}
			  }
			  
			  if(document.getElementById("organization").value!='')  
			  {
				 if(!CheckSpaces(document.getElementById("organization").value))
				{
					document.getElementById("orgError").innerHTML="Invalid Data Entry";
					document.getElementById("organization").focus();
					return;
				}
				if(CheckStringLength(document.getElementById('organization').value)==false)
		  		{
			 		document.getElementById('orgError').innerHTML="String length too large. Only 255 characters allowed.";
		     		document.getElementById("organization").focus();
					return;
		  		}
			  }
			  
			  if(document.getElementById("department").value!='')  
			  {
				 if(!CheckSpaces(document.getElementById("department").value))
				{
					document.getElementById("deptError").innerHTML="Invalid Data Entry";
					document.getElementById("department").focus();
					return;
				}
				if(CheckStringLength(document.getElementById('department').value)==false)
		  		{
			 		document.getElementById('deptError').innerHTML="String length too large. Only 255 characters allowed.";
		     		document.getElementById("department").focus();
					return;
		  		}
			  }
			  
			   if(document.getElementById("keyword").value!='')  
			   {
				 if(!CheckSpaces(document.getElementById("keyword").value))
				{
					document.getElementById("keywordError").innerHTML="Invalid Data Entry";
					document.getElementById("keyword").focus();
					return;
				}
				if(CheckStringLength(document.getElementById('keyword').value)==false)
		  		{
			 		document.getElementById('keywordError').innerHTML="String length too large. Only 255 characters allowed.";
		     		document.getElementById("keyword").focus();
					return;
		  		}
			  }
			  
		
			 var url = 'GUIService/UserInfoService.php?action=advanceSearch'; 
			 strCriteria+='For ';
			 if(document.getElementById("CmbUserType").value!='')
			 { 						
			   if(document.getElementById("CmbUserType").value==1)
			     strCriteria+='Off-Rampers ';				 
				else if(document.getElementById("CmbUserType").value==4)
			     strCriteria+='On-Rampers';				 
				else if(document.getElementById("CmbUserType").value==6)
			     strCriteria+='Transitions ';				 
				 else if(document.getElementById("CmbUserType").value==7)
			     strCriteria+='Transfers ';				 
				 else if(document.getElementById("CmbUserType").value==8)
			     strCriteria+='All ';
			 }
			 
			 if(document.getElementById("appDate").value!='')
			 	 strCriteria+=', Application Date';

			if(document.getElementById("firstName").value!='')
			   strCriteria+=', '+document.getElementById("firstName").value;	 
			
			if(document.getElementById("lastName").value!='')
			   strCriteria+=', '+document.getElementById("lastName").value;
			
			if(document.getElementById("email").value!='')
			   strCriteria+=', '+document.getElementById("email").value+', ';
			
			if(document.getElementById("city").value!='')
			   strCriteria+=', '+document.getElementById("city").value;
			
			if(document.getElementById("cmbState").value!='')
			   strCriteria+=', State ';

			if(document.getElementById("zipCode").value!='')
			   strCriteria+=', Zip Code';
		
		    if(document.getElementById("major").value!='')
			   strCriteria+=', '+document.getElementById("major").value;
			   
			if(document.getElementById("university").value!='')
			   strCriteria+=', '+document.getElementById("university").value;  
			   
		/*	if(document.getElementById("university").value!='')
			   strCriteria+=', '+document.getElementById("university").value; */
			   
			if(document.getElementById("degree").value!='')
			   strCriteria+=', '+document.getElementById("degree").value;
			 
			if(document.getElementById("title").value!='')
			   strCriteria+=', '+document.getElementById("title").value;
			
			if(document.getElementById("organization").value!='')
			   strCriteria+=', '+document.getElementById("organization").value;
			
			if(document.getElementById("cmbCareerLevel").value!='')
			{
			   if(document.getElementById("cmbCareerLevel").value=='Senior ExecutiveClevel President etc.')
			   			   strCriteria+=', Senior Executive(C-level, President, etc.)';
						   
			   else if(document.getElementById("cmbCareerLevel").value=='ExperiencedNonManager')
			   			   strCriteria+=', Experienced(Non-Manager)';
						   
			   else if(document.getElementById("cmbCareerLevel").value=='ExecutiveVP SVP etc.')
			   			   strCriteria+=', Executive(VP SVP etc.)';		   
			  else
			      strCriteria+=', '+document.getElementById("cmbCareerLevel").value;
			}
			if(document.getElementById("cmbIndustry").value!='')
			   strCriteria+=', Industry';
   
  			if(document.getElementById("industryExp").value!='')
 				 strCriteria+=', '+document.getElementById("industryExp").value;
			
			if(document.getElementById("department").value!='')
 				 strCriteria+=', Department ';
			
			if(document.getElementById("cmbWorkSeeked").value!='')
 				 strCriteria+=', '+document.getElementById("cmbWorkSeeked").value;
				 
			if(document.getElementById("availableDate").value!='')
 				 strCriteria+=', '+document.getElementById("availableDate").value;
			
			if(document.getElementById("availibilty").value!='')
 				 strCriteria+=', '+document.getElementById("availibilty").value;
			
			if(document.getElementById("manager").value!='')
 				 strCriteria+=', '+document.getElementById("manager").value;
			
			if(document.getElementById("cmbTransferReason").value!='')
 				 strCriteria+=', '+document.getElementById("cmbTransferReason").value;
				 
			if(document.getElementById("cmbReasonTransition").value!='')
 				 strCriteria+=', '+document.getElementById("cmbReasonTransition").value;
				 
			if(document.getElementById("projectedDate").value!='')
 				 strCriteria+= document.getElementById("projectedDateFrom").value + ' - '+document.getElementById("projectedDate").value;
				 
			if(document.getElementById("keyword").value!='')
 				 strCriteria+=', '+document.getElementById("keyword").value;
				 
			var pIntIndustry='';
				
			if(document.getElementById("cmbIndustry").value==-1)
				pIntIndustry='';
			else
				pIntIndustry=document.getElementById("cmbIndustry").value;
				
		  	 var par='userType='+document.getElementById("CmbUserType").value
			 		 +'&appDate='+document.getElementById("appDate").value
			 		 +'&firstName='+document.getElementById("firstName").value	
			 		 +'&lastName='+document.getElementById("lastName").value
			 		 +'&email='+document.getElementById("email").value
					 +'&city='+document.getElementById("city").value
					 +'&cmbState='+document.getElementById("cmbState").value
					 +'&university='+document.getElementById("university").value
					 +'&organization='+document.getElementById("organization").value
					 +'&zipCode='+document.getElementById("zipCode").value
					 +'&major='+document.getElementById("major").value
					 +'&title='+document.getElementById("title").value
					 +'&degree='+document.getElementById("degree").value
					 +'&industry='+pIntIndustry
					 +'&industryExp='+document.getElementById("industryExp").value
					 +'&availableDate='+document.getElementById("availableDate").value
					 +'&availability='+document.getElementById("availibilty").value
					 +'&keyword='+document.getElementById("keyword").value
					 +'&careerLevel='+document.getElementById("cmbCareerLevel").value
					 +'&workSeeked='+document.getElementById("cmbWorkSeeked").value
					 +'&department='+document.getElementById("department").value
					 +'&manager='+document.getElementById("manager").value
					 +'&transferReason='+document.getElementById("cmbTransferReason").value
					 +'&transitionReason='+document.getElementById("cmbReasonTransition").value
					 +'&projectedDate='+document.getElementById("projectedDate").value
					 +'&projectedDateFrom='+document.getElementById("projectedDateFrom").value
					 +'&resNeeded='+document.getElementById("resNeeded").value
					 +'&appDateTo='+document.getElementById("appDateTo").value
					 +'&appDateFrom='+document.getElementById("appDateFrom").value
					 +'&compId='+pIntCompanyId
					 +'&criteria='+strCriteria
					 +'&userId='+pIntUserId;
					 
			 document.getElementById("DivSearch").innerHTML="<img src=ImageFiles/indicator_medium.gif>";		 
			 var myRequest= new Ajax.Request(
				url, 
				{   
					method: 'post',
					parameters:par,
					onSuccess: function(transport) 
					{
						document.getElementById("DivSearch").innerHTML=transport.responseText;
						document.getElementById("searchResult").focus();
					 } 
				});
		  }
		 
	 }
	 /***************************************************************************
	 *  Function Name	: 	ViewReportsForms() 
	 * 	Author			: 	Ramish Hashmi
	 **************************************************************************/
	 function  ViewReportsForms(pIntUserId)
	 {
		var url = 'GUIService/ReportsService.php?action=ReportsForm&uid='+pIntUserId; 
		
		document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>";		 
		var myRequest= new Ajax.Request(
				url, 
				{   
					method: 'post',
					onSuccess: function(transport) 
					{      
						document.getElementById("divDashBoard").innerHTML=transport.responseText;
						document.getElementById("txtReportForm").focus();
						
					} 
				});
		
	  }
	 /***************************************************************************
	 *  Function Name	: 	GetResults() 
	 * 	Author			: 	Ramish Hashmi
	 **************************************************************************/
	 function GetResults(pIntUserId,pIntStatus)
	 { 
		document.getElementById("DivReportResults").innerHTML="";
		document.getElementById("divJobtitleError").innerHTML="";
		
		if(document.getElementById("jobTitle").value=='')
		  {
			document.getElementById("divJobtitleError").innerHTML="Field Required";  
		    document.getElementById("jobTitle").focus();
			return; 
		  }
		
		else if(document.getElementById("jobTitle").value=='')
		  {
			document.getElementById("divJobtitleError").innerHTML="Field Required";  
		    document.getElementById("jobTitle").focus();
			return;
		  } 
		
		else if(CheckStringLength(document.getElementById('jobTitle').value)==false)
		  {
			 document.getElementById('divJobtitleError').innerHTML="String length too large. Only 255 characters allowed.";
		     document.getElementById("jobTitle").focus();
			 return;
		  }
		 else
		 {					   
			var par='jobTitle='+document.getElementById("jobTitle").value
					 +'&criteria='+document.getElementById("criteriaRpt").value
					 +'&userId='+pIntUserId
					 +'&status='+pIntStatus;
			
			if(document.getElementById("criteriaRpt").value==2)
			{
				par=par+'&fromDate='+document.getElementById("frmDate").value
						+'&toDate='+document.getElementById("toDate").value;	
			}
			var url = 'GUIService/ReportsService.php?action=ReportResults'; 
			document.getElementById("DivReportResults").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
		 	var myRequest= new Ajax.Request(
				url, 
				{   
					method: 'post',
					parameters:par,
					onSuccess: function(transport) 
					{      
						document.getElementById("DivReportResults").innerHTML=transport.responseText;
						
					} 
				});
		
		 }
	 } 
	 /***************************************************************************
	 *  Function Name	: 	GetApplicantsDetails() 
	 * 	Author			: 	Ramish Hashmi
	 **************************************************************************/
	 function GetApplicantsDetails(pIntJobId,pIntUserId)
	 {
		var par='JobId='+pIntJobId+'&userId='+pIntUserId;			
		var url = 'GUIService/ReportsService.php?action=ApplicantsDetails'; 
		 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	: 	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:	SetInterviewPhoneSetting									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/		
	function SetInterviewPhoneSetting(pIntUserId)
	{
		if(document.getElementById("chkPhone").checked==true)
		{
			var url = 'GUIService/UserInfoService.php?action=getperinfo&uid='+pIntUserId; 
			var myRequest= new Ajax.Request(
				url, 
				{   
					method: 'post',
					onSuccess: function(transport) 
					{
						var strHtml=''
						strHtml+='<table border=0 cellspacing=0 cellpading=0>';
						strHtml+='<tr>';
						strHtml+='<td width=150 valign="top"><span class="BodyText"><b>Candidate\'s Phone: </b></span>';
						strHtml+='</td>';
						strHtml+='<td><span class="BodyText">'+transport.responseText+'</span>';
						strHtml+='</td>';
						strHtml+='</tr>';
						strHtml+='</table>';
						document.getElementById("divUserPhone").innerHTML=strHtml;
						frmInverInterview.rdoOnSide[0].disabled=true;
						frmInverInterview.rdoOnSide[1].disabled=true;
						intOnOfStatus=-1;
					} 
				});
		}
		else
		{
			document.getElementById("divUserPhone").innerHTML="";
			frmInverInterview.rdoOnSide[0].disabled=false;	
			frmInverInterview.rdoOnSide[1].disabled=false;	
		}
		
	}
	/************************************************************************
	*
	*	Function Name:	GetCompanyAddress									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function GetCompanyAddress(pIntCompanyId)
	{
		var url = 'GUIService/ProgramManagerService.php?action=getcompany&compid='+pIntCompanyId;
		document.getElementById("divOnSide").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
		var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{     
				document.getElementById("divOnSide").innerHTML=transport.responseText;
				intOnOfStatus=0;
			} 
		});
	}
	/************************************************************************
	*
	*	Function Name:	GetCompanyHtml									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function GetCompanyHtml()
	{
		var url = 'GUIService/ProgramManagerService.php?action=getcompanyhtml';
		document.getElementById("divOnSide").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
		var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{     
				document.getElementById("divOnSide").innerHTML=transport.responseText;
				GetStatesByCountryId(document.getElementById("cmbCountry").value);
				intOnOfStatus=1;
			} 
		});
	}
	/************************************************************************
	*
	*	Function Name:	GetJobDetail									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/		
	function GetJobDetail(pIntUserId,pIntJobId)
	{
		
		var url = 'GUIService/ProgramManagerService.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:	ScheduleDetail									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function ScheduleDetail(pIntScheduleId,pIntUserId)
	{ 
    
		var url = 'GUIService/ResponsesService.php?action=schdetail&sceid='+pIntScheduleId+'&userId='+pIntUserId;
		var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{     
				document.getElementById("divDashBoard").innerHTML=transport.responseText;
			} 
		});
	}
	
	/************************************************************************
	*
	*	Function Name:	getMouseXY									
	*																		
	*************************************************************************/		
	 
	document.onmousemove = getMouseXY;
	  function getMouseXY(e) 
	  {
		  var IE = document.all?true:false

		// If NS -- that is, !IE -- then set up for mouse capture
		if (!IE) document.captureEvents(Event.MOUSEMOVE)
		  
		  if (IE) { // grab the x-y pos.s if browser is IE
    		tempX = event.clientX + document.body.scrollLeft
		    tempY = event.clientY + document.body.scrollTop
		  } else {  // grab the x-y pos.s if browser is NS
		    tempX = e.pageX
		    tempY = e.pageY
		  }  
		  // catch possible negative values in NS4
		  if (tempX < 0){tempX = 0}
		  if (tempY < 0){tempY = 0}  
		  // show the position values in the form named Show
		  // in the text fields named MouseX and MouseY
		 return true;
	}

	/************************************************************************
	*
	*	Function Name:	PagingUserResponses									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/		
	function PagingUserResponses(pIntUserId,pIntStartIndex,pIndeEndIndex,pIntPageNo,pIntTotalPage,pStatus,pIntTotalRecord,pIntLimit,pIntDashBoard,pIntCompanyId,pIntOrder)
	{
		// xPos = document.documentElement.scrollTop;
		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(document.getElementById("DivResponses"))
		   document.getElementById("DivResponses").innerHTML="<img src=ImageFiles/indicator_medium.gif>"; 
		
		else
		  document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>"; 
				
		
		var url = 'GUIService/ResponsesService.php?action=pageuserresponse&pStart='+pIntStartIndex+'&pEnd='+pIndeEndIndex+'&pPid='+pIntPageNo+'&pStatus='+pIntDashBoard+'&uid='+pIntUserId+'&compid='+pIntCompanyId+'&pOrder='+pIntOrder;
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							onSuccess: function(transport) 
							{ 
								// window.scroll(0,xPos);
	
								if(document.getElementById("DivResponses"))
									document.getElementById("DivResponses").innerHTML=transport.responseText;

								else
									document.getElementById("divDashBoard").innerHTML=transport.responseText;
								
								
							} 
						});
		
	}
	/*************************************************************************************
	*	Function Name:	UpdateUserStatus									
	*	Author Name  : 	Ramish Hashmi
	*	Synposis     :	Activates/Deactivate the user login																
	*****************************************************************************************/		
	/*function UpdateUserStatus(pIntUserId,pIntStatus)
	{
		
		var url = 'GUIService/ProgramManagerService.php?action=updateUserStatus'; 
		if(pIntStatus==1)
		    pIntStatus =0;
		
		else
			pIntStatus=1;
			
			
		var par='userId='+pIntUserId
			 		 +'&statusId='+pIntStatus;
		
		if(confirm("Are you sure you want to update the status"))
		{ 
		   if(confirm("Do you want to approve login request?"))
			 {
				pIntStatus=1;
			 }
		  else
			{
				pIntStatus=-1;	
			}
				var par='userId='+pIntUserId
			 		 +'&statusId='+pIntStatus;
		
				var myRequest= new Ajax.Request(
					url, 
					{   
					method: 'post',
					parameters:par,
					onSuccess: function(transport) 
					{
						if(transport.responseText==1)
						{
							window.location="index.php?q=programmanager";
						}
					} 
				});
			//}
		   }
	  }*/
	/************************************************************************
	*
	*	Function Name:	SearchCandidate									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/		
	function SearchCandidate(pIntUserId)
	{

		if(document.getElementById("txtCandidateSearch").value!="")
		{
			var url = 'GUIService/UserInfoService.php?action=candsearch'; 
			par='keyword='+document.getElementById("txtCandidateSearch").value
				 +'&userId='+pIntUserId;
			document.getElementById("DivCandidates").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
			
			var myRequest= new Ajax.Request(
					url, 
					{   
						method: 'post',
						parameters:par,
						onSuccess: function(transport) 
						{
							document.getElementById("DivCandidates").innerHTML=transport.responseText;
						} 
					});
		}
		else
		{
			alert("Please enter keyword for search");
			document.getElementById("txtCandidateSearch").focus();		
			return false;
		}
	}
	/************************************************************************
	*
	*	Function Name:	SearchAllCandidate									
	*	Author Name: 	Adil Khan
	*																		
	*************************************************************************/		
	function SearchAllCandidate(pIntUserId)
	{
		xPos = document.documentElement.scrollTop;
		if(document.getElementById("txtCandidateSearch").value!="")
		{
			var url = 'GUIService/UserInfoService.php?action=getAllCandidates'; 
			par='keyword='+document.getElementById("txtCandidateSearch").value
				 +'&userId='+pIntUserId;
			document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
			
			var myRequest= new Ajax.Request(
					url, 
					{   
						method: 'post',
						parameters:par,
						onSuccess: function(transport) 
						{	window.scroll(0,xPos);
							document.getElementById("divDashBoard").innerHTML=transport.responseText;
						} 
					});
		}
		else
		{
			alert("Please enter keyword for search");
			document.getElementById("txtCandidateSearch").focus();		
			return false;
		}
	}

	/************************************************************************
	*
	*	Function Name:	PagingCandidates									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/		
	function PagingCandidates(pIntStartIndex,pIndeEndIndex,pIntPageNo,pIntTotalPage,pStatus,pIntUserId,pIntSortStatus)
	{
		// xPos = document.documentElement.scrollTop;
		if(pStatus==2)
		{
				pIntPageNo=pIntPageNo-1;
				pIntStartIndex=pIntStartIndex-5;
				pIndeEndIndex=5;
				
		}
		else
		{
			if(pIntPageNo==pIntTotalPage)
			{
				pIntStartIndex=pIntStartIndex+5;
			
				pIndeEndIndex=1;
			}
			else
			{
				pIntPageNo=pIntPageNo+1;
				pIntStartIndex=pIntStartIndex+5;
				pIndeEndIndex=5;
			}	
		}
	
		var url = 'GUIService/UserInfoService.php?action=pagingcand&pStart='+pIntStartIndex+'&pEnd='+pIndeEndIndex+'&pPid='+pIntPageNo+'&uid='+pIntUserId+'&sort='+pIntSortStatus; 
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							onSuccess: function(transport) 
							{ 
								// window.scroll(0,xPos);
								document.getElementById("DivCandidates").innerHTML=transport.responseText;
							} 
						}); 
	}
	/************************************************************************
	*
	*	Function Name:	PagingCandidatesSrch									
	*	Author Name: 	Adil Khan
	*																		
	*************************************************************************/		
	function PagingCandidatesSrch(pIntStartIndex,pIndeEndIndex,pIntPageNo,pIntTotalPage,pStatus,pIntUserId,pIntSortStatus)
	{
		// xPos = document.documentElement.scrollTop;
		if(pStatus==2)
		{
				pIntPageNo=pIntPageNo-1;
				pIntStartIndex=pIntStartIndex-5;
				pIndeEndIndex=5;
				
		}
		else
		{
			if(pIntPageNo==pIntTotalPage)
			{
				pIntStartIndex=pIntStartIndex+5;
			
				pIndeEndIndex=1;
			}
			else
			{
				pIntPageNo=pIntPageNo+1;
				pIntStartIndex=pIntStartIndex+5;
				pIndeEndIndex=5;
			}	
		}
		pStrSearch = document.getElementById("txtCandidateSearch").value;
	
		var url = 'GUIService/UserInfoService.php?action=candsearchnav&pStart='+pIntStartIndex+'&pEnd='+pIndeEndIndex+'&pPid='+pIntPageNo+'&uid='+pIntUserId+'&sort='+pIntSortStatus; 
		par = "keyword="+pStrSearch+"&userId="+pIntUserId;

		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							parameters:par,
							onSuccess: function(transport) 
							{ 
								// window.scroll(0,xPos);
								document.getElementById("DivCandidates").innerHTML=transport.responseText;
							} 
						}); 
	}

	 /***************************************************************************
    * 	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:	GetAllPostedJobs									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/		
	function GetAllPostedJobs(pIntUserId,pIntCompanyId,pIntOrderStatus)
	{
		var url = 'GUIService/JobsService.php?action=getAllJobs&compid='+pIntCompanyId+'&order='+pIntOrderStatus;
		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:	GetPostedJobs									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/		
	function GetPostedJobs(pIntUserId,pIntCompanyId)
	{
		var url = 'GUIService/JobsService.php?action=postdelpostjob&compid='+pIntCompanyId;
		var par = 'userId='+pIntUserId;
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							parameters:par,
							onSuccess: function(transport) 
							{      
								document.getElementById("DivPostedJobs").innerHTML=transport.responseText;
							} 
						});	
	}
	/************************************************************************
	*
	*	Function Name:	GetAllCorpClients									
	*	Author Name: 	Adil Khan
	*																		
	*************************************************************************/		
	function GetAllCorpClients(pIntUserId,pIntCompanyId,pIntOrderStatus)
	{
		var url = 'GUIService/ProgramManagerService.php?action=getAllCorpClients&compid='+pIntCompanyId+'&order='+pIntOrderStatus;
		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:	GetCorpClients									
	*	Author Name: 	Adil Khan
	*																		
	*************************************************************************/		
	function GetCorpClients(pIntUserId,pIntCompanyId)
	{
		var url = 'GUIService/ProgramManagerService.php?action=postdelcorpclient&userId='+pIntUserId+'&compid='+pIntCompanyId;
		
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',							
							onSuccess: function(transport) 
							{      
								document.getElementById("DivCorporateClients").innerHTML=transport.responseText;
							} 
						});	
	}

	/************************************************************************
	*
	*	Function Name:	GetAllCandidates									
	*	Author Name: 	Adil Khan
	*																		
	*************************************************************************/		
	function GetAllCandidates(pIntUserId,pStrKeyword)
	{
		var url = 'GUIService/UserInfoService.php?action=getAllCandidates';
		var par = 'userId='+pIntUserId+'&keyword='+pStrKeyword;
		
//		document.getElementById("DivCandidates").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:	PaggingCorpClients								
	*	Author Name: 	Adil Khan
	*																		
	*************************************************************************/		
	function PaggingCorpClients(pIntUserId,pIntStartIndex,pIndeEndIndex,pIntPageNo,pIntTotalPage,pStatus,pIntTotalRecord,pIntLimit,pIntDashBoard,pIntCompanyId,pIntOrder)
	{
		xPos = document.documentElement.scrollTop;
		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(pIntDashBoard==0)
		{
			document.getElementById("DivCorporateClients").innerHTML="<img src=ImageFiles/indicator_medium.gif>"; 
		}
		else
		{
			document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>"; 
		}
		var url = 'GUIService/ProgramManagerService.php?action=pagecorpclient&pStart='+pIntStartIndex+'&pEnd='+pIndeEndIndex+'&uid='+pIntUserId+'&pPid='+pIntPageNo+'&pStatus='+pIntDashBoard+'&compid='+pIntCompanyId+'&order='+pIntOrder; 
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							onSuccess: function(transport) 
							{ 
								window.scroll(0,xPos);
								if(pIntDashBoard==0)
								{	
									document.getElementById("DivCorporateClients").innerHTML=transport.responseText;
								}
								else
								{
									document.getElementById("divDashBoard").innerHTML=transport.responseText;
								}
							}
							
						}); 
	}

	/************************************************************************
	*
	*	Function Name:	GetAllResponses									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/		
	function GetAllResponses(pIntUserId,pIntCompanyId)
	{
		xPos = document.documentElement.scrollTop;
		var url = 'GUIService/ResponsesService.php?action=allresponses'+'&compid='+pIntCompanyId;
		var par = 'userId='+pIntUserId;
		
		document.getElementById("DivResponses").innerHTML="<img src=ImageFiles/indicator_medium.gif>"; 
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							parameters:par,
							onSuccess: function(transport) 
							{   window.scroll(0,xPos);   
								document.getElementById("divDashBoard").innerHTML=transport.responseText;								
							} 
						});	
	}
		/************************************************************************
	*
	*	Function Name:	GetAllResponses									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/		
	function GetResponses(pIntUserId,pIntCompanyId)
	{
		
		var url = 'GUIService/ResponsesService.php?action=postdeluserresponse&uid='+ pIntUserId + '&compid='+ pIntCompanyId;
		
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',							
							onSuccess: function(transport) 
							{      
								document.getElementById("DivResponses").innerHTML=transport.responseText;
							} 
						});	
	}
	
	/************************************************************************
	*
	*	Function Name:	GetAllMessages									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/		
	function GetAllMessages(pIntUserId,pIntStatus)
	{
		
		var url = 'GUIService/ResponsesService.php?action=allmeassage';
		var par = 'userId='+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("divDashBoard").innerHTML=transport.responseText;
							} 
						});	
	}
	/************************************************************************
	*
	*	Function Name:	GetAllEvents									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/		
	function GetAllEvents(pIntUserId,pIntStatus,pIntCompanyId)
	{
		
		var url = 'GUIService/EventService.php?action=allevent&compid='+pIntCompanyId;
		var par = 'userId='+pIntUserId;
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							parameters:par,
							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);							
								
								//document.getElementById("divDashBoard").innerHTML=transport.responseText;
							} 
						});	
	}
	/************************************************************************
	*
	*	Function Name:	GetJobsDetailByJobId									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/		
	function GetJobsDetailByJobId(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:	EditPostedJob									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/		
	function EditPostedJob(pIntUserId,pIntJobId,pIntCompanyId)
	{
		var url = 'GUIService/JobsService.php?action=editjob&jobId='+pIntJobId+'&uid='+pIntUserId+'&compid='+pIntCompanyId; 
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							onSuccess: function(transport) 
							{ 
								
								strResponse=transport.responseText;//;
								strResponse=strResponse.split("+");
								intEduNo=strResponse[0];
								
								document.getElementById("divDashBoard").innerHTML=strResponse[1];
								
							} 
						}); 
	}
	/************************************************************************
	*
	*	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	: 	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:	AddNewEventByUserId									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function AddNewEventByUserId(pIntUserId,pIntCompanyId)
	{

		var url = 'GUIService/EventService.php?action=newevent&userid='+pIntUserId+'&compid='+pIntCompanyId;
		var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{     
				document.getElementById("divDashBoard").innerHTML=transport.responseText;
				document.getElementById('txtEventName').focus();				
			} 
		});
	}
	/************************************************************************
	*
	*	Function Name:	SaveEvent									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function SaveEvent(pIntUserId,pIntCompanyId)
	{
		
		if(CheckEventSetting())
		{
			var strEventType="";
			var strStartTimeFormat=document.getElementById("cmbTimeFormatStartTime").value;
			var strEndTimeFormat=document.getElementById("cmbTimeFormatEndTime").value;
			var strEventTitle=document.getElementById("txtEventName").value;
			var dteEventStartDate=document.getElementById("txtEventStartDate").value;
			var dteEventEndDate=document.getElementById("txtEventEndDate").value;
			var dteStartTime=document.getElementById("cmbStartHours").value+':'+document.getElementById("cmbMinutes").value+' '+strStartTimeFormat;
			var dteEndTime=document.getElementById("cmbEndHours").value+':'+document.getElementById("cmbEndMinutes").value+' '+strEndTimeFormat;
			var strVenu=document.getElementById("txtEventVenu").value;
			var strRegistrationCre=document.getElementById("txtEventRegistration").value;
			var strEventDetail=document.getElementById("txtEventDetails").value;
			var strPresenterDescription=document.getElementById("txtPresenterDescription").value;
			var strAgenda=document.getElementById("txtAgenda").value;
			var strAgenda=document.getElementById("txtAgenda").value;
			var intCap=document.getElementById("intEventCap").value;
			var intUploadId = document.getElementById("uploadIdentifier").value;			
			if(document.frmEvent.rdEvent[0].checked)
			 {
			   strEventType=document.frmEvent.rdEvent[0].value;
			 }
			else if(document.frmEvent.rdEvent[1].checked)
			 {
			   strEventType=document.frmEvent.rdEvent[1].value;
			 }
			else 
			 {
			   strEventType=document.frmEvent.rdEvent[2].value;
			 }			
			
			var url = 'GUIService/EventService.php?action=saveevent&userid='+pIntUserId+'&compid='+pIntCompanyId;
			
			 var par='userid='+pIntUserId
						 +'&eventtitle='+strEventTitle
						 +'&eventstartdate='+dteEventStartDate
						 +'&eventenddate='+dteEventEndDate
						 +'&eventstarttime='+dteStartTime
						 +'&eventendtime='+dteEndTime
						 +'&venu='+strVenu
						 +'&regcre='+strRegistrationCre
						 +'&eventdetail='+strEventDetail
						 +'&presenterdesc='+strPresenterDescription
						 +'&agenda='+strAgenda
						 +'&eventtype='+strEventType
						 +'&eventcap='+intCap
						 +'&uploadIdentifier='+intUploadId;
			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=programmanager";
						var strHtml='<table border=0 cellspacing=5 cellpading=5 width=700>';
						strHtml+='<tr>';
						strHtml+='<td align="center"><br><br>';
						strHtml+='<span class="BodyTextMessage">The Event Has Been Added.</span>';
						strHtml+='</td>';
						strHtml+='</tr>';
						strHtml+='<tr>';
						strHtml+='<td align="center">';
						strHtml+='<a href="#" onclick="backToDashboard()">';
						strHtml+='<img border=0 src="../../IncludeFiles/CSS/images/backtoboard-button.jpg"  onMouseOver= "this.src =\'../../IncludeFiles/CSS/images/backtoboard-hover.jpg\'" onMouseOut= "this.src =\'../../IncludeFiles/CSS/images/backtoboard-hover.jpg\'"">	</a>';
						strHtml+='</td>';
						strHtml+='</tr>';
						strHtml+='</table>';
						document.getElementById("divDashBoard").innerHTML=strHtml;
					}
				} 
			 });
			 
		}
	
	}
	/************************************************************************
	*
	*	Function Name:	GetEditEventDetailById									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function GetEditEventDetailById(pIntEventId)
	{

		var url = 'GUIService/EventService.php?action=editeventdetail&eventid='+pIntEventId;
		var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{     
				document.getElementById("divDashBoard").innerHTML=transport.responseText;
			} 
		});
	}
	/************************************************************************
	*
	*	Function Name:	EditEventById									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function EditEventById(pIntEventId,pIntUserId)
	{
				
		if(CheckEventSetting())
		{
			var strEventType="";
			var strStartTimeFormat=document.getElementById("cmbTimeFormatStartTime").value;
			var strEndTimeFormat=document.getElementById("cmbTimeFormatEndTime").value;
			var strEventTitle=document.getElementById("txtEventName").value;
			var dteEventStartDate=document.getElementById("txtEventStartDate").value;
			var dteEventEndDate=document.getElementById("txtEventEndDate").value;
			var dteStartTime=document.getElementById("cmbStartHours").value+':'+document.getElementById("cmbMinutes").value+' '+strStartTimeFormat;
			var dteEndTime=document.getElementById("cmbEndHours").value+':'+document.getElementById("cmbEndMinutes").value+' '+strEndTimeFormat;
			var strVenu=document.getElementById("txtEventVenu").value;
			var strRegistrationCre=document.getElementById("txtEventRegistration").value;
			var strEventDetail=document.getElementById("txtEventDetails").value;
			var strPresenterDescription=document.getElementById("txtPresenterDescription").value;
			var strAgenda=document.getElementById("txtAgenda").value;
			var intCap=document.getElementById("intEventCap").value;
			
			if(document.frmEvent.rdEvent[0].checked)
			 {
			   strEventType=document.frmEvent.rdEvent[0].value;
			 }
			else if(document.frmEvent.rdEvent[1].checked)
			 {
			   strEventType=document.frmEvent.rdEvent[1].value;
			 }
			else 
			 {
			   strEventType=document.frmEvent.rdEvent[2].value;
			 }
			
			var url = 'GUIService/EventService.php?action=editevent&eventid='+pIntEventId;
			
			 var par='userid='+pIntUserId
					 +'&eventtitle='+strEventTitle
					 +'&eventstartdate='+dteEventStartDate
					 +'&eventenddate='+dteEventEndDate
					 +'&eventstarttime='+dteStartTime
					 +'&eventendtime='+dteEndTime
					 +'&venu='+strVenu
					 +'&regcre='+strRegistrationCre
					 +'&eventdetail='+strEventDetail
					 +'&presenter='+strPresenterDescription
					 +'&agenda='+strAgenda
					 +'&type='+strEventType
					 +'&cap='+intCap;
			
			 var myRequest= new Ajax.Request(
			 url, 
			 {   
				method: 'post',
				parameters:par,
				onSuccess: function(transport) 
				{   
					
					if(transport.responseText==1)
					{
						window.location="index.php?q=programmanager";
					}
				} 
			 });
		}
	}
	/************************************************************************
	*
	*	Function Name:	GetImportHtml									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function GetImportHtml(pIntUserId)
	{

		var url = 'GUIService/SettingService.php?action=ImportResume&userid='+pIntUserId;
		var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{     
				document.getElementById("divDashBoard").innerHTML=transport.responseText;
			} 
		});
	}
	/************************************************************************
	*
	*	Function Name:	CreateNewNetwork									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function CreateNewNetwork(pIntUserId,pIntCompanyId)
	{
		
		var url = 'GUIService/NetworkService.php?action=newnetwork&userid='+pIntUserId+'&companyid='+pIntCompanyId;
		var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{     
				
				document.getElementById("divDashBoard").innerHTML=transport.responseText;
			} 
		});
	}
	/************************************************************************
	*
	*	Function Name:	SaveNetwork									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function SaveNetwork(pIntUserId,pIntCompanyId)
	{
		
		var strNetworkTitle=document.getElementById("txtNetworkName").value;
		var strNetworktype=document.getElementById("cmbNetworktype").value;
		var strNetworkDescription=document.getElementById("txtNetworkDescription").value;
		
		var url = 'GUIService/NetworkService.php?action=addnetwork&userid='+pIntUserId+'&companyid='+pIntCompanyId;
		
		var par='userid='+pIntUserId
				 +'&networktitle='+strNetworkTitle
				 +'&networktype='+strNetworktype
				 +'&networkdes='+strNetworkDescription;
		
		var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			parameters:par,
			onSuccess: function(transport) 
			{   
				
				if(transport.responseText==1)
				{
					window.location="index.php?q=programmanager";
				}
			} 
		});
		
	}
	/************************************************************************
	*
	*	Function Name:	EditNetworkById									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function EditNetworkById(pIntUserId,pIntCompanyId,pIntNetworkId)
	{
		var url = 'GUIService/NetworkService.php?action=editnetwork&userid='+pIntUserId+'&companyid='+pIntCompanyId+'&networkid='+pIntNetworkId;
		var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{     
				
				document.getElementById("divDashBoard").innerHTML=transport.responseText;
			} 
		});
	}
	/************************************************************************
	*
	*	Function Name:	UpdateNetwork									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function UpdateNetwork(pIntUserId,pIntCompanyId,pIntNetworkId)
	{

		var strNetworkTitle=document.getElementById("txtNetworkName").value;
		var strNetworktype=document.getElementById("cmbNetworktype").value;
		var strNetworkDescription=document.getElementById("txtNetworkDescription").value;
			
		var url = 'GUIService/NetworkService.php?action=updatenetwork&userid='+pIntUserId+'&companyid='+pIntCompanyId+'&networkid='+pIntNetworkId;
		
		var par='userid='+pIntUserId
				 +'&networktitle='+strNetworkTitle
				 +'&networktype='+strNetworktype
				 +'&networkdes='+strNetworkDescription;
		
		var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			parameters:par,
			onSuccess: function(transport) 
			{   
				if(transport.responseText==1)
				{
					window.location="index.php?q=programmanager";
				}
			} 
		});
		
	}
		/************************************************************************
	*
	*	Function Name:	DeleteNetworkById									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function DeleteNetworkById(pIntNetworkId)
	{
		if(confirm('Are you sure want to delete?'))
		{
			var url = 'GUIService/NetworkService.php?action=deletenetwork&networkid='+pIntNetworkId;
			var myRequest= new Ajax.Request(
			url, 
			{   
				method: 'post',
				onSuccess: function(transport) 
				{     
    				if(transport.responseText==1)
					{
						window.location="index.php?q=programmanager";
					}
				} 
			});
		}
	}
	/************************************************************************
	*
	*	Function Name:	InviteUsers									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function InviteUsers(pIntNetworkId,pIntCompanyId,pIntUserId)
	{
		var url = 'GUIService/NetworkService.php?action=inviteuser&networkid='+pIntNetworkId+'&compid='+pIntCompanyId+'&uid='+pIntUserId;
		var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{     
				document.getElementById("divDashBoard").innerHTML=transport.responseText;
			} 
		});
	}
	/************************************************************************
	*
	*	Function Name:	SendInvitation									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function SendInvitation(pIntNetworkId)
	{

		var intUserId=document.getElementById("cmbUsers").value;	
		var url = 'GUIService/NetworkService.php?action=saveinvitation&networkid='+pIntNetworkId;
		var par='invuserid='+intUserId;
		var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			parameters:par,
			onSuccess: function(transport) 
			{   
				if(transport.responseText==1)
				{
					window.location="index.php?q=programmanager";
				}
			} 
		});
		
	}
	/************************************************************************
	*
	*	Function Name:	GetNetworkById									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function GetNetworkById(pIntNetworkId)
	{
		var url = 'GUIService/NetworkService.php?action=networkdetail&networkid='+pIntNetworkId;
		var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{     
				document.getElementById("divDashBoard").innerHTML=transport.responseText;
			} 
		});
	}
	/************************************************************************
	*
	*	Function Name:	UpdatePostJob									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function UpdatePostJob(pIntUserId,pIntJobId)
	{
		if(CheckSetting())
		{
			var arrSkilled=new Array();
			var intCounter=0;
			for(var i=1;i<=intSkillNo;i++)
			{
				var strChkName="chk"+i;
				if(document.getElementById(strChkName).checked==true)
				{
					arrSkilled[intCounter]=document.getElementById(strChkName).value;
					intCounter++;
				}
			}
			var arrEducation = new Array();
			var intCounterEdu=0;
			for(var j=1;j<=intEduNo;j++)
			{
				
				var strChkNameSkill="chkedu"+j;
				
				if(document.getElementById(strChkNameSkill).checked==true)
				{
					arrEducation[intCounterEdu]=document.getElementById(strChkNameSkill).value;
					intCounterEdu++;
				}
			}
			
			var url = 'GUIService/JobsService.php?action=updatepostjob&uid='+pIntUserId+'&jobid='+pIntJobId;

			var strJobTitle=document.getElementById('txtJobTitle').value;
			var intJobTypeId=document.getElementById('cmbJobType').value;
			
			var intDepartment=document.getElementById('cmbDepartment').value;
			var intIndustry=document.getElementById('cmbIndustry').value;
			var strExperience=document.getElementById('cmdExperience').value;
			var intCountryId=document.getElementById('cmbCountry').value;
			var intStateId=document.getElementById('cmbState').value;
			var intCityId=0;
			var strSkills=document.getElementById('txtSkills').value;
			var strJobDescription=document.getElementById('txtJobDescription').value;
			var strCity=document.getElementById('txtCity').value;		
			var strReqNo=document.getElementById('txtReqNo').value;	
			var par='skill='+strSkills+'&jobtitle='+strJobTitle+'&typeid='+intJobTypeId+'&deptid='+intDepartment+'&indid='+intIndustry+'&exp='+strExperience+'&countryid='+intCountryId+'&cityid='+intCityId+'&descrip='+strJobDescription+'&edu='+arrEducation+'&stateid='+intStateId+'&cityname='+strCity+'&reqno='+strReqNo;
			
			var myRequest= new Ajax.Request(
				url, 
			{   
				method: 'post',
				parameters:par,
				onSuccess: function(transport) 
				{     
					window.location="index.php?q=programmanager";
				} 
			});
		}
		
	}
	/************************************************************************
	*
	*	Function Name:	CheckEventSetting									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function CheckEventSetting()
	{
	
		document.getElementById('divEventTitle').innerHTML="";
		document.getElementById('DivEventCap').innerHTML="";
		document.getElementById("StartErrorMessage").innerHTML="";
		document.getElementById('DivEventVenu').innerHTML="";
		if(document.getElementById('txtEventName').value=="")
		{
			document.getElementById('divEventTitle').innerHTML='<span class="ErrorMessage">Required Field</span>';
			document.getElementById('txtEventName').focus();
			return false;
		}
		else
		{

			if(!CheckSpaces(document.getElementById('txtEventName').value))
			{
				document.getElementById('divEventTitle').innerHTML='<span class="ErrorMessage">Invalid Data Entry</span>';
				document.getElementById('txtEventName').focus();
				return false;	
			}
			if(CheckStringLength(document.getElementById('txtEventName').value))
			{
				document.getElementById('divEventTitle').innerHTML="";
			}
			else
			{
				document.getElementById('divEventTitle').innerHTML='<span class="ErrorMessage">String length too large. Only 255 characters allowed</span>';		
				document.getElementById('txtEventName').focus();
				return false;	
			}
		}
		
		var intStartHour=document.getElementById("cmbStartHours").value;
		var intEndHour=document.getElementById("cmbEndHours").value;
		var intStartTime=document.getElementById("cmbMinutes").value;
		var intEndTime=document.getElementById("cmbEndMinutes").value;
		var strStartTimeFormat=document.getElementById("cmbTimeFormatStartTime").value;
		var strEndTimeFormat=document.getElementById("cmbTimeFormatEndTime").value;
		var dteEventStartDate=document.getElementById("txtEventStartDate").value;
		var dteEventEndDate=document.getElementById("txtEventEndDate").value;
		
		if(strStartTimeFormat==strEndTimeFormat)
		{
			if(intStartHour==12 && intEndHour<12)
			 {
				 document.getElementById("StartErrorMessage").innerHTML="";
				
			 }
			 
			 if(intStartHour<12 && intEndHour==12)
			 {
				 document.getElementById("StartErrorMessage").innerHTML='<span class="ErrorMessage">Time format is invalid!</span>';
				 return false;
			 }
			 var dif=intStartHour-intEndHour; 
			if(dif>0)	
			{
				 if(intStartHour!=12)
				  {
					 document.getElementById("StartErrorMessage").innerHTML='<span class="ErrorMessage">Time format is invalid!</span>';
					 return false;
				  }
				  
			}
			else
			{
					if(intStartHour==intEndHour)
					{
						if(intStartTime>intEndTime || intStartTime==intEndTime)
						{
							document.getElementById("StartErrorMessage").innerHTML='<span class="ErrorMessage">Time format is invalid !</span>';
							return false;
						}
					}
			}
		}
		
		
		if(document.getElementById('txtEventVenu').value=="")
		{
			document.getElementById('DivEventVenu').innerHTML='<span class="ErrorMessage">Required Field</span>';
			document.getElementById('txtEventVenu').focus();
			return false;
		}
		else
		{

			if(!CheckSpaces(document.getElementById('txtEventVenu').value))
			{
				document.getElementById('DivEventVenu').innerHTML='<span class="ErrorMessage">Invalid Data Entry</span>';
				document.getElementById('txtEventVenu').focus();
				return false;	
			}
			
			if(CheckStringLength(document.getElementById('txtEventVenu').value))
			{
				document.getElementById('DivEventVenu').innerHTML="";
			}
			
			else
			{
				document.getElementById('DivEventVenu').innerHTML='<span class="ErrorMessage">String length too large. Only 255 characters allowed</span>';		
				document.getElementById('txtEventVenu').focus();
				return false;	
			}
		}
		if(document.getElementById('intEventCap').value=="")
		{
			document.getElementById('DivEventCap').innerHTML='<span class="ErrorMessage">Required Field</span>';
			document.getElementById('intEventCap').focus();
			return false;
		}
		else if(!CheckNumbers(document.getElementById('intEventCap').value))
		{
			document.getElementById('DivEventVenu').innerHTML="";
			document.getElementById('DivEventCap').innerHTML='<span class="ErrorMessage">Invalid Data Entry</span>';		
			return false;	
		}
		else
		{
			document.getElementById('DivEventCap').innerHTML="";
			return true;
		}
		

		
		
		
		return true;
	}
	/************************************************************************
	*
	*	Function Name:	DeleteEventById									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function DeleteEventById(pIntEventId,pIntUserId,pIntMoreView)
	{
		if(confirm('Are you sure want to delete the event?'))
		{
			var url = 'GUIService/EventService.php?action=deleteevent&eventid='+pIntEventId+'&uid='+pIntUserId;
			var myRequest= new Ajax.Request(
			url, 
			{   
				method: 'post',
				onSuccess: function(transport) 
				{     

					//document.getElementById("divDashBoard").innerHTML=transport.responseText;

					if( (pIntMoreView > 0) && (transport.responseText==1) )
					{
						document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
						GetAllEvents(pIntUserId,1,pIntMoreView);
					}
					else if(transport.responseText==1)
					{
						window.location="index.php?q=programmanager";
					}			
				} 
			});
			
		}
	}
	/************************************************************************
	*
	*	Function Name:	OpenNewJobTypeWindo									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	/*var baseText = null; 
	function OpenNewJobTypeWindow(pIntUserId,pIntCompanyId,w,h)
	{
		
		var e = window.event;
		
		var y=200;
		var x=300;

		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=450>';
		strText+='<tr>';
		strText+='<td valign="top" align=center colspan=3 width=450>';
		strText+='<span class="BodyHeadingOne">New Job Type</span>';
		strText+='</td>';
		strText+='</tr>';
		
		strText+='<tr>';
		strText+='<td valign=top align=left width=30>';
		strText+='</td>';
		strText+='<td valign=top align=left width=100>';
		strText+='<span class="BodyHeadingTwo">Job Type:</span>';
		strText+='</td>';
		strText+='<td valign=top align=left><span class="BodyText">';
		strText+='<input type="text" id="txtNewJobType" name="txtNewJobType" class="BodyInputTextOne"><div id="DivTxtJobType"></div>';
		strText+='</span></td>';
		strText+='</tr>';
		
	
		
		
		strText+='<tr>';
		strText+='<td valign=top align=left width=30>';
		strText+='</td>';
		strText+='<td valign=top align=center colspan=2 height=20>';
		strText+='<span class="BodyText">';
		strText+='';
		strText+='</span></td>';
		strText+='</tr>';
		strText+='<tr>';
		strText+='<td valign=top align=left width=20>';
		strText+='</td>';
		strText+='<td valign=top align=right><div id="divSaveJobType">';
		strText+='<input type="button" id="btnSaveJobType" name="btnSaveJobType" value="Save"onClick="SaveNewJobType('+pIntUserId+','+pIntCompanyId+')">';
		strText+='</div></td>';
		strText+='<td valign=top align=left>';
		strText+='<div id="divSaveJobTypeCancel"><input type="button" value="Cancel" id="btnCancelJobType" name="btnCancelJobType" onclick=hidePopup();></div>';
		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 = (parseInt(h)-110) + "px";  
		 popUp.style.visibility = "visible";
	}*/
	/************************************************************************
	*
	*	Function Name:	hidePopup									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	/*function hidePopup()
	{   
		var popUp = document.getElementById("popupcontent");   
		popUp.style.visibility = "hidden";
	}*/
	/************************************************************************
	*
	*	Function Name:	SaveNewJobType									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	/*function SaveNewJobType(pIntUserId,pIntCompanyId)
	{
		if(CheckJobTypeSetting())
		{
			var url = 'GUIService/JobsService.php?action=addjobtype&uid='+pIntUserId+'&companyid='+pIntCompanyId;
			var strJobType=document.getElementById('txtNewJobType').value;
			var par='jobtype='+strJobType;
			document.getElementById("divSaveJobType").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
			document.getElementById("divSaveJobTypeCancel").innerHTML ="";

			var myRequest= new Ajax.Request(
				url, 
			{   
				method: 'post',
				parameters:par,
				onSuccess: function(transport) 
				{     
					hidePopup();
					document.getElementById("divJobType").innerHTML=transport.responseText;
				} 
			});	
			
		}
	}*/
	/************************************************************************
	*
	*	Function Name:	OpenNewJobTypeWindo									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	/*var baseText = null; 
	function OpenNewDepartmentWindow(pIntUserId,pIntCompanyId,w,h)
	{
		
		var e = window.event;
		
		var y=200;
		var x=300;

		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=450>';
		strText+='<tr>';
		strText+='<td valign="top" align=center colspan=3 width=450>';
		strText+='<span class="BodyHeadingOne">New Department</span>';
		strText+='</td>';
		strText+='</tr>';
		
		strText+='<tr>';
		strText+='<td valign=top align=left width=30>';
		strText+='</td>';
		strText+='<td valign=top align=left width=100>';
		strText+='<span class="BodyHeadingTwo">Department:</span>';
		strText+='</td>';
		strText+='<td valign=top align=left><span class="BodyText">';
		strText+='<input type="text" id="txtNewDepartment" name="txtNewDepartment" class="BodyInputTextOne"><div id="DivTxtDept"></div>';
		strText+='</span></td>';
		strText+='</tr>';
		


	
		
		
		strText+='<tr>';
		strText+='<td valign=top align=left width=30>';
		strText+='</td>';
		strText+='<td valign=top align=center colspan=2 height=20>';
		strText+='<span class="BodyText">';
		strText+='';
		strText+='</span></td>';
		strText+='</tr>';
		strText+='<tr>';
		strText+='<td valign=top align=left width=20>';
		strText+='</td>';
		strText+='<td valign=top align=right><div id="divSaveDepartment">';
		strText+='<input type="button" id="btnSaveDepartment" name="btnSaveDepartment" value="Save"onClick="SaveNewDepartment('+pIntUserId+','+pIntCompanyId+')">';
		strText+='</div></td>';
		strText+='<td valign=top align=left>';
		strText+='<div id="divSaveDepartmentCancel"><input type="button" value="Cancel" id="btnCancelDepartment" name="btnCancelDepartment" onclick=hidePopup();></div>';
		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 = (parseInt(h)-110) + "px";  
		 popUp.style.visibility = "visible";
	}*/
	/************************************************************************
	*
	*	Function Name:	SaveNewJobType									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	/*function SaveNewDepartment(pIntUserId,pIntCompanyId)
	{
		if(document.getElementById('txtNewDepartment').value=="")
		 {
			document.getElementById('DivTxtDept').innerHTML='<span class="ErrorMessage">Required Field</span>';
			document.getElementById('txtNewDepartment').focus();
			return false;
		 }
		else if(!(CheckStringLength(document.getElementById('txtNewDepartment').value)))
		 {
			document.getElementById('DivTxtDept').innerHTML='<span class="ErrorMessage">String length too large. Only 255 characters allowed</span>';
			document.getElementById('txtNewDepartment').focus();
			return false;
		 }
		else
		  {
		 	var url = 'GUIService/JobsService.php?action=adddepartment&uid='+pIntUserId+'&companyid='+pIntCompanyId;
			var strDepartment=document.getElementById('txtNewDepartment').value;
			var par='department='+strDepartment;
			document.getElementById("divSaveDepartment").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
			document.getElementById("divSaveDepartmentCancel").innerHTML ="";

			var myRequest= new Ajax.Request(
				url, 
			{   
				method: 'post',
				parameters:par,
				onSuccess: function(transport) 
				{     
					hidePopup();
					document.getElementById("divDepartment").innerHTML=transport.responseText;
				} 
			});	
			
		}
	}*/
	/************************************************************************
	*
	*	Function Name:	CheckJobTypeSetting									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/		
	/*function CheckJobTypeSetting()
	{
		if(document.getElementById('txtNewJobType').value=="")
		{
			document.getElementById('DivTxtJobType').innerHTML='<span class="ErrorMessage">Required Field</span>';
			document.getElementById('txtNewJobType').focus();
			return false;
		}
		else
		{

			if(CheckStringLength(document.getElementById('txtNewJobType').value))
			{
				document.getElementById('DivTxtJobType').innerHTML="";
				document.getElementById('DivTxtJobType').display="none";
				document.getElementById('DivTxtJobType').visibility="hidden";
				
			}
			else
			{
				document.getElementById('DivTxtJobType').innerHTML='<span class="ErrorMessage">String length too large. Only 255 characters allowed</span>';		
				return false;	
			}
			return true;
		}
		
	}*/
	/************************************************************************
	*
	*	Function Name	:	UpdateStatusForm									
	*	Author Name		: 	Ramish Hashmi
	*																		
	*************************************************************************/		
	function UpdateStatusForm(pIntApplicantId,pIntJobId,pIntUserId)
	{
		var url = 'GUIService/JobsService.php?action=updateapplicantstatus&applicantid='+pIntApplicantId+'&jobId='+pIntJobId+'&userId='+pIntUserId;
		var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{     
				document.getElementById("divDashBoard").innerHTML=transport.responseText;
				GetAppStatusDetail(0);
			} 
		});
		
	}
	/************************************************************************
	*
	*	Function Name	:	GetAppStatusDetail									
	*	Author Name		: 	Ramish Hashmi
	*																		
	*************************************************************************/		
	function GetAppStatusDetail(pIntStatus)
	{
		
		var pIntAppStatus="";	
		if(pIntStatus==0)
		  {
			pIntAppStatus=document.getElementById('appStatus').value;
		  }
	   else
		{
			pIntAppStatus=document.getElementById('cmbAppStatus').value;
		}

	  var url = 'GUIService/JobsService.php?action=getappexplain&appStatus='+pIntAppStatus;
	  document.getElementById("DivExplantion").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
	  var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{     

				document.getElementById("DivExplantion").innerHTML=transport.responseText;
			} 
		});
		
	}
	/************************************************************************
	*
	*	Function Name	:	GetAppStatusDetail									
	*	Author Name		: 	Ramish Hashmi
	*																		
	*************************************************************************/
	function UpdateApplicantStatus(pIntUserId,pIntJobId)
	{
	  var pIntAppStatus=document.getElementById('cmbAppStatus').value;
	  
	  var url = 'GUIService/JobsService.php?action=updateappstatus&appStatus='+pIntAppStatus+'&userId='+pIntUserId+'&jobId='+pIntJobId;
	  document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
	  var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{     
			
				if(transport.responseText ==1)
				{
					window.location="index.php?q=programmanager";
				}
			} 
		});
		
	}
	/************************************************************************
	*	Function Name	:	GetSystemSummary									
	*	Author Name		: 	Ramish Hashmi															
	*************************************************************************/
	function GetCandidateSummary(pIntUserId,pIntStatus)
	{		
	 
	  var url = 'GUIService/ReportsService.php?action=CandidateSummary&uid='+pIntUserId+'&status='+pIntStatus;
	  document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>";	
	  var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{     
				document.getElementById("divDashBoard").innerHTML=transport.responseText;
			} 
		});
		
	}
	
	/************************************************************************
	*	Function Name	:	GetDates									
	*	Author Name		: 	Ramish Hashmi															
	*************************************************************************/
	function GetDates()
	{
		var criteria = document.getElementById("criteriaRpt").value;
		document.getElementById("DivJobRptDates").innerHTML="";
		if(criteria ==2)
		{
			document.getElementById("DivJobRptDates").style.display="inline";
			document.getElementById("DivJobRptDates").style.visibility="visible";
			var url = 'GUIService/ReportsService.php?action=GetDates';
			var myRequest= new Ajax.Request(
				url, 
				{   
				   method: 'post',
				  onSuccess: function(transport) 
				  {     
					document.getElementById("DivJobRptDates").innerHTML=transport.responseText;
				 } 
			});
		 }
	}
	/********************************************************************
	* 	Function Name	:	CheckEmail
	*	Author   Name	:	Ramish Hashmi
	**********************************************************************/
	function CheckEmail(pStrEmail)
	{
		
		if(pStrEmail.indexOf('@')==-1)/*arslanyahoo.com no @ aign*/
		{
			//document.getElementById("emailError").innerHTML="Invalid email address";
			return false;
		}
		
		else if(pStrEmail.indexOf('@')!=pStrEmail.lastIndexOf('@'))/*arslan@yahoo@com*/
		{
			//document.getElementById("emailError").innerHTML="Invalid email address";
			return false;
		}
		else 
		{
			var chunks=pStrEmail.split('@');
			var user=chunks[0];
			if(!user || user.length==0)
			 {
				//ocument.getElementById("emailError").innerHTML="Invalid email address";
				return false;
			 }
			/*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 false;
			}
			if(!CheckValidCharacters(user))/*check user name contains all valid characters*/
			 {
				//	document.getElementById("emailError").innerHTML="Invalid email address";
				return false;		
			 }					
					/*now get the domain part of the email address*/
			 domain=chunks[1];
			if(!CheckDomain(domain))
			{
				//		document.getElementById("emailError").innerHTML="Invalid email address";
				return false;
			}		
		
		return true;
		
		}
	 return true;	
	}
	/**********************************************************************************************************
	*		Function Name : WritePDF()
	*		Author		  : Ramish Hashmi	
	*************************************************************************************************************/
	function WritePDF()
	{
		window.location="pdfconvert.php"; 
		var data = document.getElementById("strPdf").innerHTML;
		document.getElementById("pdfExcel").innerHTML = "<img src='ImageFiles/indicator_medium.gif' />";
		var url = 'pdfconvert.php';
		par = "txt=" + data;
   		
	 	  var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			paramters:par,
			onSuccess: function(transport) 
			{  
			 	document.getElementById("pdfExcel").innerHTML = "";		  
			} 
		});
		document.getElementById("pdfExcel").innerHTML = "";		
		window.location="pdfconvert.php"; 
		
	}

	/**********************************************************************************************************
	*		Function Name : calculatorPDF()
	*		Author		  : Adil Khan	
	*************************************************************************************************************/
	function calculatorPDF()
	{
		var url = 'GUIService/ProgramManagerService.php?action=calPDF';
		par = "txt=" + result;
   		
 	  var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			paramters:par,
			onSuccess: function(transport) 
			{  
			   
			} 
		});
		
		window.location="pdfconvert.php"; 
	}

	/**********************************************************************************************************
	*		Function Name : RegistrationDetails()
	*		Author		  : Ramish Hashmi	
	*************************************************************************************************************/
	function EventRegistrationDetails(pIntEventId,pIntUserId)
	{
	  
	  var url = 'GUIService/EventService.php?action=eventregistrationdetails&uid='+pIntUserId+'&eid='+pIntEventId;
	  		document.getElementById("DivEventReg").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
   		
 	  var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			//paramters:par,
			onSuccess: function(transport) 
			{     
			   document.getElementById("DivEventReg").innerHTML=transport.responseText;
			   document.getElementById("eventBack").focus();
			 } 
		});
	}
	/**********************************************************************************************************
	*		Function Name : AddToCandidateWishList()
	*		Author		  : Ramish Hashmi	
	*************************************************************************************************************/
	function AddToCandidateWishList(pIntUserId,pIntManagerId)
	{
	 xPos = document.documentElement.scrollTop;
	 // document.getElementById("DivWishListMsg").innerHTML="yyaaaadddaaaaa";
	  var strResult="";
	  var url = 'GUIService/UserInfoService.php?action=addcandidatewishlist&uid='+pIntUserId+'&manId='+pIntManagerId;
	  if(document.getElementById("DivCandidatesWishList") )
	    document.getElementById("DivCandidatesWishList").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
      
	   else
	   	  document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>";

		var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{   
				window.scroll(0,xPos);
				if(document.getElementById("DivCandidatesWishList") )
			  	  document.getElementById("DivCandidatesWishList").innerHTML=transport.responseText;
				
				else
				  backToDashboard();
			}  
		});
		
		
	}
	
	/*****************************************************************************************************
	*		Function Name : GetCandidatesWishList()
	*		Author		  : Ramish Hashmi	
	*******************************************************************************************************/
	function GetCandidatesWishList(pIntManagerId,strResult)
	{
	 xPos = document.documentElement.scrollTop; 
	  var url = 'GUIService/UserInfoService.php?action=candidatewishlist&uid='+pIntUserId+'&eid='+pIntEventId;
	  document.getElementById("DivEventReg").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
	
	  var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			//paramters:par,
			onSuccess: function(transport) 
			{   
				window.scroll(0,xPos); 
				document.getElementById("DivEventReg").innerHTML=transport.responseText;
			} 
		});
	}	
	/**********************************************************************************************************
	*		Function Name : RegistrationDetails()
	*		Author		  : Ramish Hashmi	
	*************************************************************************************************************/
    function DeleteFromCandidateWishList(pIntUserId,pIntManagerId)
	{
	  xPos = document.documentElement.scrollTop;
	  var resultStr="";
	  var url = 'GUIService/UserInfoService.php?action=delcandidatewishlist&uid='+pIntUserId+'&manId='+pIntManagerId;
	  
	  if (confirm("Are you sure you want to delete from the wish-list?"))
	  {
	  	 document.getElementById("DivCandidatesWishList").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
	  	var myRequest= new Ajax.Request(
			url, 
			{   
			  method: 'post',
			  onSuccess: function(transport) 
			  {   
				 window.scroll(0,xPos);
				 document.getElementById("DivCandidatesWishList").innerHTML=transport.responseText;
			  }  
		    });
	   }
	}
	/**********************************************************************************************************
	*		Function Name : EditJobStatus()
	*		Author		  : Ramish Hashmi	
	*************************************************************************************************************/
	function EditJobStatusForm(pIntUserId,pIntJobId,pIntCompanyId,pIntJobStatus)
	 {
		var url = 'GUIService/JobsService.php?action=updatejobstatusForm&userId='+pIntUserId+'&jobId='+pIntJobId+'&statusId='+pIntJobStatus+'&compId='+pIntCompanyId;
		var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{     
				document.getElementById("divDashBoard").innerHTML=transport.responseText;
				if(pIntJobStatus==2)
				{
				   document.getElementById('DivFilled').style.display="inline";
			 	   document.getElementById('DivFilled').style.visibility="visible"; 
			 	   document.getElementById('DivFilledRd').style.display="inline";
			 	   document.getElementById('DivFilledRd').style.visibility="visible"; 
				}
			} 
		});
	 }
	 
	/**********************************************************************************************************
	*		Function Name : EditJobStatus()
	*		Author		  : Ramish Hashmi	
	*************************************************************************************************************/
	function UpdateJobStatus(pIntUserId,pIntJobId,pIntCompanyId)
	{
	   var pIntJobStatus = document.getElementById("cmbJobStatus").value;
	   var pNotes = document.getElementById("txtJobNotes").value;
	   var strCandidateType="";
	   if(pIntJobStatus==2)
	   {
	      if(document.frmJobStatus.rdFillded[0].checked)
			strCandidateType=document.frmJobStatus.rdFillded[0].value;
		   
		  else 
			strCandidateType='External';//document.frmJobStatus.rdFillded[1].value;
	   }
	   
	   var url = 'GUIService/JobsService.php?action=updatejobstatus&userId='+pIntUserId+'&jobId='+pIntJobId+'&statusId='+pIntJobStatus+'&compId='+pIntCompanyId+'&notes='+pNotes+'&candidate='+strCandidateType;
	   var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{     
				if(transport.responseText==1)
				{
					window.location="index.php?q=programmanager";	
				}	
			} 
		});
	}
	/**********************************************************************************************************
	*		Function Name : AddParticipant()
	*		Author		  : Nabeel Bin Ezad	
	*************************************************************************************************************/
	function AddParticipant(pIntCompanyId)
	{
		if(CheckParticipantSetting())
		{
			var strName=document.getElementById("txtParticipantFirstName").value+' '+document.getElementById("txtParticipantLastName").value;
			var strEmailAddress=document.getElementById("txtParEmailAddress").value;
			var optn = document.createElement("OPTION");
			optn.text = strName;
			optn.value ="0+"+strName+"+"+strEmailAddress;
			document.getElementById('cmbParticipant').options.add(optn);
			
			var strOtherDetail='invited to participate in an interview';
			var par='fname='+document.getElementById("txtParticipantFirstName").value
			+'&lname='+document.getElementById("txtParticipantLastName").value
			+'&eaddress='+strEmailAddress
			+'&other='+strOtherDetail
			+'&utype='+document.getElementById('cmbType').value
			+'&compId='+pIntCompanyId;
			var url = 'GUIService/ResponsesService.php?action=inviteusersave';
			
			//document.getElementById("popupcontent").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
			hidePopup();
			var myRequest= new Ajax.Request(
			url, 
			{   
				method: 'post',
				parameters:par,
				onSuccess: function(transport) 
				{  
					/*if(transport.responseText==1)
					{
						strHtml+='<span class="BodyTextMessage">Invitation has been sent successfully</span>';
						document.getElementById("DivAddStatus").innerHTML=strHtml;

					}
					else
					{
						document.getElementById("DivAddStatus").innerHTML='<span class="ErrorMessage">Network failure, please contact your network administrator.</span>';
					}
					*/
					hidePopup();
				} 
			});
		
		}
	}
	function CheckParticipantSetting()
	{
		document.getElementById("divParFirstNameMsg").innerHTML="";
		document.getElementById("divParLastNameMsg").innerHTML="";		
		document.getElementById("divParEmailMsg").innerHTML="";
		document.getElementById("divParTypeMsg").innerHTML="";

	  if(document.getElementById("txtParticipantFirstName").value=="")	
		{
			document.getElementById("divParFirstNameMsg").innerHTML="<span class=ErrorMessage>Field Required</span>";
			document.getElementById("txtParticipantFirstName").focus();
			return false;
		}
		else
		{
			document.getElementById("divParFirstNameMsg").innerHTML="";
		}
	  
	  if(document.getElementById("txtParticipantLastName").value=="")	
		{
			document.getElementById("divParLastNameMsg").innerHTML="<span class=ErrorMessage>Field Required</span>";
			document.getElementById("txtParticipantLastName").focus();
			return false;
		}
		else
		{
			document.getElementById("divParLastNameMsg").innerHTML="";
		}
		
		if(CheckValidParEmailAddress(document.getElementById("txtParEmailAddress").value,'divParEmailMsg')==false)
		{
			document.getElementById("txtParEmailAddress").focus();
			return false;
		}
		if(document.getElementById('cmbType').value=="")
		{
		  	document.getElementById("divParTypeMsg").innerHTML="<span class=ErrorMessage>Field Required</span>";
			document.getElementById("cmbType").focus();
			return false;
		}
		return true;
	}
	/************************************************************************
	*
	*	Function Name:	CheckValidEmailAddress									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	
   function CheckValidParEmailAddress(pStrEmailAddress,pStrDivName)
   {

	   
	   if(pStrEmailAddress=='')
	   {
			document.getElementById("divParEmailMsg").innerHTML="<span class=ErrorMessage>Required Field</span>";
			return false;
	   }
	 
	   if(pStrEmailAddress.indexOf('@')==-1) //arslanyahoo.com no @ aign
	   {
			document.getElementById("divParEmailMsg").innerHTML="<span class=ErrorMessage>Invalid email address</span>";
			return false;
	   }
	   if(pStrEmailAddress.indexOf('@')!=pStrEmailAddress.lastIndexOf('@'))
	   {
			document.getElementById("divParEmailMsg").innerHTML="<span class=ErrorMessage>Invalid email address</span>";
			return false;
	   }
	   
	   if(pStrEmailAddress!='')
	   {
			var chunks=pStrEmailAddress.split('@');
			var user=chunks[0];
			if(!user || user.length==0)
			{
				document.getElementById("divParEmailMsg").innerHTML="<span class=ErrorMessage>Invalid email address</span>";
				return false;
			}
			if(user.substring(0,1)=='.'||user.substring(0,1)=='-'||user.substr(user.length-1,1)=='.')	
			{
				document.getElementById("divParEmailMsg").innerHTML="<span class=ErrorMessage>Invalid email address</span>";
				return false;
			}
			if(!CheckValidCharacters(user))//check user name contains all valid characters
			{
				document.getElementById("divParEmailMsg").innerHTML="<span class=ErrorMessage>Invalid email address</span>";
				return false;		
			}					
			domain=chunks[1];
			if(!CheckDomain(domain))
			{
				document.getElementById("divParEmailMsg").innerHTML="<span class=ErrorMessage>Invalid email address</span>";
				return false;
			}
	   }
       return true;
   }
   /************************************************************************
	*
	*	Function Name:	GetEmailSetting									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
   function GetEmailSetting(pIntUserId,pIntCompanyId)
   {
	  // pIntEmailType= document.getElementById("cmbEmailType").value;
	   var url = 'GUIService/SettingService.php?action=emailsetting&userId='+pIntUserId+'&compid='+pIntCompanyId+'&status='+0;
	   var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{     
				document.getElementById("divDashBoard").innerHTML=transport.responseText;
				GetEmailBody(pIntCompanyId,pIntUserId);
			} 
		});
   }

  /************************************************************************
	*
	*	Function Name:	SaveEmailSetting									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
   function SaveEmailSetting(pIntUserId,pIntCompanyId)
   {
	   var intEmailId=document.getElementById("cmbEmailType").value;
	   var pIntEmailStatus;
	   
	   if(document.frmEmail.rdEmailStatus[0].checked)
		   pIntEmailStatus=1;
	   else
	      pIntEmailStatus=0;
	
       var strEmailSubject=document.getElementById("txtEmailSubject").value;
	   if(strEmailSubject=='')
	     {
			document.getElementById("DivEmailSubject").innerHTML='Field Required'; 
			return;
		 }
	  	if(!CheckSpaces(strEmailSubject))
		{
			document.getElementById("DivEmailSubject").innerHTML="Invalid Data Entry";
			return;
		}
	   if(CheckStringLength(strEmailSubject)==false)
		{
			document.getElementById('DivEmailSubject').innerHTML="String length too large. Only 255 characters allowed.";
			return;
		}
	   var strEmailBody=document.getElementById("txtEmailBody").value;
	   if(strEmailBody=='')
	    {
			document.getElementById("DivEmailBody").innerHTMl='Field Required'; 
			return;
		}
	   if(!CheckSpaces(strEmailBody))
		{
			document.getElementById("DivEmailBody").innerHTML="Invalid Data Entry";
			return;
		}
	   
	   var url = 'GUIService/SettingService.php?action=saveemailsetting&userId='+pIntUserId+'&compid='+pIntCompanyId;
	   var par='type='+intEmailId+'&subject='+strEmailSubject+'&body='+ escape(strEmailBody)+'&status='+pIntEmailStatus;
	   var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			parameters:par,
			onSuccess: function(transport) 
			{
				
					document.getElementById("divDashBoard").innerHTML=transport.responseText;
				  backToDashboard();
			} 
		});
   }
   
    /************************************************************************
	*
	*	Function Name:	WriteExl									
	*	Author Name: 	Ramish Hashmi
	*																		
	*************************************************************************/	
  
   function WriteExl(pIntCompanyId,pIntStatus,pIntReportType)
   {
	   window.location="GUIService/excelconverter.php?cid="+pIntCompanyId+"&status="+pIntStatus+"&rptId="+pIntReportType;
	
   }
   /************************************************************************
	*
	*	Function Name:	EditOrganizationInfoForm									
	*	Author Name: 	Ramish Hashmi
	*																		
	*************************************************************************/	

   function EditOrganizationInfoForm(pIntUserId,pIntCompanyId)
   {
	   var url = 'GUIService/OrganizationService.php?action=editorg&userId='+pIntUserId+'&compid='+pIntCompanyId;
	   var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{     
				document.getElementById("divDashBoard").innerHTML=transport.responseText;
				//GetStatesByCountryId(3);
			} 
		});  
   }
    /************************************************************************
	*
	*	Function Name:	WriteJobsToExl									
	*	Author Name: 	Ramish Hashmi
	*																		
	*************************************************************************/	
   function WriteJobsToExl(pIntCompanyId,pIntStatus,pIntCriteria,pIntReportType)
   {
	    var pStrJobTitle=document.getElementById("jobTitle").value;
		var pDteFromDate=""
		var pDdteToDate=""
		if(pIntCriteria==2)
		{
			pDteFromDate=document.getElementById("frmDate").value;
			pDdteToDate=document.getElementById("toDate").value;
		}
		/*window.location="GUIService/excelconverter2.php?cid="+pIntCompanyId+"&status="+pIntStatus+"&rptId="+pIntReportType
															+"&jobTitle="+pStrJobTitle+"&fromDate="+pDteFromDate
															+"&toDate="+pDdteToDate+"&criteria="+pIntCriteria;   
															*/
    window.location="GUIService/excelconverter.php?cid="+pIntCompanyId+"&status="+pIntStatus+"&rptId="+pIntReportType;															
   }
   /************************************************************************
	*
	*	Function Name:	RemoveUpdates									
	*	Author Name: 	Ramish Hashmi
	*																		
	*************************************************************************/	
   function RemoveUpdates(pIntActivityId,pIntUserId,pIntCompanyId,pIntStatus)
   {
	 var url = 'GUIService/UpdatesService.php?action=removeupdate&acId='+pIntActivityId+'&userId='+pIntUserId+'&compId='+pIntCompanyId+'&status='+pIntStatus;
    document.getElementById("DivNewsFeeds").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
	var myRequest= new Ajax.Request(
	   url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{   
			  document.getElementById("DivNewsFeeds").innerHTML=transport.responseText;
			  document.getElementById("DivNewsFeeds").focus();
			} 
		});  
    }
	 /************************************************************************
	*
	*	Function Name:	AddEventToCal									
	*	Author Name: 	Ramish Hashmi
	*																		
	*************************************************************************/	
	function AddEventToCal(pIntEventId)
	{
	   window.location="GUIService/testcal_final.php?eid="+pIntEventId;
	}
    /************************************************************************
	*
	*	Function Name:	GetEmailBody									
	*	Author Name: 	Ramish Hashmi
	*																		
	*************************************************************************/	
	function GetEmailBody(pIntCompanyId,pIntUserId)
	{
	   pIntEmailType=document.getElementById("cmbEmailType").value; 
	   document.getElementById("EmailDetails").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
	   var url = 'GUIService/SettingService.php?action=emailsdetails&emailTypeId='+pIntEmailType+'&companyId='+pIntCompanyId+'&userId='+pIntUserId;
	   var myRequest= new Ajax.Request(
		url, 
		{   
		  
		  onSuccess: function(transport) 
		   {     
				document.getElementById("EmailDetails").innerHTML=transport.responseText;
			} 
		});
	}
	 /************************************************************************
	*
	*	Function Name:	GetUserGroupsUserId									
	*	Author Name: 	Ramish Hashmi
	*																		
	*************************************************************************/	

	function GetUserGroupsByUserId(pIntUserId,pIntCompanyId)
  	{
	   document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
	   var url = 'GUIService/MessageService.php?action=usergroups&userId='+pIntUserId+'&compId='+pIntCompanyId;
	   var myRequest= new Ajax.Request(
		url, 
		{   
		  onSuccess: function(transport) 
		  {     
			 document.getElementById("divDashBoard").innerHTML=transport.responseText;
		  }  
	  });		
	}
	
    /*************************************************************************************
	*	Function Name:	GetOrgDetailsById									
	*	Author Name  : 	Ramish Hashmi
	*	Synposis     :	Activates/Deactivate the user login																
	*****************************************************************************************/		
	function GetOrgDetailsById(pIntCompanyId)
	{
	   document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
	   var url = 'GUIService/OrganizationService.php?action=orgDetails&compId='+pIntCompanyId;
	   var myRequest= new Ajax.Request(
		url, 
		{   
		  onSuccess: function(transport) 
		  {     
			 document.getElementById("divDashBoard").innerHTML=transport.responseText;
		  }  
	  });		
	}
	
    /*************************************************************************************
	*	Function Name:	GetCandidatesByDate									
	*	Author Name  : 	Ramish Hashmi
	*	Synposis     :	GetCandidatesByDate											
	*****************************************************************************************/		
	
	function GetCandidatesByDate(pIntUserId,pIntStatus)
	{
	   var dteStart= document.getElementById('frmDate').value;
	   var dteEnd= document.getElementById('toDate').value;
	   var url = 'GUIService/ReportsService.php?action=CandidateSummaryDates&uid='+pIntUserId+'&status='+pIntStatus+'&start='+dteStart+'&end='+dteEnd;
	   document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>";	
	   var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{     
				document.getElementById("divDashBoard").innerHTML=transport.responseText;
			} 
		});
		
		
		
	}
	
	/************************************************************************
	*
	*	Function Name:	OpenNewNetworkTypeWindow									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	var baseText = null; 
	function OpenNewNetworkTypeWindow(pIntUserId,pIntCompanyId,w,h)
	{
		
		var e = window.event;
		
		var y=200;
		var x=300;

		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=450>';
		strText+='<tr>';
		strText+='<td valign="top" align=center colspan=3 width=450>';
		strText+='<span class="BodyHeadingOne">New Job Type</span>';
		strText+='</td>';
		strText+='</tr>';
		
		strText+='<tr>';
		strText+='<td valign=top align=left width=30>';
		strText+='</td>';
		strText+='<td valign=top align=left width=100>';
		strText+='<span class="BodyHeadingTwo">Network Type:</span>';
		strText+='</td>';
		strText+='<td valign=top align=left><span class="BodyText">';
		strText+='<input type="text" id="txtNewNetType" name="txtNewNetType" class="BodyInputTextOne"><div id="DivTxtJobType"></div>';
		strText+='</span></td>';
		strText+='</tr>';
		
	
		
		
		strText+='<tr>';
		strText+='<td valign=top align=left width=30>';
		strText+='</td>';
		strText+='<td valign=top align=center colspan=2 height=20>';
		strText+='<span class="BodyText">';
		strText+='';
		strText+='</span></td>';
		strText+='</tr>';
		strText+='<tr>';
		strText+='<td valign=top align=left width=20>';
		strText+='</td>';
		strText+='<td valign=top align=right><div id="divSaveNetType">';
		strText+='<input type="button" id="btnSaveJobType" name="btnSaveJobType" value="Save"onClick="SaveNewNetworkTYpe('+pIntUserId+','+pIntCompanyId+')">';
		strText+='</div></td>';
		strText+='<td valign=top align=left>';
		strText+='<div id="divSaveJobTypeCancel"><input type="button" value="Cancel" id="btnCancelJobType" name="btnCancelJobType" onclick=hidePopup();></div>';
		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 = (parseInt(h)-110) + "px";  
		 popUp.style.visibility = "visible";
	}
	
	/************************************************************************
	*
	*	Function Name:	SaveNewNetworkTYpe									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/	
	function SaveNewNetworkTYpe(pIntUserId,pIntCompanyId)
	{
		if(CheckNetWorkTypeSetting())
		{
			var url = 'GUIService/NetworkService.php?action=addnettype&uid='+pIntUserId+'&companyid='+pIntCompanyId;
			var strNetworkType=document.getElementById('txtNewNetType').value;
			var par='nettype='+strNetworkType;
			document.getElementById("divSaveNetType").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
			document.getElementById("divSaveJobTypeCancel").innerHTML ="";

			var myRequest= new Ajax.Request(
				url, 
			{   
				method: 'post',
				parameters:par,
				onSuccess: function(transport) 
				{     
					hidePopup();
					document.getElementById("divNetWorkType").innerHTML=transport.responseText;
				} 
			});	
			
		}
	}
	/************************************************************************
	*
	*	Function Name:	CheckNetWorkTypeSetting									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/		
	function CheckNetWorkTypeSetting()
	{
		if(document.getElementById('txtNewNetType').value=="")
		{
			document.getElementById('ErrorMessage').innerHTML='<span class="ErrorMessage">Required Field</span>';
			document.getElementById('txtNewNetType').focus();
			return false;
		}
		else
		{

			if(CheckStringLength(document.getElementById('txtNewNetType').value))
			{
				document.getElementById('ErrorMessage').innerHTML="";
				document.getElementById('ErrorMessage').display="none";
				document.getElementById('ErrorMessage').visibility="hidden";
				
			}
			else
			{
				document.getElementById('ErrorMessage').innerHTML='<span class="ErrorMessage">String length too large. Only 255 characters allowed</span>';		
				return false;	
			}
			return true;
		}
		
	}
	
	/************************************************************************
	*
	*	Function Name:	GetStatesByCountryIdEdit									
	*	Author Name: 	Ramish Hashmi
	*																		
	*************************************************************************/		

	function GetStatesByCountryIdEdit(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;
			} 
		});
	}
	/************************************************************************
	*
	*	Function Name:	GetJobsReportForm									
	*	Author Name: 	Ramish Hashmi
	*																		
	*************************************************************************/		
	function GetJobsReportForm(pIntUserId,pIntStatus)
	{
		var url = 'GUIService/ReportsService.php?action=jobsform&uid='+pIntUserId;
		document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
		var myRequest= new Ajax.Request(
			url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{     
				document.getElementById("divDashBoard").innerHTML=transport.responseText;
			} 
		});
	}
		
	/************************************************************************
	*
	*	Function Name:	CheckFilledBy									
	*	Author Name: 	Ramish Hashmi
	*																		
	*************************************************************************/		
	function JobStatusCheck()
	{
	
	  var pIntStatus = document.getElementById("cmbJobStatus").value;
	 if(pIntStatus==2)
	  {
		 document.getElementById('DivFilled').style.display="inline";
		 document.getElementById('DivFilled').style.visibility="visible"; 
		 document.getElementById('DivFilledRd').style.display="inline";
		 document.getElementById('DivFilledRd').style.visibility="visible"; 
	  }
	  else
	  {
		document.getElementById('DivFilled').style.display="none";
		document.getElementById('DivFilled').style.visibility="hidden";
		document.getElementById('DivFilledRd').style.display="none";
		document.getElementById('DivFilledRd').style.visibility="hidden"; 
	  }
	}
	
	function CheckInviteEmailAddress(pIntCompanyId)
	{
	   var url = 'GUIService/UserService.php?action=checkEmailAddress'; 
	   var par='email='+document.getElementById('txtEmailAddress').value;
		
	    var myRequest= new Ajax.Request(
				url, 
				{   
				   method: 'post',
				   parameters:par,
				   onSuccess: function(transport) 
				   {      
					 
					 if(transport.responseText > 0)
						{
							document.getElementById("divEmailAddressMsg").innerHTML='<span class="ErrorMessage">Email address already registered</span>';
							document.getElementById("txtEmailAddress").focus();
							return ;
							
						}
					  else 
						{
							
							if(CheckStringLength(document.getElementById('txtEmailAddress').value))
							{
							  document.getElementById('divEmailAddressMsg').innerHTML="";
							}
							
							else
							{
							  document.getElementById('divEmailAddressMsg').innerHTML='<span class="ErrorMessage">String length too large. Only 255 characters allowed</span>';		
							  document.getElementById('txtEmailAddress').focus();
							  return false;	
							}
							
							if(document.getElementById('cmbType').value=="")
							{
							  document.getElementById('divUserTypeMsg').innerHTML='<span class="ErrorMessage">Field Required</span>';		
							  document.getElementById('cmbType').focus();
							  return false;	
							}
							
							
							InviteUser(pIntCompanyId);	
							
							
						}
					}
				});	
	  }
	  
	  function GetCorporateClients(pIntUserId,pIntStartIndex,pIntEndIndex,pIntStatus,pIntPageNo,pIntCompanyId,pIntSortStatus)
	  {
		 xPos = document.documentElement.scrollTop; 
	 	var url = 'GUIService/ProgramManagerService.php?action=corpclient&uid='+pIntUserId+'&start='+pIntStartIndex+'&end='+pIntEndIndex+'&status='+pIntStatus+'&page='+pIntPageNo+'&comp='+pIntCompanyId+'&sort='+pIntSortStatus;
		document.getElementById("DivCorporateClients").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
		var myRequest= new Ajax.Request(
			url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{     
				window.scroll(0,xPos);
				
				document.getElementById("DivCorporateClients").innerHTML=transport.responseText;
			} 
		 });  
	  }
	/************************************************************************
	*
	*	Function Name:	PaggingInterviewSchedule									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/		
	function PaggingInterviewSchedule(pIntUserId,pIntStartIndex,pIndeEndIndex,pIntPageNo,pIntTotalPage,pStatus,pIntTotalRecord,pIntLimit,pIntDashBoard,pIntCompanyId,pIntSort)
	{
		xPos = document.documentElement.scrollTop;
		  
		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(pIntDashBoard==0)
		{
			document.getElementById("DivInterview").innerHTML="<img src=ImageFiles/indicator_medium.gif>"; 
		}
		else
		{
		document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>"; 
		}
	
		var url = 'GUIService/ResponsesService.php?action=pageinterviewsche&pStart='+pIntStartIndex+'&pEnd='+pIndeEndIndex+'&uid='+pIntUserId+'&pPid='+pIntPageNo+'&pStatus='+pIntDashBoard+'&compid='+pIntCompanyId+'&pSort='+pIntSort; 
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							onSuccess: function(transport) 
							{ 
								
								
								window.scroll(0,xPos);
								if(pIntDashBoard==0)
								{	
									document.getElementById("DivInterview").innerHTML=transport.responseText;
								}
								else
								{
									document.getElementById("divDashBoard").innerHTML=transport.responseText;
								}
								
							}
							
						}); 

	}
		
	/************************************************************************
	*
	*	Function Name:	SearchAllCandidate									
	*	Author Name: 	Adil Khan
	*																		
	*************************************************************************/		
	function GetAllScheduledInterview(pIntUserId, pIntCompanyId)
	{
		xPos = document.documentElement.scrollTop;
			var url = 'GUIService/ResponsesService.php?action=pageinterviewsche&pStart=0&uid='+pIntUserId+'&compid='+pIntCompanyId
			+"&pEnd=0&pPid=1&pSort=1&pStatus=1"; 
			
			document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
			
			var myRequest= new Ajax.Request(
					url, 
					{   
						method: 'post',			
						onSuccess: function(transport) 
						{	window.scroll(0,xPos);
							document.getElementById("divDashBoard").innerHTML=transport.responseText;
						} 
					});
		
	}

	/************************************************************************
	*
	*	Function Name:	GetCandidates									
	*	Author Name: 	Ramish Hashmi
	*																		
	*************************************************************************/		
	  
	  function GetCandidates(pIntUserId,pIntStartIndex,pIntEndIndex,pIntStatus,pIntPageNo,pIntSortStatus)
	  {
		
		// xPos = document.documentElement.scrollTop; 
	 	//var url = 'GUIService/ProgramManagerService.php?action=getcand&uid='+pIntUserId+'&pStart='+pIntStartIndex+'&pEnd='+pIntEndIndex+'&status='+pIntStatus+'&pPid='+pIntPageNo+'&sort='+pIntSortStatus;
		var url = 'GUIService/UserInfoService.php?action=getcand&uid='+pIntUserId+'&pStart='+pIntStartIndex+'&pEnd='+pIntEndIndex+'&status='+pIntStatus+'&pPid='+pIntPageNo+'&sort='+pIntSortStatus;
		document.getElementById("DivCandidates").innerHTML="<img src=ImageFiles/indicator_medium.gif>";	
		
		var myRequest= new Ajax.Request(
			url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{     
				//window.scroll(0,xPos);
				
				document.getElementById("DivCandidates").innerHTML=transport.responseText;
			} 
		 });  
	 	  
	  }
	/************************************************************************
	*
	*	Function Name:	GetCandidatesLst									
	*	Author Name: 	Adil Khan
	*																		
	*************************************************************************/		
	  
	  function GetCandidatesLst(pIntUserId,pStrKeyword)
	  {
		document.getElementById("DivCandidates").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
		if( pStrKeyword == '')
		{ 
			url = 'GUIService/UserInfoService.php?action=postdelcand&uid='+pIntUserId;				
			
			var myRequest= new Ajax.Request(
				url, 
				{   
					method: 'post',					
					onSuccess: function(transport) 
					{   
						document.getElementById("DivCandidates").innerHTML=transport.responseText;
					} 
				});  
		}
		else
		{
			url = 'GUIService/UserInfoService.php?action=candsearch';			
			par = 'userId='+pIntUserId+'&keyword='+pStrKeyword;
			
			var myRequest= new Ajax.Request(
				url, 
				{   
					method: 'post',
					parameters:par,
					onSuccess: function(transport) 
					{   
						document.getElementById("DivCandidates").innerHTML=transport.responseText;
					} 
				});  
		}
	 	  
	  }

	  
	/************************************************************************
	*
	*	Function Name:	GetMessages									
	*	Author Name: 	Adil Khan
	*																		
	*************************************************************************/		
	  
	  function GetMessages(pIntUserId)
	  {
		var url = 'GUIService/ResponsesService.php?action=messages&uid='+pIntUserId;
		document.getElementById("DivMessages").innerHTML="<img src=ImageFiles/indicator_medium.gif>";	
		
		var myRequest= new Ajax.Request(
			url, 
		{   
			method: 'post',
			onSuccess: function(transport) 
			{     
				//window.scroll(0,xPos);				
				//document.getElementById("DivCandidates").innerHTML=transport.responseText;
				document.getElementById("DivMessages").innerHTML=transport.responseText;
			} 
		 });  
	 	  
	  }

	  
	  /************************************************************************
	   *
	   *	Function Name:	DeleteCandidates									
	   *	Author Name: 	Ramish Hashmi
	   *																		
	   *************************************************************************/		

	  function DeleteCandidates( pIntUserId,pIntStatus,pIntDelStatus )
	  {
			
			var strDelete="";
			var rptBoxes = document.frmCheckBoxes.rptCandidates.length;
			
			
			
			for (i = 0; i < rptBoxes; i++) 
			{
					if (document.frmCheckBoxes.rptCandidates[i].checked)
					{
						strDelete = strDelete + document.frmCheckBoxes.rptCandidates[i].value + ",";
					}
			} 
        	if(strDelete=='')
			{
				alert("Select At least One User!");
				return;
			}
			else
			{
				if(confirm("Are you sure you want to delete?"))
	            {	
				 	var url = 'GUIService/ReportsService.php?action=deletefromcandreport&users='+strDelete;
					var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							onSuccess: function(transport) 
							{     
								if( pIntDelStatus > 0 )	
									document.getElementById("divDashBoard").innerHTML=transport.responseText;
								else if( pIntDelStatus ==  -1 )
									document.getElementById("DivMessages").innerHTML=transport.responseText;
									
								if(transport.responseText==1)
								{
									if(pIntDelStatus==1)
										GetCandidateSummary(pIntUserId,pIntStatus);										
									else if(pIntDelStatus==2)
										EventsReport(pIntUserId,pIntStatus);	
									else if(pIntDelStatus== -1)
										GetMessages(pIntUserId);
								   else
								   	ViewReportsForms(pIntUserId);
								   //document.getElementById("DivSelect").innerHTML='Deleted';
								}
							} 
		 				});
				 }
			}
		  
	  }
	   /************************************************************************
	   *
	   *	Function Name:	DeleteCandidatesDashbrd									
	   *	Author Name: 	Adil Khan
	   *																		
	   *************************************************************************/		

	  function DeleteCandidatesDashbrd( pIntUserId,pIntStatus,pIntDelStatus )
	  {
			
			var strDelete="";
			var rptBoxes = document.frmCandidates.chkCandidates.length;
			
			
			
			for (i = 0; i < rptBoxes; i++) 
			{
					if (document.frmCandidates.chkCandidates[i].checked)
					{
						strDelete = strDelete + document.frmCandidates.chkCandidates[i].value + ",";
					}
			} 
			
        	if(strDelete=='')
			{
				alert("Select At least One User!");
				return;
			}
			else
			{
				if(confirm("Are you sure you want to delete?"))
	            {	
				 	var url = 'GUIService/ResponsesService.php?action=delmessages&uid='+strDelete;
					var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							onSuccess: function(transport) 
							{     
								if( pIntDelStatus == -1 )	
								{	
									GetMessages(pIntUserId);
								}
								else if(transport.responseText==1)
								{	GetAllMessages(pIntUserId,1);
								}
							} 
		 				});
				 }
			}
		  
	  }

	  /************************************************************************
	  *
	  *	Function Name:	EventsReport									
	  *	Author Name: 	Ramish Hashmi
	  *																		
	  *************************************************************************/ 
	  function EventsReport(pIntUserId,pIntStatus)
	  {
		
		var url = 'GUIService/ReportsService.php?action=EventsReportsForm&uid='+pIntUserId+'&status='+pIntStatus; 
		
		document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>";		 
		var myRequest= new Ajax.Request(
				url, 
				{   
					method: 'post',
					onSuccess: function(transport) 
					{      
						document.getElementById("divDashBoard").innerHTML=transport.responseText;
						
					} 
				});
	  }
	 /************************************************************************
	  *
	  *	Function Name:	GetEventResults									
	  *	Author Name: 	Ramish Hashmi
	  *																		
	  *************************************************************************/ 
 
	  function GetEventResults(pIntUserId,pIntStatus)
	  {
		document.getElementById("DivEventReportResults").innerHTML="";
		document.getElementById("DivEventTitleError").innerHTML="";
		
		if(document.getElementById("eventTitle").value=='')
		  {
			document.getElementById("DivEventTitleError").innerHTML="Field Required";  
		    document.getElementById("eventTitle").focus();
			return; 
		  }
		
		else if(document.getElementById("eventTitle").value=='')
		  {
			document.getElementById("DivEventTitleError").innerHTML="Field Required";  
		    document.getElementById("eventTitle").focus();
			return;
		  } 
		
		else if(CheckStringLength(document.getElementById('eventTitle').value)==false)
		  {
			 document.getElementById('DivEventTitleError').innerHTML="String length too large. Only 255 characters allowed.";
		     document.getElementById("eventTitle").focus();
			 return;
		  }
		 else
		 {					   
			var par='eventTitle='+document.getElementById("eventTitle").value
					 +'&criteria='+document.getElementById("criteriaRpt").value
					 +'&userId='+pIntUserId
					 +'&status='+pIntStatus;
			
			if(document.getElementById("criteriaRpt").value==2)
			{
				par=par+'&fromDate='+document.getElementById("frmDate").value
						+'&toDate='+document.getElementById("toDate").value;	
			}
			var url = 'GUIService/ReportsService.php?action=EventReportResults'; 
			document.getElementById("DivEventReportResults").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
		 	var myRequest= new Ajax.Request(
				url, 
				{   
					method: 'post',
					parameters:par,
					onSuccess: function(transport) 
					{      
						document.getElementById("DivEventReportResults").innerHTML=transport.responseText;
						
					} 
				});
		 }
	  }
	  /************************************************************************
	  *
	  *	Function Name:	EventRegistrationReportDetails									
	  *	Author Name: 	Ramish Hashmi
	  *																		
	  *************************************************************************/ 
 	  function EventRegistrationReportDetails(pIntEventId,pIntUserId,pIntStatus,pIntCompanyId,pstrTitle)
	  {
		  
		var url = 'GUIService/ReportsService.php?action=eventregistrationrptdetails&uid='+pIntUserId+'&eid='+pIntEventId+'&+eventTitle='+pstrTitle+'&status='+pIntStatus+'&compId='+pIntCompanyId+'&eventDate='+document.getElementById("eventDate").value;
		
		document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
   		
 	  	var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			//paramters:par,
			onSuccess: function(transport) 
			{     
			   document.getElementById("divDashBoard").innerHTML=transport.responseText;
			 } 
		});  
		  
	  }
	  /************************************************************************
	  *
	  *	Function Name:	CorpClientsReport									
	  *	Author Name: 	Ramish Hashmi
	  *																		
	  *************************************************************************/ 
 	
	  function CorpClientsReport(pIntUserId,pIntStatus)
	  {
		var url = 'GUIService/ReportsService.php?action=corpclient&uid='+pIntUserId+'&status='+pIntStatus;
		document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
   		
 	  	var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			//paramters:par,
			onSuccess: function(transport) 
			{     
			   document.getElementById("divDashBoard").innerHTML=transport.responseText;
			 } 
		});
	  }
	 /************************************************************************
	  *
	  *	Function Name:	TransferRequestsRpt									
	  *	Author Name: 	Ramish Hashmi
	  *																		
	  *************************************************************************/ 
 	
	  function TransferRequestsRpt(pIntUserId,pIntStatus)
	  {
		var url = 'GUIService/ReportsService.php?action=transfer&uid='+pIntUserId+'&status='+pIntStatus;
		document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
   		
 	  	var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			//paramters:par,
			onSuccess: function(transport) 
			{     
			   document.getElementById("divDashBoard").innerHTML=transport.responseText;
			 } 
		});
	  }
	  /************************************************************************
	  *
	  *	Function Name:	TransitionRequestsRpt									
	  *	Author Name: 	Ramish Hashmi
	  *																		
	  *************************************************************************/ 
 	
	  function TransitionRequestsRpt(pIntUserId,pIntStatus)
	  {
		var url = 'GUIService/ReportsService.php?action=transition&uid='+pIntUserId+'&status='+pIntStatus;
		document.getElementById("divDashBoard").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
   		
 	  	var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			//paramters:par,
			onSuccess: function(transport) 
			{     
			   document.getElementById("divDashBoard").innerHTML=transport.responseText;
			 } 
		});
	  }
	  
	  /************************************************************************
	  *
	  *	Function Name:	ReportsToExcel									
	  *	Author Name: 	Ramish Hashmi
	  *																		
	  *************************************************************************/ 
 	
	  function ReportsToExcel()
	  {
		window.location="GUIService/data.csv"; 
	  }
	  
	  function excelConvert()
	  {
		document.formName.action = "excelConvert.php";
		document.formName.submit();
		
	  }
	  /************************************************************************
	  *
	  *	Function Name:	GetEventsList									
	  *	Author Name: 	Ramish Hashmi
	  *																		
	  *************************************************************************/ 
	  function GetEventsList(pIntUserId, pIntManagerId,pIntUserType,pIntCompanyId)
	  {
		  var url = 'GUIService/EventService.php?action=eventslist&uid='+pIntUserId+'&managerId='+pIntManagerId+'&utypeId='+pIntUserType+'&compId='+pIntCompanyId;
 	  	  var myRequest= new Ajax.Request(
			url, 
			{   
			method: 'post',
			onSuccess: function(transport) 
			{     
			   document.getElementById("DivAdditions").innerHTML=transport.responseText;
			   document.getElementById("eventR").focus();
			} 
		});
	  }
	  /************************************************************************
	  *
	  *	Function Name:	GetGroupsList									
	  *	Author Name: 	Ramish Hashmi
	  *																		
	  *************************************************************************/ 
	  function GetGroupsList(pIntUserId,pIntManagerId,pIntUserType,pIntCompanyId)
	  {
		  var url = 'GUIService/MessageService.php?action=groupslist&uid='+pIntUserId+'&managerId='+pIntManagerId+'&utypeId='+pIntUserType+'&compId='+pIntCompanyId;
 	  	  var myRequest= new Ajax.Request(
			url, 
			{   
			method: 'post',
			onSuccess: function(transport) 
			{     
			   document.getElementById("DivAdditions").innerHTML=transport.responseText;
			   document.getElementById("groupR").focus();
			} 
		});
	  } 
	  /************************************************************************
	  *
	  *	Function Name:	GetJobAppsList									
	  *	Author Name: 	Ramish Hashmi
	  *																		
	  *************************************************************************/ 
 
	  function GetJobAppsList(pIntUserId,pIntManagerId,pIntUserType,pIntCompanyId)
	  {
		  var url = 'GUIService/ResponsesService.php?action=jobappslist&uid='+pIntUserId+'&managerId='+pIntManagerId+'&utypeId='+pIntUserType+'&compId='+pIntCompanyId;
 	  	  var myRequest= new Ajax.Request(
			url, 
			{   
			method: 'post',
			onSuccess: function(transport) 
			{     
			   document.getElementById("DivAdditions").innerHTML=transport.responseText;
			   document.getElementById("jobsR").focus();
			} 
		}); 
	  }
	  /************************************************************************
	  *
	  *	Function Name:	GetScheduledInterview									
	  *	Author Name: 	Adil Khan
	  *																		
	  *************************************************************************/ 
 
	  function GetScheduledInterview(pIntUserId,pIntCompanyId)
	  {
		  var url = 'GUIService/ResponsesService.php?action=postdelinterviewsche&uid='+pIntUserId+'&compId='+pIntCompanyId;
		  document.getElementById("DivInterview").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
 	  	  var myRequest= new Ajax.Request(
			url, 
			{   
				method: 'post',
				onSuccess: function(transport) 
				{     
				   document.getElementById("DivInterview").innerHTML=transport.responseText;			  
				} 
		}); 
	  }

	  /************************************************************************
	  *
	  *	Function Name:	InterviewCheck									
	  *	Author Name: 	Ramish Hashmi {axis:x,containment:"abc"}
	  *																		
	  *************************************************************************/ 
  
	  function InterviewCheck()
	  {
		  
		if(document.frmInterview.chkAllInterview.checked)
        {
		   var checkBoxes = document.frmInterview.chkInterview.length;
			
			for (i = 0; i < checkBoxes; i++) 
					document.frmInterview.chkInterview[i].checked="checked";
		}
		
       else if(!document.frmInterview.chkAllInterview.checked)
        {
		   var checkBoxes = document.frmInterview.chkInterview.length;
			for (i = 0; i < checkBoxes; i++) 
					document.frmInterview.chkInterview[i].checked="";
		}
	  }
	  
	  /************************************************************************
	  *
	  *	Function Name:	DeleteInterview									
	  *	Author Name: 	Ramish Hashmi 
	  *																		
	  *************************************************************************/ 
	  
	  function DeleteInterview(pIntUserId, pIntCompanyId, pIntPanel)
	  {
		 var strDelete="";
		 var checkBoxes = document.frmInterview.chkInterview.length;
			
			for (i = 0; i < checkBoxes; i++) 
			{
					if (document.frmInterview.chkInterview[i].checked)
					 strDelete = strDelete + document.frmInterview.chkInterview[i].value + ",";
					
			} 
        	if(strDelete=='')
			{
				alert("Select At least One!");
				return;
			}
			else
			{
				if(confirm("Are you sure you want to delete?"))
	             {	
				 	var url = 'GUIService/ResponsesService.php?action=deleteinterview&interview='+strDelete;
					var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							onSuccess: function(transport) 
							{     
								if(pIntPanel > 0)
									GetAllScheduledInterview(pIntUserId, pIntCompanyId);
								else if(transport.responseText==1)
									GetScheduledInterview(pIntUserId,pIntCompanyId);
									//backToDashboard();//window.location="index.php?q=programmanager";
		
							} 
		 			  });
				 }
			}
		
	  }
	 
	  /************************************************************************
	  *
	  *	Function Name:	SortInterviewSchedule									
	  *	Author Name: 	Ramish Hashmi 
	  *																		
	  *************************************************************************/ 
	 function SortInterviewSchedule(pIntUserId,pIntStartIndex,pIndeEndIndex,pIntPageNo,pIntTotalPage,pStatus,pIntTotalRecord,pIntLimit,pIntDashBoard,pIntCompanyId,pIntSort)
	  {
		xPos = document.documentElement.scrollTop;
		
		var url = 'GUIService/ResponsesService.php?action=pageinterviewsche&pStart='+pIntStartIndex+'&pEnd='+pIndeEndIndex+'&uid='+pIntUserId+'&pPid='+pIntPageNo+'&pStatus='+pIntDashBoard+'&compid='+pIntCompanyId+'&pSort='+pIntSort; 
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							onSuccess: function(transport) 
							{ 
								
								
								window.scroll(0,xPos);
								if(pIntDashBoard==0)
								{	
									document.getElementById("DivInterview").innerHTML=transport.responseText;
								}
								else
								{
									document.getElementById("divDashBoard").innerHTML=transport.responseText;
								}
								
							}
							
						}); 
	 }
	 
	 
    /*****************************************************************************************************
	*
	*		Function Name : SortCandidateWishList()
	*		Author		  : Ramish Hashmi	
	*
	*******************************************************************************************************/
	function SortCandidateWishList(pIntUserId,pIntStartIndex,pIntEndIndex,pIntStatus,pIntPageNo,pIntSort)
	{
	
	  xPos = document.documentElement.scrollTop; 
	  var url = 'GUIService/UserInfoService.php?action=candidatewishlistsort&uid='+pIntUserId+'&pStart='+pIntStartIndex+'&pEnd='+pIntEndIndex+'&pStatus='+pIntStatus+'&page='+pIntPageNo+'&sort='+pIntSort;
	  document.getElementById("DivCandidatesWishList").innerHTML="<img src=ImageFiles/indicator_medium.gif>";
	
	  var myRequest= new Ajax.Request(
		url, 
		{   
			method: 'post',
			//paramters:par,
			onSuccess: function(transport) 
			{   
				window.scroll(0,xPos); 
				document.getElementById("DivCandidatesWishList").innerHTML=transport.responseText;
			} 
		});
	}
	
    /*****************************************************************************************************
	*
	*		Function Name : GetStatusTypes()
	*		Author		  : Ramish Hashmi	
	*
	*******************************************************************************************************/
   function GetStatusTypes(pIntUserId, pIntManagerId,pIntUserType,pIntCompanyId,pIntManagerType)
   {
	   var url = 'GUIService/UserInfoService.php?action=statuslist&uid='+pIntUserId+'&managerId='+pIntManagerId+'&utypeId='+pIntUserType+'&compId='+pIntCompanyId+'&managerType='+pIntManagerType;
 	  	  var myRequest= new Ajax.Request(
			url, 
			{   
			method: 'post',
			onSuccess: function(transport) 
			{     
			   document.getElementById("DivAdditions").innerHTML=transport.responseText;
			   document.getElementById("statusL").focus();
			} 
		}); 
	   
	   
   }
   
   /*************************************************************************************
	*	Function Name:	checkAll									
	*	Author Name  : 	Adil Khan
	*	Synposis     :	selects all the boxes											
	*****************************************************************************************/		
	function checkAll(frmOptId,status)
	{
		var totalBoxes = eval("document." + frmOptId + ".length");

		if( status == 1 )
			status = eval("true");
		else
			status = eval("false");
		
		for( var i = 0; i < totalBoxes ; i++){
			eval("document." + frmOptId + "[i].checked = status" );
		}
	}
	
	/************************************************************************
	*
	*	Function Name:	GetJobDetail									
	*	Author Name: 	Nabeel Bin Ezad
	*																		
	*************************************************************************/		
	function GetQuickJobDetail(pIntJobId)
	{
		
		var url = 'GUIService/JobsService.php?action=quickjobdetail&jobId='+pIntJobId; 
		
		var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							onSuccess: function(transport) 
							{ 
								
								document.getElementById("divDashBoard").innerHTML=transport.responseText;
							} 
						}); 
	}
	
   /*************************************************************************************
	*	Function Name:	userHistory									
	*	Author Name  : 	Adil Khan
	*	Synposis     :	Gets user's history											
	*****************************************************************************************/		
	
	function userHistory(pIntUserId)
	{
		hidePopup();				
		var url = 'GUIService/UserInfoService.php?action=usrinfo&uid='+pIntUserId;
 	  	  var myRequest= new Ajax.Request(
			url, 
			{   
			method: 'post',
			onSuccess: function(transport) 
			{   
				document.getElementById("divDashBoard").innerHTML=transport.responseText;			  
				
				xPos = document.documentElement.scrollTop; 
				window.scroll(0,xPos);  				
			} 
		}); 
		
	}
	
   /*************************************************************************************
	*	Function Name:	userHistoryReg									
	*	Author Name  : 	Adil Khan
	*	Synposis     :	Gets user's history											
	*****************************************************************************************/		
	
	function userHistoryReg(pIntUserId)
	{		
		var url = 'GUIService/UserInfoService.php?action=usrinfo&uid='+pIntUserId;
 	  	  var myRequest= new Ajax.Request(
			url, 
			{   
			method: 'post',
			onSuccess: function(transport) 
			{   
				document.getElementById("divDashBoard").innerHTML=transport.responseText;			  
				
				xPos = document.documentElement.scrollTop; 
				window.scroll(0,xPos);  				
			} 
		}); 
		
	}
	
	
   /*************************************************************************************
	*	Function Name:	MultipleIntrvws									
	*	Author Name  : 	Adil Khan
	*	Synposis     :	Gets user's history											
	*****************************************************************************************/			
	
	function MultipleIntrvws(pIntUserId,pIntDate)
	{
		var url = 'GUIService/ResponsesService.php?action=multplIntrvws&uid='+pIntUserId +'&dt=' + pIntDate;
 	  	  var myRequest= new Ajax.Request(
			url, 
			{   
			method: 'post',
			onSuccess: function(transport) 
			{    
				
			   document.getElementById("divDashBoard").innerHTML=transport.responseText;			  
			   xPos = document.documentElement.scrollTop; 
			   window.scroll(0,xPos);  				
			} 
		}); 	
	}
	
   /*************************************************************************************
	*	Function Name:	userHistory									
	*	Author Name  : 	Adil Khan
	*	Synposis     :	Gets user's history											
	*****************************************************************************************/			
	
	function MultipleIntrvwsRgstrd(pIntUserId,pIntDate)
	{
		var url = 'GUIService/ResponsesService.php?action=multplIntrvwsrgstrd&uid='+pIntUserId +'&dt=' + pIntDate;
 	  	  var myRequest= new Ajax.Request(
			url, 
			{   
			method: 'post',
			onSuccess: function(transport) 
			{    
				
			   document.getElementById("divDashBoard").innerHTML=transport.responseText;			  
			   xPos = document.documentElement.scrollTop; 
			   window.scroll(0,xPos);  				
			} 
		}); 	
	}	

   /*************************************************************************************
	*	Function Name:	upldEvntFile									
	*	Author Name  : 	Adil Khan
	*	Synposis     :	upload event related file											
	*****************************************************************************************/			


	function upldEvntFile()
	{
		currentVal = document.getElementById('filename').value;
		storedVals = document.getElementById('filesSlctd').innerHTML;
		
		if( (currentVal != '') && (storedVals.indexOf(currentVal) < 0)  )
		{	
			
			document.getElementById('filesSlctd').innerHTML += ',' + currentVal;
			  // run AJAX below
			  var url = 'GUIService/EventService.php?action=upldevntFile';
			  var parameter = 'filePath=' + currentVal;
			
			var myRequest= new Ajax.Request(
				url, 
				{   
				method: 'post',
				param: parameter,
				onSuccess: function(transport) 
				{    
					document.getElementById('filesSlctdMssg').innerHTML = 'Your File Has Been Uploaded';					   
				} 
			}); 	
			
		}
		else if( (currentVal != '') && (storedVals.indexOf(currentVal) > -1) )
			alert("This File Has Been Added");
		else
			alert("the value is blank");
	}
	
   /*************************************************************************************
	*	Function Name:	getData									
	*	Author Name  : 	Adil Khan
	*****************************************************************************************/			

	function getData()
	{
		if(document.getElementById('info'))	
			alert("the val " + document.getElementById('info').innerHTML);
	}
	

   /*************************************************************************************
	*	Function Name:	cntctUsFrm()									
	*	Author Name  : 	Adil Khan
	*	Synposis     :	Contact Us Form Checker											
	*****************************************************************************************/			
	function cntctUsFrm()
	{
		emptyFields = 0;
		
		if(document.getElementById("fname").value == '')
		{	document.getElementById("fnameError").innerHTML = 'Field Required';
			emptyFields++;
		}
		else
			document.getElementById("fnameError").innerHTML = '';
			
		if(document.getElementById("lname").value == '')
		{	document.getElementById("lnameError").innerHTML = 'Field Required';
			emptyFields++;
		}
		else
			document.getElementById("lnameError").innerHTML = '';
			
		if(document.getElementById("email").value == '')
		{	document.getElementById("emailError").innerHTML = 'Field Required';
			emptyFields++;
		}
		else if(!CheckEmail(document.getElementById("email").value))
		{	document.getElementById("emailError").innerHTML = 'Invalid Email Address';
			emptyFields++;
		}
		else
			document.getElementById("emailError").innerHTML = '';
			
		if(document.getElementById("company").value == '')
		{	document.getElementById("companyError").innerHTML = 'Field Required';
			emptyFields++;
		}
		else
			document.getElementById("companyError").innerHTML = '';
			
		if(document.getElementById("title").value == '')
		{	document.getElementById("titleError").innerHTML = 'Field Required';
			emptyFields++;
		}
		else
			document.getElementById("titleError").innerHTML = '';
			
		if(document.getElementById("inquiry").value == '')
		{	document.getElementById("inquiryError").innerHTML = 'Field Required';
			emptyFields++;
		}
		else
			document.getElementById("inquiryError").innerHTML = '';
		
		if(document.getElementById("industry").value == '')
		{	document.getElementById("industryError").innerHTML = 'Field Required';
			emptyFields++;
		}
		else
			document.getElementById("industryError").innerHTML = '';
		
		if(document.getElementById("NoOfemployees").value == '')
		{	document.getElementById("NoOfemployeesError").innerHTML = 'Field Required';
			emptyFields++;
		}		
		else
			document.getElementById("NoOfemployeesError").innerHTML = '';
		
		if(document.getElementById("city").value == '')
		{	document.getElementById("cityError").innerHTML = 'Field Required';
			emptyFields++;
		}
		else
			document.getElementById("cityError").innerHTML = '';
		
		if(document.getElementById("state").value == '')
		{	document.getElementById("stateError").innerHTML = 'Field Required';
			emptyFields++;
		}
		else
			document.getElementById("stateError").innerHTML = '';
		
		if(document.getElementById("phone1").value == '' || document.getElementById("phone2").value == '' || document.getElementById("phone3").value == '')
		{	document.getElementById("phoneError").innerHTML = 'Field Required';
			emptyFields++;
		}		
		else if(!CheckNumbers(document.getElementById("phone1").value))
		{	document.getElementById("phoneError").innerHTML = 'Fill This Field With Numbers Only';
			emptyFields++;
		}
		else if(!CheckNumbers(document.getElementById("phone2").value))
		{	document.getElementById("phoneError").innerHTML = 'Fill This Field With Numbers Only';
			emptyFields++;
		}
		else if(!CheckNumbers(document.getElementById("phone3").value))
		{	document.getElementById("phoneError").innerHTML = 'Fill This Field With Numbers Only';
			emptyFields++;
		}
		else
			document.getElementById("phoneError").innerHTML = '';					
		
		if(emptyFields > 0 )
			return false;
		
			var url = 'GUIService/ProgramManagerService.php?action=cntctFrm'; 		
			var par=       'fname='+ document.getElementById("fname").value
						 +'&lname='+document.getElementById("lname").value
						 +'&email='+document.getElementById("email").value
						 +'&company='+document.getElementById("company").value
						 +'&title='+document.getElementById("title").value
						 +'&inquiry='+document.getElementById("inquiry").value
						 +'&industry='+document.getElementById("industry").value
						 +'&noOfEmployees='+document.getElementById("NoOfemployees").value
						 +'&city='+document.getElementById("city").value
						 +'&state='+document.getElementById("state").value
						 +'&phone1='+document.getElementById("phone1").value
						 +'&phone2='+document.getElementById("phone2").value
						 +'&phone3='+document.getElementById("phone3").value;

			var myRequest= new Ajax.Request(
						url, 
						{   
							method: 'post',
							parameters:par,
							onSuccess: function(transport) 
							{								
								document.getElementById("divForm").innerHTML=transport.responseText;								
							}
						}); 
		
	}
	/********************************************************************
	* 	Function Name	:	CheckEmail
	*	Author   Name	:	Ramish Hashmi
	**********************************************************************/
	function CheckEmail(pStrEmail)
	{
		
		if(pStrEmail.indexOf('@')==-1)/*arslanyahoo.com no @ aign*/
		{
			//document.getElementById("emailError").innerHTML="Invalid email address";
			return false;
		}
		
		else if(pStrEmail.indexOf('@')!=pStrEmail.lastIndexOf('@'))/*arslan@yahoo@com*/
		{
			//document.getElementById("emailError").innerHTML="Invalid email address";
			return false;
		}
		else 
		{
			var chunks=pStrEmail.split('@');
			var user=chunks[0];
			if(!user || user.length==0)
			 {
				//ocument.getElementById("emailError").innerHTML="Invalid email address";
				return false;
			 }
			/*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 false;
			}
			if(!CheckValidCharacters(user))/*check user name contains all valid characters*/
			 {
				//	document.getElementById("emailError").innerHTML="Invalid email address";
				return false;		
			 }					
					/*now get the domain part of the email address*/
			 domain=chunks[1];
			if(!CheckDomain(domain))
			{
				//		document.getElementById("emailError").innerHTML="Invalid email address";
				return false;
			}		
		
		return true;
		
		}
	 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

