	// common used js code **************************************************************************/
	var digits = "0123456789";
	// non-digit characters which are allowed in phone numbers
	var phoneNumberDelimiters = "()- ";
	// characters which are allowed in international phone numbers
	// (a leading + is OK)
	var validWorldPhoneChars = phoneNumberDelimiters + "+";
	// Minimum no of digits in an international phone no.
	var minDigitsInIPhoneNumber = 10;
	
	function isInteger(s)
	{   var i;
		for (i = 0; i < s.length; i++)
		{   
			// Check that current character is number.
			var c = s.charAt(i);
			if (((c < "0") || (c > "9"))) return false;
		}
		// All characters are numbers.
		return true;
	}
	function stripCharsInBag(s, bag)
	{   var i;
		var returnString = "";
		// Search through string's characters one by one.
		// If character is not in bag, append to returnString.
		for (i = 0; i < s.length; i++)
		{   
			// Check that current character isn't whitespace.
			var c = s.charAt(i);
			if (bag.indexOf(c) == -1) returnString += c;
		}
		return returnString;
	}
	function checkInternationalPhone(strPhone){
	s=stripCharsInBag(strPhone,validWorldPhoneChars);
	return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
	}
	function isValidEmail(str) {   return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);}
	function emailValidation(emailAddress) 
	{   
		var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
		if(!emailAddress.match(emailExp))
		return false;
		else
		return true;
		
		
	}
	function Validate(strToValidate,RegPattern)
	{
			var expr = new RegExp(RegPattern,"g");
			var result = expr.test(strToValidate);
			if(result==true)
			{
				return true;
			
			}
		else{
				return false;
			}
	}
	function  CompareDateWithServerV2(field1,field2,message)
	{
		var startdate = document.getElementById(field1).value.split('/');
		var currentdate =   document.getElementById(field2).value.split('/');
		//alert(startdate+' ' +enddate);
		var startyear = startdate[2];
		var startmonth = startdate[1];
		var startday = startdate[0];
		
		var currentyear = currentdate[2];
		var currentmonth = currentdate[1];
		var currentday = currentdate[0];

		var iStartDate = new Date(startyear,startmonth-1,startday);
		
		var icurrentDate = new Date(currentyear,currentmonth-1,currentday);
		var iDaySeconds = 1000 * 60 * 60 * 24;
		var startSeconds = iStartDate.getTime();
		var currentSeconds = icurrentDate.getTime();
		
		setDay1 = Math.ceil(startSeconds/iDaySeconds);
		setDay2 = Math.ceil(currentSeconds/iDaySeconds);
		if(setDay1 > setDay2)
		{
								
				alert(message);
				return "BAD";
		}
		else
			return "OK";
	}
	function imageTypeCheck(filename)
	{	
		var fileTypes=["gif","png","jpg","jpeg"]; 
		var defaultPic="spacer.gif";
		var source=filename.value;
		var ext=source.substring(source.lastIndexOf(".")+1,source.length).toLowerCase();
		for (var i=0; i<fileTypes.length; i++) if (fileTypes[i]==ext) break;
		globalPic=new Image();
		if (i<fileTypes.length) globalPic.src=source;
		else 
		{
			//globalPic.src=defaultPic;
			alert("Invalid image. Please upload a file ending with jpg, jpeg, gif or png etc!");
			filename.focus();
			return false;
		}
		return true;
	}
	function checkspecial(fieldId)
	{
			   var iChars = "!@#$%^&*()+=[];,'{}|<>?£";
			   for (var i = 0; i < document.getElementById(fieldId).value.length; i++) {
				if (iChars.indexOf(document.getElementById(fieldId).value.charAt(i)) != -1) {
				alert ("Special characters are not allowed in file name. Please remove and try again.");
				
				document.getElementById(fieldId).focus();
				return false;
			   }  // inner if statement
			 }  // for loop statement
	}
	function submitPaging(frm,page)
	{
		
		document.frmPaging.pageNo.value = page;
		document.frmPaging.submit();
	}
	function  removeItems(Obj)
	{
		var idObjectNameToEmpty=document.getElementById(Obj);
		var totalLength=idObjectNameToEmpty.length;
		for(var ind=1; ind<=totalLength; ind++)
		{
			idObjectNameToEmpty.remove(idObjectNameToEmpty.length-1);
		}
	}
	function deleteRecordsChk()
	{
			 if(confirm("Are you sure to delete this record?"))
			 return true;
			 else
			 return false;
	}
	// end of common used js code *********************************************************************/
	
	// client_registration.php related code **********************************************************/
	function clientFrmValidation()
	{
		
		if(document.getElementById("txtUserName").value == "")
		{
				alert("Please enter username.");
				document.getElementById("txtUserName").focus();
				return false;
		}
		if(Validate(document.getElementById("txtUserName").value,"[^A-Za-z0-9]") == true)
		{
			 alert("Please enter valid username. Only alphanumeric are allowed.");
			 document.getElementById("txtUserName").focus();
			 return false;
		}
		if(document.getElementById("txtPassword").value == "")
		{
			 alert("Please enter password.");
			 document.getElementById("txtPassword").focus();
			 return false;
		}
		if(Validate(document.getElementById("txtPassword").value,"[^A-Za-z0-9]") == true)
		{
			 alert("Please enter valid password. Spaces are not allowed.");
			 document.getElementById("txtPassword").focus();
			 return false;
		}
		if(document.getElementById("txtConfirmPassword").value == "")
		{
			 alert("Please enter confirm password.");
			 document.getElementById("txtConfirmPassword").focus();
			 return false;
		}
		if(Validate(document.getElementById("txtConfirmPassword").value,"[^A-Za-z0-9]") == true)
		{
			 alert("Please enter valid confirm password. Spaces are not allowed.");
			 document.getElementById("txtConfirmPassword").focus();
			 return false;
		}
		if(document.getElementById("txtPassword").value != document.getElementById("txtConfirmPassword").value)
		{
			 alert("Password and confirm password must match.");
			 document.getElementById("txtConfirmPassword").focus();
			 return false;
		}
		if(document.getElementById("txtEmail").value == "") 
		{
			alert("Please enter email.");	
			document.getElementById("txtEmail").focus();
			return false;
		}
		if(emailValidation(document.getElementById("txtEmail").value) == false)
		{
			alert("Please enter valid Email address.");
			document.getElementById("txtEmail").focus();
			return false;
		}	
		if(document.getElementById("txtFirstname").value == "")
		{
				alert("Please enter first name.");
				document.getElementById("txtFirstname").focus();
				return false;
		}
		if(Validate(document.getElementById("txtFirstname").value,"[^A-Za-z]") == true)
		{
			 alert("Please enter valid first name. Only alphabets are allowed.");
			 document.getElementById("txtFirstname").focus();
			 return false;
		}
		if(document.getElementById("txtLastname").value == "")
		{
				alert("Please enter last name.");
				document.getElementById("txtLastname").focus();
				return false;
		}
		if(Validate(document.getElementById("txtLastname").value,"[^A-Za-z]") == true)
		{
			 alert("Please enter valid last name. Only alphabets are allowed.");
			 document.getElementById("txtLastname").focus();
			 return false;
		}
		
		if(document.getElementById("txtPhone").value != "")
		{
			if(checkInternationalPhone(document.getElementById("txtPhone").value) == false)
			{
				alert("Please enter 12 digits Phone Number. Only digits and ‘+’,’-’ and ‘( )’ are allowed.");
				document.getElementById("txtPhone").focus();
				return false;
			}
		}
		if(document.getElementById("txtMobile").value != "")
		{
			if(checkInternationalPhone(document.getElementById("txtMobile").value) == false)
			{
				alert("Please enter 12 digits Mobile Number. Only digits and ‘+’,’-’ and ‘( )’ are allowed.");
				document.getElementById("txtMobile").focus();
				return false;
			}
		}
		if(document.getElementById("txtCompanyName").value == "")
		{
			 alert("Please enter company name.");
			 document.getElementById("txtCompanyName").focus();
			 return false;
		}
	
	
	
		
		if(document.getElementById("employeeImage").value != "")
		{
			if(imageTypeCheck(document.getElementById("employeeImage")) == false) return false;
			if(checkspecial("employeeImage") == false)return false;
		}
		if(document.getElementById('txtempImageCode').value == "")
		{
			alert("Please enter validation code.");
			document.getElementById('txtempImageCode').focus();
			return false;
		}
		if(document.getElementById('chktermcondition').checked == false)
		{
			alert("Please check GNB terms and conditions.");
			document.getElementById('chktermcondition').focus();
			return false;
		}
		return true;
		
	
	}
	function ajaxAction()
	{

			var ajaxRequest;  // The variable that makes Ajax possible!
			var queryString ="";
			var Values = "";
			try{
				// Opera 8.0+, Firefox, Safari
				ajaxRequest = new XMLHttpRequest();
			   } catch (e){
				// Internet Explorer Browsers
							try{
								ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
							   } 		
								catch (e) {
											try{
												ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
												} 
												catch (e){
														// Something went wrong
															alert("Your browser does not support Ajax. You are using old browser!");
														  }	return false;
											}
							}
			
			// Create a function that will receive data sent from the server
			ajaxRequest.onreadystatechange = function()
				{
					if(ajaxRequest.readyState == 4)
						{
								var newimages;
								var val = new Array();
								Values = ajaxRequest.responseText;
								if(Values != "")
								{
									val = Values.split("|");
								}
								newimages=new Image();
								newimages.src = "image.php?text="+val[0];
								document.images.slideimage.src= newimages.src;
								document.getElementById("txtsecurityCode").value = val[1];
						}
				}
		
			var randomnumber=Math.floor(Math.random()*1000);
			ajaxRequest.open("GET", "random.php?ran="+randomnumber, true);
			ajaxRequest.send(null);
		
		
	}
	// end of client_registration.php related code ***************************************************/
	// elogin.php related code ***********************************************************************/
	function empLoginFrmValidat()
	{
			
			if(document.getElementById("txtempUsername").value == "")
			{
					alert("Please enter username.");
					document.getElementById("txtempUsername").focus();
					return false;
			}
			if(Validate(document.getElementById("txtempUsername").value,"[^A-Za-z0-9\\ ]") == true)
			{
				 alert("Please enter valid username.");
				 document.getElementById("txtempUsername").focus();
				 return false;
			}
			if(document.getElementById("txtempPassword").value == "") 
			{
				alert("Please enter login password");	
				document.getElementById("txtempPassword").focus();
				return false;
			}	
			return true;
			
		
	}
	// end of elogin.php related code ***************************************************************/
	// epassword.php related code *******************************************************************/
	function forgetpasswordFrmValidat()
	{
		
		if(document.getElementById("txtempUsername").value == "")
		{
				alert("Please enter username.");
				document.getElementById("txtempUsername").focus();
				return false;
		}
		if(Validate(document.getElementById("txtempUsername").value,"[^A-Za-z0-9\\ ]") == true)
		{
			 alert("Please enter valid username.");
			 document.getElementById("txtcanUsername").focus();
			 return false;
		}
		if(document.getElementById("txtempEmail").value == "") 
		{
			alert("Please enter email address");	
			document.getElementById("txtempEmail").focus();
			return false;
		}	
		if(emailValidation(document.getElementById("txtempEmail").value) == false)
		{
			alert("Please enter valid email address");
			document.getElementById("txtempEmail").focus();
			return false;
		}	
		return true;
		
	
	}
	// end of epassword.php related code ************************************************************/
	// client-detail.php related code ***************************************************************/
