var Country=new Array("Australia","Bahrain","Bangladesh","Belgium","Brunei","Canada","China","France","Germany","Hong Kong","India","Indonesia","Iran","Iraq","Ireland","Israel","Italy","Japan","Kenya","Kuwait","Malaysia","Maldives","Mauritius","Mexico","Netherlands","New Zealand","Norway","Oman","Qatar","Russia","Saudi Arabia","Singapore","South Africa","South Korea","Spain","Sweden","Switzerland","Thailand","Sri Lanka","United Arab Emirates","United Kingdom","United States","Yemen","Zimbabwe","Others");

var Religion=new Array("Christian","Hindu","Muslim","Sikhs","Others");

var PhType=new Array("Work","Residence","Mobile","Friend/Relative");

var PhoneType=new Array("Self","Residence","Work","Friend/Relative");

var State=new Array("Andhra Pradesh","Andaman & Nicobar (UT)","Arunachal Pradesh","Assam","Bihar","Chandighar (UT)","Chattisghar","Daman & Diu (UT)","Delhi","Goa","Gujarath","Haryana","Himachal Pradesh","Jammu & Kashmir","Jharkand","Karnataka","Kerala","Lakshwadeep (UT)","Madhya Pradesh","Maharashtra","Manipur","Meghalaya","Mizoram","Orissa","Pondicherry (UT)","Punjab","Rajasthan","Sikkim","Tamil Nadu","Thripura","Uttatanchal","Uttar Pradesh","West Bengal");

var District=new Array("Trivandrum","Quilon","Pathanamthitta","Alleppey","Kottayam","Idukki","Ernakulam","Trichur","Palghat","Malappuram","Calicut","Wayanad","Kannur","Kasargod","Other");

var Abroad=new Array("Abu Dhabi","Australia","Brunei","Bahrain","Dubai","Malaysia","Oman","Qatar","Singapore","Saudi Arabia");

var Months=new Array("","January","February","March","April","May","June","July","August","September","October","November","December");
var dt=new Date
Cy=dt.getFullYear();

var Rupee=new Array("Less than Rs.3000","Rs.3000 - Rs.5000","Rs.5000 - Rs.7,500","Rs.7,500 - Rs.10,000","Rs.10,000 - Rs.15,000","Rs.15,000 - Rs.20,000","Rs.20,000 - Rs.25,000","Rs.25,000 - Rs.30,000","Rs.30,000 - Rs.35,000","Rs.35,000 - Rs.40,000","Rs.40,000 - Rs.45,000","Rs.45,000 - Rs.50,000","Rs.50,000 - Rs.60,000","Rs.60,000 - Rs.70,000","Rs.70,000 - Rs.80,000","Rs.80,000 - Rs.90,000","Rs.90,000 - Rs.1,00,000","Rs.1 Lakh and above");
var Dollar=new Array("Less than US $250","US $250 - US $500","US $500 - US $750","US $750 - $1000","US $1000 - US $1500","US $1500 - US $2000","Above US $2000");

var JType=new Array("Any","Permanant","Temporary/Contract/Project","Work Experience/Trainee/Apprentice");

var Apply=new Array("I- India Only ","A- Abroad Only ","B- Both ");

var JLocation=new Array("Anywhere","India","Kerala - Cochin","Kerala - Trivandrum");

//var CLevel=new Array("Fresher","Junior Executive","Executives/Supervisors","Senior Executives/Manager","Middle Management","Top Management","Semi-Skilled","Others");
var CLevel=new Array("Fresher","Junior Executive","Executives/Supervisors","Senior Executives/Manager","Middle Management","Top Management","Semi-Skilled","Others","Software Engineer","Systems Engineer");

var LType=new Array("LMV","HMV","Plant");

var LcType=new Array("LMV","HMV","Plant");
var Category=new Array("Any","Admin Support","Engineering","Finance/Accounts","Health Care/Medical","Hospitality/Travel","IT/Computer/Internet","IT Enabled Services","Media/Arts","Personnel/HR","Purchasing/Logistics","Sales & Marketing","Science Technology","Semi Skilled","Other");
var dtCh= "/";
var minYear=1900;
var maxYear=2100;

function ChangeState()
{
  var x=document.frm;
   	 if (x.country.value != "India")
		 document.getElementById('ly').innerHTML='<input type=text name=state size=30 class=textbox>';
	 else
	 document.getElementById('ly').innerHTML='<select size="1" class="tx" name="state"><option value=0>-<option>Andhra Pradesh<option>Andaman & Nicobar (UT)<option>Arunachal Pradesh<option>Assam<option>Bihar<option>Chandighar (UT)<option>Chattisghar<option>Daman & Diu (UT)<option>Delhi<option>Goa<option>Gujarath<option>Haryana<option>Himachal Pradesh<option>Jammu & Kashmir<option>Jharkand<option>Karnataka<option>Kerala<option>Lakshwadeep (UT)<option>Madhya Pradesh<option>Maharashtra<option>Manipur<option>Meghalaya<option>Mizoram<option>Orissa<option>Pondicherry (UT)<option>Punjab<option>Rajasthan<option>Sikkim<option>Tamil Nadu<option>Thripura<option>Uttatanchal<option>Uttar Pradesh<option>West Bengal<option>Other</select>';

}

function TextLength(name,textlength)
{
	name.value=textlength;
}

function isProper(string) {

   if (!string) return false;
   var iChars = "*|,\":<>[]{}`\';()@&$#%' ";

   for (var i = 0; i < string.length; i++)
   {
      if (iChars.indexOf(string.charAt(i)) != -1)
	  {
         return false;
		 break;
 	  }
   }
   return true;
} 

function CandStatus()
{	
 var x=document.frm1;
 DateValidation(fdate)
			if (!correct)
			{
				alert("Invalid Date Format");
				x.fday.focus();
				return (false);
			}
}
// Change Branch/Franchisee Password
function ChangePassword()
{
 var x=document.frm;
 if(x.Opassword.value=="")
 {
   alert("Please Enter Your Old Password");
   x.Opassword.focus();
   return (false);
 }
 if(x.Npassword.value=="")
 {
   alert("Please Enter New Password");
   x.Npassword.focus();
   return false;
 }
 if(x.Npassword.value!=x.Cpassword.value)
 {
   alert("Password Entries Should Match");
   x.Cpassword.select();
   return false;
 }
 //x.submit();
}

//New Branch Registration
function newBranchCheck()
{
var x=document.frm;
	if (x.BRName.value=="")
	{
		alert("Branch Name Should not be Blank");
		x.BRName.select();
		return(false)
	}
	if (x.BRAddress.value=="")
	{
		alert("Address Should not be Blank");
		x.BRAddress.select();
		return(false);
	}
	if (x.Isd.value=="")
	{
		alert("ISD Code Should not be Blank");
		x.Isd.select();
		return(false);
	}
	if (isNaN(x.Isd.value))
	{
		alert("Enter Numeric Value");
		x.Isd.select();
		return(false);
	}
	if (x.Std.value=="")
	{
		alert("STD Code Should not be Blank");
		x.Std.select();
		return(false);
	}
	if (isNaN(x.Std.value))
	{
		alert("Enter Numeric Value");
		x.Std.select();
		return(false);
	}
	if (x.phone.value=="")
	{
		alert("Phone No. Should not be Blank");
		x.phone.select();
		return(false);
	}
	if (isNaN(x.phone.value))
	{
		alert("Enter Numeric Value");
		x.phone.select();
		return(false);
	}
	if (x.email.value=="")
	{
		alert("Email Address Should not be Blank");
		x.email.focus();
		return(false);
	}
	if (x.Lcountry.value=="0")
	{
		alert("Country Should not be Blank");
		x.Lcountry.select();
		return(false);
	}
	if (x.state.value=="0")
	{
		alert("Select a State");
		x.state.focus();
		return(false);
	}
	if (x.location.value=="")
	{
		alert("Location Should not be Blank");
		x.location.select();
		return(false);
	}
	if (x.username.value=="")
	{
		alert("User Name Should not be Blank");
		x.username.select();
		return(false);
	}
	if (x.pass.value=="")
	{
		alert("Password Should not be Blank");
		x.pass.select();
		return(false);
	}
	if (x.CPass.value=="")
	{
		alert("Confirmation Password Should not be Blank");
		x.CPass.select();
		return(false);
	}
	if (x.pass.value!=x.CPass.value)
	{
		alert("Password Entries Should Match");
		x.CPass.select();
		return(false);
	}
	x.action="BranchSubmit.asp";
	x.submit();
}