function editFrmValidat()
	{
		//document.getElementById("cmdSearchAdd").name = "cmdSubCatSearch";
		if(document.getElementById("txtPassword").value == "")
		{
			 alert("Please enter password.");
			 document.getElementById("txtPassword").focus();
			 return false;
		}
		if(Validate(document.getElementById("txtPassword").value,"[^A-Za-z0-9]") == true)
		{
			 alert("Please enter valid password. Spaces are not allowed.");
			 document.getElementById("txtPassword").focus();
			 return false;
		}
		if(document.getElementById("txtConfirmPassword").value == "")
		{
			 alert("Please enter confirm password.");
			 document.getElementById("txtConfirmPassword").focus();
			 return false;
		}
		if(Validate(document.getElementById("txtConfirmPassword").value,"[^A-Za-z0-9]") == true)
		{
			 alert("Please enter valid confirm password. Spaces are not allowed.");
			 document.getElementById("txtConfirmPassword").focus();
			 return false;
		}
		if(document.getElementById("txtPassword").value != document.getElementById("txtConfirmPassword").value)
		{
			 alert("Password and confirm password must match.");
			 document.getElementById("txtConfirmPassword").focus();
			 return false;
		}
		if(document.getElementById("txtEmail").value == "") 
		{
			alert("Please enter email.");	
			document.getElementById("txtEmail").focus();
			return false;
		}	
		if(emailValidation(document.getElementById("txtEmail").value) == false)
		{
			alert("Please enter valid email.");
			document.getElementById("txtEmail").focus();
			return false;
		}	
		if(document.getElementById("txtFirstname").value == "")
		{
				alert("Please enter first name.");
				document.getElementById("txtFirstname").focus();
				return false;
		}
		if(Validate(document.getElementById("txtFirstname").value,"[^A-Za-z]") == true)
		{
			 alert("Please enter valid first name. Only alphanumeric are allowed.");
			 document.getElementById("txtFirstname").focus();
			 return false;
		}
		if(document.getElementById("txtLastname").value == "")
		{
				alert("Please enter last name.");
				document.getElementById("txtLastname").focus();
				return false;
		}
		if(Validate(document.getElementById("txtLastname").value,"[^A-Za-z]") == true)
		{
			 alert("Please enter valid last name. Only alphanumeric are allowed.");
			 document.getElementById("txtLastname").focus();
			 return false;
		}
		if(document.getElementById("cmbCountries").value == "") 
		{
			alert("Please select location.");	
			document.getElementById("cmbCountries").focus();
			return false;
		}
		if(document.getElementById("txtPhone").value != "")
		{
			if(checkInternationalPhone(document.getElementById("txtPhone").value) == false)
			{
				alert("Please enter 12 digits Phone Number. Only digits and ‘+’,’-’ and ‘( )’ are allowed.");
				document.getElementById("txtPhone").focus();
				return false;
			}
		}
		if(document.getElementById("txtMobile").value != "")
		{
			if(checkInternationalPhone(document.getElementById("txtMobile").value) == false)
			{
				alert("Please enter 12 digits Mobile Number. Only digits and ‘+’,’-’ and ‘( )’ are allowed.");
				document.getElementById("txtMobile").focus();
				return false;
			}
		}
		if(document.getElementById("txtCompanyName").value == "")
		{
			 alert("Please enter company name.");
			 document.getElementById("txtCompanyName").focus();
			 return false;
		}
		if(document.getElementById("comAddress1").value == "")
		{
			 alert("Please enter company address.");
			 document.getElementById("comAddress1").focus();
			 return false;
		}
		if(document.getElementById("cmbCompanyCountries").value == "")
		{
			 alert("Please select company location.");
			 document.getElementById("cmbCompanyCountries").focus();
			 return false;
		}
		if(document.getElementById("txtCompanyPhone").value == "")
		{
			 alert("Please enter company phone no.");
			 document.getElementById("txtCompanyPhone").focus();
			 return false;
		}
		if(checkInternationalPhone(document.getElementById("txtCompanyPhone").value) == false)
		{
			alert("Please enter 12 digits Phone No. Only digits and ‘+’,’-’ and ‘( )’ are allowed.");
			document.getElementById("txtCompanyPhone").focus();
			return false;
		}
		if(document.getElementById("txtCompanyFax").value != "")
		{
			if(checkInternationalPhone(document.getElementById("txtCompanyFax").value) == false)
			{
				alert("Please enter 12 digits Fax Number. Only digits and ‘+’,’-’ and ‘( )’ are allowed.");
				document.getElementById("txtCompanyFax").focus();
				return false;
			}
		}
		if(document.getElementById("employeeImage").value != "")
		{
			if(fileTypeCheck(document.getElementById("employeeImage")) == false) return false;
			if(checkspecial("employeeImage") == false)return false;
		}
		return true;
		
	
	}
	// end of client-detail.php related code *********************************************************/
	// candidate-registeration related code **********************************************************/
	function AdditionFrmValidat()
	{
			
			if(document.getElementById("txtcanUsername").value == "")
			{
					alert("Please enter Username.");
					document.getElementById("txtcanUsername").focus();
					return false;
			}
			if(Validate(document.getElementById("txtcanUsername").value,"[^A-Za-z0-9]") == true)
			{
				 alert("Please enter valid username. Only alphanumeric are allowed.");
				 document.getElementById("txtcanUsername").focus();
				 return false;
			}
			if(document.getElementById("txtcanPassword").value == "")
			{
				 alert("Please enter your Password.");
				 document.getElementById("txtcanPassword").focus();
				 return false;
			}
			if(Validate(document.getElementById("txtcanPassword").value,"[^A-Za-z0-9]") == true)
			{
				 alert("Please enter valid Password. Spaces are not allowed.");
				 document.getElementById("txtcanPassword").focus();
				 return false;
			}
			if(document.getElementById("txtcanConfirmPassword").value == "")
			{
				 alert("Please enter Confirm password.");
				 document.getElementById("txtcanConfirmPassword").focus();
				 return false;
			}
			if(Validate(document.getElementById("txtcanConfirmPassword").value,"[^A-Za-z0-9]") == true)
			{
				 alert("Please enter valid Confirm password. Spaces are not allowed.");
				 document.getElementById("txtcanConfirmPassword").focus();
				 return false;
			}
			if(document.getElementById("txtcanPassword").value != document.getElementById("txtcanConfirmPassword").value)
			{
				 alert("Your Confirm Password does not match with Password.");
				 document.getElementById("txtcanConfirmPassword").focus();
				 return false;
			}
			if(document.getElementById("txtcanEmail").value == "") 
			{
				alert("Please enter Email address.");	
				document.getElementById("txtcanEmail").focus();
				return false;
			}	
			if(emailValidation(document.getElementById("txtcanEmail").value) == false)
			{
				alert("Please enter valid Email address.");
				document.getElementById("txtcanEmail").focus();
				return false;
			}
			
			
			
			
			if(document.getElementById("txtcanTelephone").value == "")
			{
				alert("Please enter valid Telephone number.");
				document.getElementById("txtcanTelephone").focus();
				return false;
			}
			if(document.getElementById('chktermcondition').checked == false)
			{
				alert("Please check GNB terms and conditions.");
				document.getElementById('chktermcondition').focus();
				return false;
			}
			return true;
			
		
	}
	// end of candidate-registeration related code ****************************************************/
	// clogin.php related code ************************************************************************/
	function loginFrmValidat()
	{
			
			if(document.getElementById("txtcanUsername").value == "")
			{
					alert("Please enter username.");
					document.getElementById("txtcanUsername").focus();
					return false;
			}
			if(Validate(document.getElementById("txtcanUsername").value,"[^A-Za-z0-9\\ ]") == true)
			{
				 alert("Please enter valid username.");
				 document.getElementById("txtcanUsername").focus();
				 return false;
			}
			if(document.getElementById("txtcanPassword").value == "") 
			{
				alert("Please enter login password");	
				document.getElementById("txtcanPassword").focus();
				return false;
			}	
			return true;
			
		
	}
	// end of clogin.php related code *****************************************************************/
	// candidate-detail related code ******************************************************************/
	function updationFrmValidat()
	{
			
			if(document.getElementById("txtcanPassword").value == "")
			{
				 alert("Please enter your Password.");
				 document.getElementById("txtcanPassword").focus();
				 return false;
			}
			if(Validate(document.getElementById("txtcanPassword").value,"[^A-Za-z0-9]") == true)
			{
				 alert("Please enter valid Password. Spaces are not allowed.");
				 document.getElementById("txtcanPassword").focus();
				 return false;
			}
			if(document.getElementById("txtcanConfirmPassword").value == "")
			{
				 alert("Please enter Confirm password.");
				 document.getElementById("txtcanConfirmPassword").focus();
				 return false;
			}
			if(Validate(document.getElementById("txtcanConfirmPassword").value,"[^A-Za-z0-9]") == true)
			{
				 alert("Please enter valid Confirm password. Spaces are not allowed.");
				 document.getElementById("txtcanConfirmPassword").focus();
				 return false;
			}
			if(document.getElementById("txtcanPassword").value != document.getElementById("txtcanConfirmPassword").value)
			{
				 alert("Your Confirm Password does not match with Password.");
				 document.getElementById("txtcanConfirmPassword").focus();
				 return false;
			}
			if(document.getElementById("txtcanEmail").value == "") 
			{
				alert("Please enter Email address.");	
				document.getElementById("txtcanEmail").focus();
				return false;
			}	
			if(emailValidation(document.getElementById("txtcanEmail").value) == false)
			{
				alert("Please enter valid Email address.");
				document.getElementById("txtcanEmail").focus();
				return false;
			}
			if(document.getElementById("txtcanFirstName").value == "")
			{
					alert("Please enter First name.");
					document.getElementById("txtcanFirstName").focus();
					return false;
			}
			if(Validate(document.getElementById("txtcanFirstName").value,"[^A-Za-z]") == true)
			{
				 alert("Please enter valid First name. Only alphabets are allowed.");
				 document.getElementById("txtcanFirstName").focus();
				 return false;
			}
			if(document.getElementById("txtcanLastName").value == "")
			{
					alert("Please enter Last name.");
					document.getElementById("txtcanLastName").focus();
					return false;
			}
			if(Validate(document.getElementById("txtcanLastName").value,"[^A-Za-z]") == true)
			{
				  alert("Please enter valid Last name. Only alphabets are allowed.");
				 document.getElementById("txtcanLastName").focus();
				 return false;
			}
			if(document.getElementById("txtcanDateofBirth").value == "")
			{
					alert("Please enter Date of Birth.");
					document.getElementById("txtcanDateofBirth").focus();
					return false;
			}
			if(document.getElementById("txtcanDateofBirth").value  != "")
			{
			 flag_s = CompareDateWithServerV2("txtcanDateofBirth","txtCurrentDate",'Date of Birth cannot be greater than Current Date');
				if(flag_s == "BAD"){
					return false;
				}
			}
			if(document.getElementById("cmbCountries").value == "")
			{
					alert("Please select Country name.");
					document.getElementById("cmbCountries").focus();
					return false;
			}
			if(document.getElementById("txtcanTelephone").value == "")
			{
					alert("Please enter your Phone Number");
					document.getElementById("txtcanTelephone").focus();
					return false;
			}
			if(checkInternationalPhone(document.getElementById("txtcanTelephone").value) == false)
			{
				alert("Please enter 12 digits Phone Number. Only digits and ‘+’,’-’ and ‘( )’ are allowed.");
				document.getElementById("txtcanTelephone").focus();
				return false;
			}
			if(document.getElementById("txtcanMobile").value != "")
			{
				 if(checkInternationalPhone(document.getElementById("txtcanMobile").value) == false)
				{
					alert("Please enter 12 digits Mobile Number. Only digits and ‘+’,’-’ and ‘( )’ are allowed.");
					document.getElementById("txtcanMobile").focus();
					return false;
				}
			}
			return true;
			
		
	}
	// end of candidate-detail related code ***********************************************************/
	// contactus.php related code ********************************************************************/
	function ContactUsFrmValidat()
	{
			
			
			if(document.getElementById("txtFullName").value == "")
			{
					alert("Please enter full name.");
					document.getElementById("txtFullName").focus();
					return false;
			}
			if(Validate(document.getElementById("txtFullName").value,"[^A-Za-z\\ ]") == true)
			{
				 alert("Please enter valid full name.");
				 document.getElementById("txtFullName").focus();
				 return false;
			}
			if(document.getElementById("txtEmail").value == "")
			{
				alert("Please enter email address.");
				document.getElementById("txtEmail").focus();
				return false;
			}
			if(emailValidation(document.getElementById("txtEmail").value) == false)
			{
				alert("Please enter valid email address.");
				document.getElementById("txtEmail").focus();
				return false;
			}
			if(document.getElementById("txtMobile").value != "")
			{
				 if(checkInternationalPhone(document.getElementById("txtMobile").value) == false)
				{
					alert("Please enter 12 digits Mobile Number. Only digits and ‘+’,’-’ and ‘( )’ are allowed.");
					document.getElementById("txtMobile").focus();
					return false;
				}
			}
			if(document.getElementById("txtPhone").value != "")
			{
				 if(checkInternationalPhone(document.getElementById("txtPhone").value) == false)
				{
					alert("Please enter 12 digits Phone Number. Only digits and ‘+’,’-’ and ‘( )’ are allowed.");
					document.getElementById("txtPhone").focus();
					return false;
				}
			}
			if(document.getElementById("cmbCountries").value == "")
			{
				alert("Please select country name.");
				document.getElementById("cmbCountries").focus();
				return false;
			}
			if(document.getElementById("txtComments").value == "")
			{
					alert("Please enter your comments.");
					document.getElementById("txtComments").focus();
					return false;
			}
			return true;
			
		
		}
		function checkPayPackage()
		{
			if(document.getElementById("cmbPackage").value == "0")
			{
					alert("Please select package.");
					document.getElementById("cmbPackage").focus();
					return false;
			}
			return true;
		}
	// end of contactus.php related code *************************************************************/

	// search-job.php related code ****************************************************************/
	function salarriesDisplay(stringValue)
	{
		var stringVal = stringValue.split("|");
		if(document.getElementById("cmbTypeSearch").value == 2)
		{
			var toFill;
			toFill = document.getElementById("cmbAmountSearch");
			if(toFill.length > 1)
			removeItems("cmbAmountSearch");
			
			var poundOptionsPermanentText = new Array();
			poundOptionsPermanentText[0] = "Up to £30K";
			poundOptionsPermanentText[1] = "£30K-£40K";
			poundOptionsPermanentText[2] = "£40K-£50K";
			poundOptionsPermanentText[3] = "£50K-£60K";
			poundOptionsPermanentText[4] = "£60K-£70K";
			poundOptionsPermanentText[5] = "£70K-£80K";
			poundOptionsPermanentText[6] = "£80K-£90K";
			poundOptionsPermanentText[7] = "£90K-£100K";
			poundOptionsPermanentText[8] = "£100k-£125K";
			poundOptionsPermanentText[9] = "£125k or more";
		
			var poundOptionsPermanentValue = new Array();
			poundOptionsPermanentValue[0] = "1";
			poundOptionsPermanentValue[1] = "2";
			poundOptionsPermanentValue[2] = "3";
			poundOptionsPermanentValue[3] = "4";
			poundOptionsPermanentValue[4] = "5";
			poundOptionsPermanentValue[5] = "6";
			poundOptionsPermanentValue[6] = "7";
			poundOptionsPermanentValue[7] = "8";
			poundOptionsPermanentValue[8] = "9";
			poundOptionsPermanentValue[9] = "10";
			for(i=0; i < 10; i++)
			{
				var selected = false;
				for (counter=0;counter<stringVal.length;counter++){
					
					if(stringVal[counter] == poundOptionsPermanentValue[i])
					{
						var makeNewOption=document.createElement("Option");
						makeNewOption.value = poundOptionsPermanentValue[i];
						makeNewOption.text = poundOptionsPermanentText[i];
						toFill.options.add(makeNewOption);
						toFill.options[i].selected = true;
						selected = true;
					}
				}
				if(!selected)
				{
					var makeNewOption=document.createElement("Option");
					makeNewOption.value = poundOptionsPermanentValue[i];
					makeNewOption.text = poundOptionsPermanentText[i];
					toFill.options.add(makeNewOption);
				}
				
			}
		}
		if(document.getElementById("cmbTypeSearch").value == 1)
		{
			var toFill;
			toFill = document.getElementById("cmbAmountSearch");
			if(toFill.length > 1)
			removeItems("cmbAmountSearch");
			
			var poundOptionsInterimText = new Array();
			poundOptionsInterimText[0] = "Up to £200 per day";
			poundOptionsInterimText[1] = "£200-£300 per day";
			poundOptionsInterimText[2] = "£300-£400 per day";
			poundOptionsInterimText[3] = "£400-£500 per day";
			poundOptionsInterimText[4] = "£500-£600 per day";
			poundOptionsInterimText[5] = "£600-£700 per day";
			poundOptionsInterimText[6] = "£700-£800 per day";
			poundOptionsInterimText[7] = "£800 per day or more";
		
			var poundOptionsInterimValue = new Array();
			poundOptionsInterimValue[0] = "11";
			poundOptionsInterimValue[1] = "12";
			poundOptionsInterimValue[2] = "13";
			poundOptionsInterimValue[3] = "14";
			poundOptionsInterimValue[4] = "15";
			poundOptionsInterimValue[5] = "16";
			poundOptionsInterimValue[6] = "17";
			poundOptionsInterimValue[7] = "18";
			for(i=0; i < 8; i++)
			{
				var selected = false;
				for (counter=0;counter<stringVal.length;counter++){
					
					if(stringVal[counter] == poundOptionsInterimValue[i])
					{
						var makeNewOption=document.createElement("Option");
						makeNewOption.value = poundOptionsInterimValue[i];
						makeNewOption.text = poundOptionsInterimText[i];
						toFill.options.add(makeNewOption);
						toFill.options[i].selected = true;
						selected = true;
					}
				}
				if(!selected)
				{
					var makeNewOption=document.createElement("Option");
					makeNewOption.value = poundOptionsInterimValue[i];
					makeNewOption.text = poundOptionsInterimText[i];
					toFill.options.add(makeNewOption);
				}
			}
		}
		/*
		if(document.getElementById("cmbCurrencyTypeSearch").value == 2 && document.getElementById("cmbTypeSearch").value == 2)
		{
			var toFill;
			toFill = document.getElementById("cmbAmountSearch");
			if(toFill.length > 1)
			removeItems("cmbAmountSearch");
			
			var euroOptionsPermanentText = new Array();
			euroOptionsPermanentText[0] = "Up to €45K";
			euroOptionsPermanentText[1] = "€45K-€60K";
			euroOptionsPermanentText[2] = "€60K-€75K";
			euroOptionsPermanentText[3] = "€75K-€90K";
			euroOptionsPermanentText[4] = "€90K-€100K";
			euroOptionsPermanentText[5] = "€100K-€115K";
			euroOptionsPermanentText[6] = "€115K-€130K";
			euroOptionsPermanentText[7] = "€130K-€145K";
			euroOptionsPermanentText[8] = "€145k-€180K";
			euroOptionsPermanentText[9] = "&euro;180k or more";
		
			var euroOptionsPermanentValue = new Array();
			euroOptionsPermanentValue[0] = "0-45";
			euroOptionsPermanentValue[1] = "45-60";
			euroOptionsPermanentValue[2] = "60-75";
			euroOptionsPermanentValue[3] = "75-90";
			euroOptionsPermanentValue[4] = "90-100";
			euroOptionsPermanentValue[5] = "100-115";
			euroOptionsPermanentValue[6] = "115-130";
			euroOptionsPermanentValue[7] = "130-145";
			euroOptionsPermanentValue[8] = "145-180";
			euroOptionsPermanentValue[9] = "180-0";
			for(i=0; i < 10; i++)
			{
				var selected = false;
				for (counter=0;counter<stringVal.length;counter++){
					
					if(stringVal[counter] == euroOptionsPermanentValue[i])
					{
						
						var makeNewOption=document.createElement("Option");
						makeNewOption.value = euroOptionsPermanentValue[i];
						makeNewOption.text = euroOptionsPermanentText[i];
						toFill.options.add(makeNewOption);
						toFill.options[i].selected = true;
						selected = true;
					}
				}
				if(!selected)
				{
					var makeNewOption=document.createElement("Option");
					makeNewOption.value = euroOptionsPermanentValue[i];
					makeNewOption.text = euroOptionsPermanentText[i];
					toFill.options.add(makeNewOption);
				}
				
			}
		}
		if(document.getElementById("cmbCurrencyTypeSearch").value == 2 && document.getElementById("cmbTypeSearch").value == 1)
		{
			var toFill;
			toFill = document.getElementById("cmbAmountSearch");
			if(toFill.length > 1)
			removeItems("cmbAmountSearch");
			
			var euroOptionsInterimText = new Array();
			euroOptionsInterimText[0] = "Up to €300 per day";
			euroOptionsInterimText[1] = "€300-€450 per day";
			euroOptionsInterimText[2] = "€450-€600 per day";
			euroOptionsInterimText[3] = "€600-€750 per day";
			euroOptionsInterimText[4] = "€750-€900 per day";
			euroOptionsInterimText[5] = "€900-€1000 per day";
			euroOptionsInterimText[6] = "€1000-€1150 per day";
			euroOptionsInterimText[7] = "€1150 per day or more";
		
			var euroOptionsInterimValue = new Array();
			euroOptionsInterimValue[0] = "0-300";
			euroOptionsInterimValue[1] = "300-450";
			euroOptionsInterimValue[2] = "450-600";
			euroOptionsInterimValue[3] = "600-750";
			euroOptionsInterimValue[4] = "750-900";
			euroOptionsInterimValue[5] = "900-1000";
			euroOptionsInterimValue[6] = "1000-1150";
			euroOptionsInterimValue[7] = "1150-0";
			for(i=0; i < 8; i++)
			{
				var selected = false;
				for (counter=0;counter<stringVal.length;counter++){
					if(stringVal[counter] == euroOptionsInterimValue[i])
					{
						var makeNewOption=document.createElement("Option");
						makeNewOption.value = euroOptionsInterimValue[i];
						makeNewOption.text = euroOptionsInterimText[i];
						toFill.options.add(makeNewOption);
						toFill.options[i].selected = true;
						selected = true;
					}
				}
				if(!selected)
				{
						var makeNewOption=document.createElement("Option");
						makeNewOption.value = euroOptionsInterimValue[i];
						makeNewOption.text = euroOptionsInterimText[i];
						toFill.options.add(makeNewOption);
				}
			}
		}
		if(document.getElementById("cmbCurrencyTypeSearch").value == 3 && document.getElementById("cmbTypeSearch").value == 2)
		{
			var toFill;
			toFill = document.getElementById("cmbAmountSearch");
			if(toFill.length > 1)
			removeItems("cmbAmountSearch");
			
			var usOptionsPermanentText = new Array();
			usOptionsPermanentText[0] = "Up to $60K";
			usOptionsPermanentText[1] = "$60K-$80K";
			usOptionsPermanentText[2] = "$80K-$100K";
			usOptionsPermanentText[3] = "$100K-$120K";
			usOptionsPermanentText[4] = "$120K-$140K";
			usOptionsPermanentText[5] = "$140K-$160K";
			usOptionsPermanentText[6] = "$160K-$180K";
			usOptionsPermanentText[7] = "$180K-$200K";
			usOptionsPermanentText[8] = "$200k-$250K";
			usOptionsPermanentText[9] = "$250k or more";
		
			var usOptionsPermanentValue = new Array();
			usOptionsPermanentValue[0] = "0-60";
			usOptionsPermanentValue[1] = "60-80";
			usOptionsPermanentValue[2] = "80-100";
			usOptionsPermanentValue[3] = "100-120";
			usOptionsPermanentValue[4] = "120-140";
			usOptionsPermanentValue[5] = "140-160";
			usOptionsPermanentValue[6] = "160-180";
			usOptionsPermanentValue[7] = "180-200";
			usOptionsPermanentValue[8] = "200-250";
			usOptionsPermanentValue[9] = "250-0";
			for(i=0; i < 10; i++)
			{
				var selected = false;
				for (counter=0;counter<stringVal.length;counter++){
					if(stringVal[counter] == usOptionsPermanentValue[i])
					{
						var makeNewOption=document.createElement("Option");
						makeNewOption.value = usOptionsPermanentValue[i];
						makeNewOption.text = usOptionsPermanentText[i];
						toFill.options.add(makeNewOption);
						toFill.options[i].selected = true;
						selected = true;
					}
				}
				if(!selected)
				{
					var makeNewOption=document.createElement("Option");
					makeNewOption.value = usOptionsPermanentValue[i];
					makeNewOption.text = usOptionsPermanentText[i];
					toFill.options.add(makeNewOption);
				}
				
			}
		}
		if(document.getElementById("cmbCurrencyTypeSearch").value == 3 && document.getElementById("cmbTypeSearch").value == 1)
		{
			var toFill;
			toFill = document.getElementById("cmbAmountSearch");
			if(toFill.length > 1)
			removeItems("cmbAmountSearch");
			
			var usOptionsInterimText = new Array();
			usOptionsInterimText[0] = "Up to $400 per day";
			usOptionsInterimText[1] = "$400-$600 per day";
			usOptionsInterimText[2] = "$600-$800 per day";
			usOptionsInterimText[3] = "$800-$1000 per day";
			usOptionsInterimText[4] = "$1000-$1200 per day";
			usOptionsInterimText[5] = "$1200-$1400 per day";
			usOptionsInterimText[6] = "$1400-$1600 per day";
			usOptionsInterimText[7] = "$1600 per day or more";
		
			var usOptionsInterimValue = new Array();
			usOptionsInterimValue[0] = "0-400";
			usOptionsInterimValue[1] = "400-600";
			usOptionsInterimValue[2] = "600-800";
			usOptionsInterimValue[3] = "800-1000";
			usOptionsInterimValue[4] = "1000-1200";
			usOptionsInterimValue[5] = "1200-1400";
	
			usOptionsInterimValue[6] = "1400-1600";
			usOptionsInterimValue[7] = "1600-0";
			for(i=0; i < 8; i++)
			{
				var selected = false;
				for (counter=0;counter<stringVal.length;counter++){
					if(stringVal[counter] == usOptionsInterimValue[i])
					{
						var makeNewOption=document.createElement("Option");
						makeNewOption.value = usOptionsInterimValue[i];
						makeNewOption.text = usOptionsInterimText[i];
						toFill.options.add(makeNewOption);
						toFill.options[i].selected = true;
						selected = true;
					}
				}
				if(!selected)
				{
						var makeNewOption=document.createElement("Option");
						makeNewOption.value = usOptionsInterimValue[i];
						makeNewOption.text = usOptionsInterimText[i];
						toFill.options.add(makeNewOption);
				}
				
			}
		}
		if(document.getElementById("cmbCurrencyTypeSearch").value == "")
		{
			removeItems("cmbAmountSearch");
			document.getElementById('cmbTypeSearch').options[0].selected = true;
		}
		if(document.getElementById("cmbTypeSearch").value == "")
		{
			removeItems("cmbAmountSearch");
		}*/
		
	}
	function formSubmittion(jId)
	{
		
		
		document.getElementById('jobId').value = jId;
		document.getElementById('frmPaging').action = 'detail-job.php';
		document.getElementById('frmPaging').submit();
		
		
	}
	function dateComparsion()
	{
		//alert(document.getElementById("txtMinDateSearchInput").value);
		//alert(document.getElementById("txtMaxDateSearchInput").value);
		var postedMinDate = document.getElementById("txtMinDateSearch").value;
		var postedMaxDate =	document.getElementById("txtMaxDateSearch").value;
		if(postedMinDate != "" &&  postedMaxDate != "")
		{
			//alert('hello');
			flag_s = CompareDateWithServerV2("txtMinDateSearch","txtMaxDateSearch",'Min Date should be less than Max Date.');
			if(flag_s == "BAD"){
				return false;
			}
			
		}
		
	}
	
	// end of search-job.php related code *********************************************************/