//New Franchiee
function newFranchiseeCheck()
{
	var x=document.FFranchReg;
	if (x.FRName.value=="")
	{
		alert("Franchisee Name Should not be Blank");
		x.FRName.focus();
		return(false)
	}
	if (x.FRAddress.value=="")
	{
		alert("Address Should not be Blank");
		x.FRAddress.focus();
		return(false);
	}

	if (x.city.value=="")
	{
		alert("City Should not be Blank");
		x.city.focus();
		return(false);
	}
	
	if (x.state.value=="0")
	{
		alert("Select a State");
		x.state.focus();
		return(false);
	}

	if (x.country.value=="0")
	{
		alert("Select a Country");
		x.country.focus();
		return(false);
	}
	if (x.pincode.value=="0")
	{
		alert("Enter Pincode");
		x.pincode.focus();
		return(false);
	}

	if (isNaN(x.pincode.value))
	{
		alert("Enter Numeric Pincode");
		x.pincode.focus();
		return(false);
	}

	if (x.std.value=="")
	{
		alert("STD Code Should not be Blank");
		x.std.focus();
		return(false);
	}
	if (isNaN(x.std.value))
	{
		alert("Enter Numeric Value");
		x.std.focus();
		return(false);
	}
	if (x.local.value=="")
	{
		alert("Phone No. Should not be Blank");
		x.local.focus();
		return(false);
	}
	if (isNaN(x.local.value))
	{
		alert("Enter Numeric Value");
		x.local.focus();
		return(false);
	}
	if (x.Email.value=="")
	{
		alert("Email Address Should not be Blank");
		x.Email.focus();
		return(false);
	}

	if (x.Email.value!="" && echeck(x.Email.value)==false)
	{
		alert("Enter valid Email");
		x.Email.focus();
		return(false);
	}
	
	
	if (x.Username.value=="")
	{
		alert("User Name Should not be Blank");
		x.Username.focus();
		return(false);
	}
	if (x.Username.value.length<4 || x.Username.value.length>12)
	{
		alert("User Name must be between 4 to 12 characters");
		x.Username.focus();
		return(false);
	}
	if (x.Pass.value=="")
	{
		alert("Password Should not be Blank");
		x.Pass.focus();
		return(false);
	}
	if (x.Pass.value.length<4 || x.Pass.value.length>12)
	{
		alert("Password must be between 4 to 12 characters");
		x.Pass.focus();
		return(false);
	}
	if (x.CPass.value=="")
	{
		alert("Confirmation Password Should not be Blank");
		x.CPass.focus();
		return(false);
	}
	if (x.CPass.value!=x.Pass.value)
	{
		alert("Password Entries are not matching");
		x.CPass.focus();
		return(false);
	} 
	x.action="SubmitFranchisee.asp";
	x.submit();
}

//Registration.asp Page
function RegCheck()
{
	var x=document.frm;
	
    if (x.fname.value=="")
	{
		alert("Enter First Name");
		x.fname.focus();
		return(false);
	}
	if (x.lname.value=="")
	{
		alert("Enter Last Name Should not be Blank");
		x.lname.focus();
		return(false);
	}

	if (x.userid.value=="")
	{
		alert("Choose a User Name");
		x.userid.focus();
		return(false);
	}
	if (x.userid.value.length<4 || x.userid.value.length>12)
	{
		alert("User Name should be from 4 to 12 characters");
		x.userid.focus();
		return(false);
	}

	if (isProper(x.userid.value)==false)
	{	alert("Please enter a valid alphanumeric username");x.userid.focus();	return(false);	}

	if (x.password.value=="")
	{
		alert("Enter Password");
		x.password.focus();
		return(false);
	}
	if (x.password.value.length<4 || x.password.value.length>10)
	{
		alert("Password should be between 4 to 10 characters");
		x.password.focus();
		return(false);
	}
	
	if (isProper(x.password.value)==false)
	{	alert("Please enter a valid alphanumeric password"); x.password.focus();	return(false);	}

	if (x.cpassword.value=="")
	{
		alert("Enter Confirm Password");
		x.cpassword.focus();
		return(false);
	}
	if (x.cpassword.value!=x.password.value)
	{
		alert("Password Entries are not Matching");
		x.cpassword.focus();
		return(false);
	}

	if (x.day.value==0)
	{
		alert("Select a valid Day");
		x.day.focus();
		return(false);
	}
	if (x.month.value==0)
	{
		alert("Select a valid Month");
		x.month.focus();
		return(false);
	}
	if (x.year.value==0)
	{	
		alert("Select a valid Year");
		x.year.focus();
		return(false);
	}
	if (isDate(x.month.value+"/"+x.day.value+"/"+x.year.value)==false)
	{
	 alert("Enter Valid Date")
	 return(false);
	}
	if (x.gender.value=="select")
	{
		alert("Select your Gender");
		x.gender.focus();
		return(false);
	}
	
	if (x.mstatus.value=="select")
	{
		alert("Select Your Marital Status");
		x.mstatus.focus();
		return(false);
	}

	if (x.email.value=="")
	{
		alert("Enter your primary Email");
		x.email.focus();
		return(false);
	}
	if (x.email.value!="" && echeck(x.email.value)==false)
	{
		alert("Invalid Email");
		x.email.focus();
		return(false);
	}
	if (x.altemail.value!="" && echeck(x.altemail.value)==false)
	{
		alert("Invalid Alternative Email");
		x.email.focus();
		return(false);
	}

	if (x.pphone.value=="")
	{
		alert("Select your primary phone");
		x.pphone.focus();
		return(false);
	}	

	if (x.phone1.value=="")
	{
		alert("Enter Phone No.");
		x.phone1.focus();
		return(false);
	}
	/* if(isNaN(x.phone1.value)==true)
 		{
			alert("Please enter primary phone number as numerical");
			x.phone1.focus();
			x.phone1.value="";
			return false;
   		} */
	
	if (x.address.value=="")
	{
		alert("Enter Address");
		x.address.focus();
		return(false);
	}

	if (x.address.value.length >250)
	{
		alert("Address cannot be more thant 250 characters in length");
		x.address.focus();
		return(false);
	}

	if (x.city.value=="")
	{
		alert("Enter City/Town");
		x.city.focus();
		return(false);
	}
	
	if (x.country.value=="0")
	{
		alert("Select Country");
		x.country.focus();
		return(false);
	}
	
	if (x.state.value=="0")
	{
		alert("Select State");
		x.state.focus();
		return(false);
	}

	if (x.district.value=="0")
	{
		alert("Select your District");
		x.district.focus();
		return(false);
	}
	
	if (x.district.value=="Other" && x.OtherDistrict.value=="")
	{
		alert("Enter District");
		x.OtherDistrict.focus();
		return(false);
	}

	if (x.pincode.value=="")
	{
		alert("Enter Pincode");
		x.pincode.focus();
		return(false);
	}
	
if (isNaN(x.pincode.value))
	{
		alert("Enter Numeric Pincode");
		x.pincode.focus();
		return(false);
	}

}

function RegisCheck()
{
	var x=document.frm;
	
//    if (x.fname.value=="")
//	{
//		alert("Enter First Name");
//		x.fname.focus();
//		return(false);
//	}
//	if (x.lname.value=="")
//	{
//		alert("Enter Last Name");
//		x.lname.focus();
//		return(false);
//	}
	if (x.day.value==0)
	{
		alert("Select a valid Day");
		x.day.focus();
		return(false);
	}
	if (x.month.value==0)
	{
		alert("Select a valid Month");
		x.month.focus();
		return(false);
	}
	if (x.year.value==0)
	{	
		alert("Enter a valid Year");
		x.year.focus();
		return(false);
	}

	//if (x.email.value=="")
//	{
//		alert("Enter your primary Email");
//		x.email.focus();
//		return(false);
//	}
//	
//	if (x.email.value!="" && echeck(x.email.value)==false)
//	{
//		alert("Invalid Email");
//		x.email.focus();
//		return(false);
//	}
	//if (x.altemail.value!="" && echeck(x.altemail.value)==false)
//	{
//		alert("Invalid Alternative Email");
//		x.altemail.focus();
//		return(false);
//	}

	if (x.pphone.value=="")
	{
		alert("Select your primary phone");
		x.pphone.focus();
		return(false);
	}	

	if (x.phone1.value=="")
	{
		alert("Enter Phone Number");
		x.phone1.focus();
		return(false);
	}
/*	
	if(isNaN(x.phone1.value)==true)
 	{
		alert("Enter Valid Phone Number");
		x.phone1.focus();
		x.phone1.value="";
		return false;
   	} 

	if(isNaN(x.phone2.value)==true)
 	{
		alert("Enter Valid Phone Number");
		x.phone2.focus();
		x.phone2.value="";
		return false;
   	} 
*/	
	if (x.address.value=="")
	{
		alert("Enter Address");
		x.address.focus();
		return(false);
	}

	if (x.address.value.length >250)
	{
		alert("Address cannot be more thant 250 characters in length");
		x.address.focus();
		return(false);
	}

	if (x.city.value=="")
	{
		alert("Enter City/Town");
		x.city.focus();
		return(false);
	}
	
	if (x.pincode.value=="")
	{
		alert("Enter Pincode");
		x.pincode.focus();
		return(false);
	}
	
	if (isNaN(x.pincode.value))
	{
		alert("Enter Numeric Pincode");
		x.pincode.focus();
		return(false);
	}
	
	if (x.country.value=="0")
	{
		alert("Select Country");
		x.country.focus();
		return(false);
	}
	
	if (x.state.value=="0")
	{
		alert("Select State");
		x.state.focus();
		return(false);
	}

	if (x.district.value=="0")
	{
		alert("Select your District");
		x.district.focus();
		return(false);
	}
	
	if (x.district.value=="Other" && x.OtherDistrict.value=="")
	{
		alert("Enter District");
		x.OtherDistrict.focus();
		return(false);
	}

}

//Qualification Details
function QualiCheck()
{
	var x=document.frm1;

	if (x.hdegree1.value==0)
	{
		alert("Select Your Highest Qualification");
		x.hdegree1.focus();
		return(false);
	}

	if (x.hmajor1.value==0)
	{
		alert("Select Specialisation/Major");
		x.hmajor1.focus();
		return(false);
	}

	if (x.university1.value=="")
	{
		alert("Enter Board/University Name");
		x.university1.focus();
		return(false);
	}
	if (x.pyear1.value=="")
	{
		alert("Enter Passing Year");
		x.pyear1.focus();
		return(false);
	}
	if (isNaN(x.pyear1.value))
	{
		alert("Enter Numeric Year");
		x.pyear1.focus();
		return(false);
	}

	if (x.hdegree2.value!=0 && x.hmajor2.value==0)
	{
		alert("Select Your IInd Level Specialisation/Major");
		x.hmajor2.focus();
		return(false);
	}

	if (x.hdegree2.value!=0 && x.hmajor2.value!=0 && x.university2.value=="")
	{
		alert("Enter Board/University Name");
		x.hmajor2.focus();
		return(false);
	}

	if (x.pyear2.value!="" && isNaN(x.pyear2.value))
	{
		alert("Enter Numeric Year");
		x.pyear2.focus();
		return(false);
	}
	
	if(x.Qadd.value.length>500)
	{
		alert("Additional Qualification cannot be Exceeds 500 Characters");
		x.Qadd.focus();
		return false;
	}
	if (x.skills.value=="")
	{
		alert("Enter Your Key Skills");
		x.skills.focus();
		return(false);
	}
	
	if (x.language1.value=="")
	{
		alert("Enter Language Known");
		x.language1.focus();
		return(false);
	}

	if (x.langr1.checked==false && x.langw1.checked==false && x.langs1.checked==false)
	{
		alert("Select Your Language Proficiency");
		x.langr1.focus();
		return(false);
	}

	if (x.passportno.value!="" && x.dateexpiry.value=="")
	{
		alert("Enter Passport Expiry Date");
		x.dateexpiry.focus();
		return(false);
	}
	
	if (x.drivingno.value!="")
	{
		if(x.issuedby.value=="")
        {
		alert("Enter Driving Licence Issued Place");
		x.issuedby.focus();
		return(false);
		}

		if (x.validity.value=="")
		{
		alert("Enter Licence Validity Date");
		x.validity.focus();
		return(false);
		}

		if(x.Ltype.value=="0")
        {
		alert("Select Licence Type");
		x.Ltype.focus();
		return(false);
		}
	}
}

//Work Experience Details
function trim(str) 
{
	return str.replace(/^\s+|\s+$/g,"");
}
function CheckTargetJob()
{
	var x=document.frm;

	if(x.agree.checked==false)
	{
		alert("Please Accept the Terms and Conditions");
		x.agree.focus();
		return false
	}
	if (trim(x.RTitle.value)=="")
	{
		alert("Enter Resume Title");
		x.RTitle.focus();
		return(false);
	}

	if (x.JobCat1.value==0) 
	{
		alert("Select Your Job Category");
		x.JobCat1.focus();
		return(false);
	}

	if (x.RoleCat1.value==0) 
	{
		alert("Specify Job Specialisation");
		x.RoleCat1.focus();
		return(false);
	}

	if(x.JobCat1.value==x.JobCat2.value && x.RoleCat1.value==x.RoleCat2.value)
	{
		alert("Both Sub Category 1 and 2 are same !");
		x.RoleCat2.focus();
		return(false);
	}

	if (x.JobType.value=="")
	{
		alert("Select Job Type");
		x.JobType.focus();
		return(false);
	}
	
	if (x.JobLocation.value=="")
	{
		alert("Select Job Location");
		x.JobLocation.focus();
		return(false);
	}

	if (x.SalaryType.value=="0")
	{
		alert("Select Salary Type");
		x.SalaryType.focus();
		return(false);
	}
	if (x.ExpSalary.value=="0")
	{
		alert("Select Your Expected Salary Range");
		x.ExpSalary.focus();
		return(false);
	}

	
	
	if (x.Cstatus.value=="")
		{
			alert("Select your Current Status");
			x.Cstatus.focus();
			return(false);
		}
		/*if (x.EName1.value=="")
		{
			alert("Enter Employer Name");
			x.EName1.focus();
			return(false);
		}
		if (x.Position1.value=="")
		{
			alert("Enter Designation");
			x.Position1.focus();
			return(false);
		}*/

	if(x.CLevel.value=="")
	{
		alert("Specify your Career Level");
		x.CLevel.focus();
		return(false);
	}

	if (x.JProfile1.value.length>1000)
	{
		alert("Job Profile cannot be Exceeds 1000 characters");
		x.JProfile1.focus();
		return(false);
	}
	if (x.JProfile2.value.length>1000)
	{
		alert("Job Profile cannot be Exceeds 1000 characters");
		x.JProfile2.focus();
		return(false);
	}
	

}


//Job Order Status
function JobOrdStatusCheck()
{
	var strDate1;
	var strDate2;
	var mMonth,mMonth1;
	if (document.frm.D1.value==0 )
	{
	 	alert("Select a Client");
	 	document.frm.D1.focus();
	 	return(false);
	}
	if (document.frm.MM.value<=9)
	{
		mMonth="0" + document.frm.MM.value;
	}
	else
	{
		mMonth=document.frm.MM.value;
	}
	if (document.frm.MM1.value<=9)
	{
		mMonth1="0" + document.frm.MM1.value;
	}
	else
	{
		mMonth1=document.frm.MM1.value;
	}
	strDate1=document.frm.DD.value+"/"+mMonth+"/"+document.frm.YY.value;
	strDate2=document.frm.DD1.value+"/"+mMonth1+"/"+document.frm.YY1.value;
	if (document.frm.DD.value!=0 && document.frm.MM.value && document.frm.YY.value )
	{
		if(DateValidation(strDate1)==false)
		//if (!correct)
		{
			alert("Invalid Date Format");
			document.frm.DD.focus();
			return (false);
		}
	}
	if (document.frm.DD1.value!=0 && document.frm.MM1.value && document.frm.YY1.value)
	{
		DateValidation(strDate2)
		if (!correct)
		{
			alert("Invalid Date Format");
			document.frm.DD1.focus();
			return (false);
		}
	}
	return true;
}


//date validation
 function DateValidation(Dt)
{	
	var dt1=Dt;
	correct=true;
	if ((dt1.charAt(2)!="/") && (dt1.charAt(5)!="/"))
	{
		correct=false;
	}
	var Day=dt1.substr(0,2);
	if (isNaN(Day))
	{
		correct=false;
	}	
	var Month=dt1.substr(3,2);
	if (isNaN(Month))
	{
		correct=false;
	}
	var Year=dt1.substr(6,4);
	if (isNaN(Year))
	{
		correct=false;
	}
	if(Day>31)
    {
		correct=false;
	}
	if (Month>12)
	{
		correct=false;
	}   
	if (Day==31 && ((Month==4)||(Month==6)||(Month==9)||(Month==11)))
	{
		correct=false;
	}
	if (Day==30 && Month==2)
	{
		correct=false;
	}
	if (Day==29 && Month==2 && Year%4!=0)
	{	
		correct=false;
	}
}



//function for  email validation
function echeck(str) 
	{

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1 || str.indexOf(",")!=-1 || str.indexOf(";")!=-1)
		 {
		    //alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}
//function for checking single quotes
function singlequotes(str)
{   at=str.indexOf("'");
	if (at!=-1)
	{
		alert("Not allowed quotes(')");
		return false;
	}
	return true;
}



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++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}

function isDate(dtStr){
   	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strMonth=dtStr.substring(0,pos1)
	var strDay=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
	
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		return false
	}
return true
}


function checkAll(field)
{
	// for un-n-checking all the check boxes
	var flag=0;
	if(window.document.frm.chkAll.checked==true)
	{
		for (i = 0; i < field.length; i++)
		{
			field[i].checked = true ;
			flag++;
		}
		if (flag==0)
		{
			field.checked=true;
		}
		return false;
	}
	else
	{
		for (i = 0; i < field.length; i++)
		{
			field[i].checked = false ;
			flag++;
		}
		if (flag==0)
		{
			field.checked=false;
		}
		return false;
	}

	return true;
}

function select_one_checkbox() 
{ 
 var flag=0;
    // loop through all elements
    for (i=0; i<document.frm.length; i++) 
    {
      // Look for our checkboxes only
        if (document.frm.elements[i].name.indexOf('chkAll')==-1) 
        { //alert("Look for our checkboxes only")
            // If any are checked then confirm alert, otherwise nothing happens
            if(document.frm.elements[i].checked) 
            {		//alert("If any are checked then confirm alert, otherwise nothing happens")
                flag++;
                //return confirm ('Are you sure you want to copy your selection(s)?')
            }
        }
   }
   if(flag==0)
	{
    	return false;
	}
}

function send_interview_calls()
{
	if(select_one_checkbox()==false)
	{
		alert ('Select at least one resume');
		return false;
	}

	var chk="";
	
	var cbCollection = document.forms['frm'].elements['chkID'];
	var IDs="";
	
	var flag=0;

	for ( var i = 0; i < cbCollection.length; i++ )
	{
		if ( cbCollection[i].checked ) 
		{
			//alert(cbCollection[i].value);
			flag++;
			IDs=IDs + cbCollection[i].value + ",";	//alert( "Checkbox " + i + " is checked!" );
		}
	}

	if (flag==0)
	{
		IDs=frm.chkID.value + ",";
	}
	
	//alert(IDs);
	
	var URL="http://www.jobsomega.com/client/interview-calls.asp?IDs=" + IDs;
	

	window.open(URL,"_blank","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=600,height=500,top=75,left=300");
}

function send_interview_calls_consult()
{
	if(select_one_checkbox()==false)
	{
		alert ('Select at least one resume');
		return false;
	}

	var chk="";
	
	var cbCollection = document.forms['frm'].elements['chkID'];
	var IDs="";
	
	var flag=0;

	for ( var i = 0; i < cbCollection.length; i++ )
	{
		if ( cbCollection[i].checked ) 
		{
			//alert(cbCollection[i].value);
			flag++;
			IDs=IDs + cbCollection[i].value + ",";	//alert( "Checkbox " + i + " is checked!" );
		}
	}

	if (flag==0)
	{
		IDs=frm.chkID.value + ",";
	}
	
	//alert(IDs);
	
	var URL="http://www.jobsomega.com/consultancy/interview-calls1.asp?IDs=" + IDs;
	

	window.open(URL,"_blank","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=600,height=500,top=75,left=300");
}

function download_resume()
{
	if(select_one_checkbox()==false)
	{
		alert ('Select at least one resume');
		return false;
	}

	var chk="";
	
	var cbCollection = document.forms['frm'].elements['chkID'];
	var IDs="";
	
	var flag=0;

	for ( var i = 0; i < cbCollection.length; i++ )
	{
		if ( cbCollection[i].checked ) 
		{
			//alert(cbCollection[i].value);
			flag++;
			IDs=IDs + cbCollection[i].value + ",";	//alert( "Checkbox " + i + " is checked!" );
		}
	}

	if (flag==0)
	{
		IDs=frm.chkID.value + ",";
	}
	
	//alert(IDs);
	
	var URL="http://www.jobsomega.com/consultancy/download_cv.asp?IDs=" + IDs;
	

	window.open(URL,"_blank","toolbar=no,location=no,directories=no,status=yes,menubar=no,scrollbars=yes,resizable=yes,width=600,height=500,top=75,left=300");
}

function showphone()
{
	var phtyp=document.getElementById("ptyp").value;	
	if(phtyp==0)
	{
		document.getElementById('divland').style.display="none";
		document.getElementById('divmob').style.display="none";
		alert("Kindly select phone type");
	}
	else if(phtyp==1)
	{
		document.getElementById('divland').style.display="block";
		document.getElementById('divmob').style.display="none";
	}
	else if(phtyp==2)
	{
		document.getElementById('divland').style.display="none";
		document.getElementById('divmob').style.display="block";
	}
}

function showphone2()
{
	var phtyp=document.getElementById("ptyp2").value;	
	if(phtyp==0)
	{
		document.getElementById('divland2').style.display="none";
		document.getElementById('divmob2').style.display="none";
		alert("Kindly select phone type");
	}
	else if(phtyp==1)
	{
		document.getElementById('divland2').style.display="block";
		document.getElementById('divmob2').style.display="none";
	}
	else if(phtyp==2)
	{
		document.getElementById('divland2').style.display="none";
		document.getElementById('divmob2').style.display="block";
	}
}
