function checkm(id) {
	if (!document.formn.username.value.length) {
	   alert("You must enter ID");
	   document.formn.username.focus();
	   return false;
	}
	if(id!='edit'){
		if (!document.formn.pwd.value.length) {
		   alert("Please Specify the Password");
		   document.formn.pwd.focus();
		   return false;
		}
		if (!document.formn.rpwd.value.length) {
		   alert("Please Re-confirm Password");
		   document.formn.rpwd.focus();
		   return false;
		}
		if (document.formn.pwd.value != document.formn.rpwd.value) {
		  alert("Password and Re-entered passwords should be same");
		  document.formn.rpwd.focus();
		  return false;
		}
	}
	if (!document.formn.email.value.length) {
	   alert("E-mail cannot be left blank");
	   document.formn.email.focus();
	   return false;
	}
	var re_mail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z])+$/;
	if (!re_mail.test(document.formn.email.value))	{
			alert( "Enter Your Email-id correctly" );
			document.formn.email.focus();
			return false;
	}	
	if (!document.formn.fname.value.length) {
	   alert("First Name cannot be left blank");
	   document.formn.fname.focus();
	   return false;
	}
	if (document.formn.nationality.options[document.formn.nationality.selectedIndex].value == '') {
	   alert("Please select your nationality");
	   document.formn.nationality.focus();
	   return false;
	}
	if (document.formn.day.options[document.formn.day.selectedIndex].value == '') {
	   alert("Date of Birth can not be left blank");
	   document.formn.day.focus();
	   return false;
	}
	if (document.formn.month.options[document.formn.month.selectedIndex].value == '') {
	   alert("Date of Birth can not be left blank");
	   document.formn.month.focus();
	   return false;
	}
	if (document.formn.year.options[document.formn.year.selectedIndex].value == '') {
	   alert("Date of Birth can not be left blank");
	   document.formn.year.focus();
	   return false;
	}
	/*if (!document.formn.dob.value.length) {
	   alert("Date of Birth can't be left blank");
	   document.formn.dob.focus();
	   return false;
	}*/
	
}
function checkcv(id) {
	if (document.formn.job_category.options[document.formn.job_category.selectedIndex].value == '') {
	   alert("Please select job category");
	   document.formn.job_category.focus();
	   return false;
	}
	if (!document.formn.exp.value.length) {
	   alert("Experience cannot be left blank");
	   document.formn.exp.focus();
	   return false;
	}
}
function checke(id) {
	if (!document.formn.username.value.length) {
	   alert("You must enter ID");
	   document.formn.username.focus();
	   return false;
	}
	if(id!='edit'){
		if (!document.formn.pwd.value.length) {
		   alert("Please Specify the Password");
		   document.formn.pwd.focus();
		   return false;
		}
		if (!document.formn.rpwd.value.length) {
		   alert("Please Re-confirm Password");
		   document.formn.rpwd.focus();
		   return false;
		}
		if (document.formn.pwd.value != document.formn.rpwd.value) {
		  alert("Password and Re-entered passwords should be same");
		  document.formn.rpwd.focus();
		  return false;
		}
	}
	
	if (!document.formn.company_full.value.length) {
	   alert("Please Enter company full name");
	   document.formn.company_full.focus();
	   return false;
	}
	if (!document.formn.email.value.length) {
	   alert("E-mail can not be left blank");
	   document.formn.email.focus();
	   return false;
	}
	var re_mail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z])+$/;
	if (!re_mail.test(document.formn.email.value))	{
			alert( "Enter Your Email-id correctly" );
			document.formn.email.focus();
			return false;
	}
	if (document.formn.country.options[document.formn.country.selectedIndex].value == '') {
	   alert("Please select your country");
	   document.formn.country.focus();
	   return false;
	}

}


function checkjob(){
	if (!document.formn.title.value.length) {
	   alert("You must enter title of the job");
	   document.formn.title.focus();
	   return false;
	}
	if (document.formn.category.options[document.formn.category.selectedIndex].value == '') {
	   alert("Please select job category");
	   document.formn.category.focus();
	   return false;
	}
	if (document.formn.qualification.options[document.formn.qualification.selectedIndex].value == '') {
	   alert("Please select qualification required");
	   document.formn.qualification.focus();
	   return false;
	}
	if (document.formn.job_type.options[document.formn.job_type.selectedIndex].value == '') {
	   alert("Please select job type");
	   document.formn.job_type.focus();
	   return false;
	}
	if(document.formn.job_id.value==""){
		if(document.formn.job_type.options[document.formn.job_type.selectedIndex].value == 'HOT Job'){
			var lim=document.formn.hotPoints.value;
			c=confirm(lim);
			if(c==true)
				return true;
			else
				return false;
		}else{
			c1=confirm("You will expense 1 points if you select Regular Job. Are you sure you want to post job in regular Jobs?");
			if(c1==true)
				return true;
			else
				return false;
		
		}
	}
	if(document.formn.job_id.value!=""){
		if(document.formn.job_type.options[document.formn.job_type.selectedIndex].value == 'HOT Job' && document.formn.prev_jobtype.value=='Regular'){
			var lim=document.formn.hotPoints2.value;;
			c=confirm(lim);
		}
		if(c==true)
				return true;
		else
			return false;
	}
}

function checksearch(){
if (document.search.keyword.value=="Type your keyword here ..." || document.search.keyword.value=="") {
	   alert("You must enter a keyword for a search");
	   document.search.keyword.focus();
	   return false;
}

}

function chkselect(val , val1){
	var count,c;
	var str=eval('document.'+val1);
	
	count=eval('document.'+val1+'.elements.length');
	c=0;
	for (i=0; i < count; i++){
		if(str.elements[i].name == 'chk[]'){
			if(str.elements[i].checked == 1){
				c = 1;
			}
		}
	}
	if(c == 0){
		alert(''+val);
		return false;
	}
}
function CheckAll(){
		var frm=document.formn;
		var count = frm.elements.length;
		for (i=0; i < count; i++){
			if(frm.elements[i].type=="checkbox"){
				if(frm.elements[i].checked == 0){
					frm.elements[i].checked = 1;
					document.getElementById('check').innerHTML="Uncheck all";
					document.getElementById('check2').innerHTML="Uncheck all";
				}else{
					frm.elements[i].checked = 0;
					document.getElementById('check').innerHTML="Check all";
					document.getElementById('check2').innerHTML="Check all";
				}
			}
		}
	}
	
function checkskills(f1){
	if (!f1.skill.value.length) {
	   alert("You must enter skill");
	   f1.skill.focus();
	   return false;
	}
	/*if (!f1.duration.value.length) {
	   alert("You must enter duration");
	   f1.duration.focus();
	   return false;
	}*/
	if (f1.level.options[f1.level.selectedIndex].value == '') {
	   alert("Please select skill level");
	   f1.level.focus();
	   return false;
	}
	return true;

}
function checkslanguage(f1){
	if (f1.language.options[f1.language.selectedIndex].value == '') {
	   alert("Please select language");
	   f1.language.focus();
	   return false;
	}
	if (f1.level.options[f1.level.selectedIndex].value == '') {
	   alert("Please select level");
	   f1.level.focus();
	   return false;
	}
	return true;

}
function check_address(f1){
	
	if(!f1.mphone1.value.length && !f1.mphone3.value.length && !f1.hphone1.value.length && !f1.hphone2.value.length && !f1.hphone3.value.length){
	   alert("You Must Enter Mobile Or Home Phone");
	   f1.mphone1.focus();
	   return false;
	}
	if(f1.mphone1.value.length || f1.mphone3.value.length){
		if (!f1.mphone1.value.length) {
		   alert("You Must Enter Mobile Country Code");
		   f1.mphone1.focus();
		   return false;
		}
		if (isNaN(f1.mphone1.value)){
		   alert("Country Code must be numeric");
		   f1.mphone1.focus();
		   return false;
		}
		
		if (f1.mphone3.value=="") {
		   alert("You Must Enter Mobile number");
		   f1.mphone3.focus();
		   return false;
		}
		if (isNaN(f1.mphone3.value)){
		   alert("Mobile number must be numeric");
		   f1.mphone3.focus();
		   return false;
		}
	}
	if(f1.hphone1.value.length || f1.hphone2.value.length || f1.hphone3.value.length){
		if (!f1.hphone1.value.length) {
			   alert("You Must Enter Mobile Country Code");
			   f1.hphone1.focus();
			   return false;
			}
			if (isNaN(f1.hphone1.value)){
			   alert("Country Code must be numeric");
			   f1.hphone1.focus();
			   return false;
			}
			if (!f1.hphone2.value.length) {
			   alert("You Must Enter Mobile City Code");
			   f1.hphone2.focus();
			   return false;
			}
			if (isNaN(f1.hphone2.value)){
			   alert("City Code must be numeric");
			   f1.hphone2.focus();
			   return false;
			}
			if (!f1.hphone3.value.length) {
			   alert("You Must Enter Mobile number");
			   f1.hphone3.focus();
			   return false;
			}
			if (isNaN(f1.hphone3.value)){
			   alert("Mobile number must be numeric");
			   f1.hphone3.focus();
			   return false;
			}	
	}
	/*if (!f1.mphone2.value.length) {
	   alert("You Must Enter Mobile City Code");
	   f1.mphone2.focus();
	   return false;
	}
	if (isNaN(f1.mphone2.value)){
	   alert("City Code must be numeric");
	   f1.mphone2.focus();
	   return false;
	}*/
	
	/*if (!f1.city.value.length) {
	   alert("You Must Enter your city");
	   f1.city.focus();
	   return false;
	}*/
	if (f1.country.options[f1.country.selectedIndex].value == '') {
	   alert("Please select your country");
	   f1.country.focus();
	   return false;
	}

}
function check_position(f1){
 
	/*if (!f1.position.value.length) {
	   alert("You Must Enter your position sought");
	   f1.position.focus();
	   return false;
	}*/
	if (f1.category.options[f1.category.selectedIndex].value == '') {
	   alert("Please select job category");
	   f1.category.focus();
	   return false;
	}
	/*if (f1.job_family.options[f1.job_family.selectedIndex].value == '') {
	   alert("Please select job family");
	   f1.job_family.focus();
	   return false;
	}*/
	if (f1.emp_status.options[f1.emp_status.selectedIndex].value == '') {
	   alert("Please select employment Status sought");
	   f1.emp_status.focus();
	   return false;
	}
	if (f1.location1.options[f1.location1.selectedIndex].value == '') {
	   alert("Please select work location");
	   f1.location1.focus();
	   return false;
	}
	if (!f1.salary.value.length) {
	   alert("You Must Enter minimum salary required");
	   f1.salary.focus();
	   return false;
	}
}
function check_qualification(f1){
	if (f1.qualification.options[f1.qualification.selectedIndex].value == '') {
	   alert("Please select qualification");
	   f1.qualification.focus();
	   return false;
	}
	/*if (!f1.grade.value.length) {
	   alert("You Must Enter your grade");
	   f1.grade.focus();
	   return false;
	}*/
	if (!f1.major.value.length) {
	   alert("You Must Enter major");
	   f1.major.focus();
	   return false;
	}
	if (!f1.institution.value.length) {
	   alert("You Must Enter Institution");
	   f1.institution.focus();
	   return false;
	}

	if (f1.country.options[f1.country.selectedIndex].value == '') {
	   alert("Please select your country");
	   f1.country.focus();
	   return false;
	}
	if (!f1.cyear.value.length) {
	   alert("You Must Enter Completion Year");
	   f1.cyear.focus();
	   return false;
	}
	/*if (!f1.years.value.length) {
	   alert("You Must Enter duration");
	   f1.years.focus();
	   return false;
	}*/

}
function check_experience(f1){
	
	if (!f1.date_from.value.length) {
	   alert("You Must Enter Exp. Start Date");
	   f1.date_from.focus();
	   return false;
	}
	if (!f1.date_to.value.length && !f1.todate.checked) {
	   alert("You Must Enter Exp. End Date or check the checkbox for todate");
	   f1.date_to.focus();
	   return false;
	}
	if (f1.country.options[f1.country.selectedIndex].value == '') {
		   alert("Please select your country");
		   f1.country.focus();
		   return false;
	}
	if (!f1.organization.value.length) {
	   alert("You Must Enter Organization Name");
	   f1.organization.focus();
	   return false;
	}
	if (!f1.position.value.length) {
	   alert("You Must Enter Position Held");
	   f1.position.focus();
	   return false;
	}
}

function plan_chk(f1){
	var val="";
	var radioLength = f1.orderType.length;	
	for(var i = 0; i < radioLength; i++) {
		if(f1.orderType[i].checked) {
			val=f1.orderType[i].value;
		}
	}
	if(val==""){
		alert("Please Select plan.");
		return false;
	}
	return true;
}
function pay_method(f1){
	var val="";
	var radioLength = f1.payment_method.length;	
	for(var i = 0; i < radioLength; i++) {
		if(f1.payment_method[i].checked) {
			val=f1.payment_method[i].value;
		}
	}
	if(val==""){
		alert("Please Select payment mode.");
		return false;
	}
	return true;
}
function check_pwd(f1){
	
	if (!f1.pwd1.value.length) {
	   alert("You Must Enter Old Password");
	   f1.pwd1.focus();
	   return false;
	}
	if (!f1.pwd2.value.length) {
	   alert("You Must Enter New Password");
	   f1.pwd2.focus();
	   return false;
	}
	if (!f1.pwd3.value.length) {
	   alert("You Must Confirm New Password");
	   f1.pwd3.focus();
	   return false;
	}
	if (f1.pwd2.value != f1.pwd3.value) {
		  alert("New Password and Confirm passwords should be same");
		  f1.pwd2.focus();
		  return false;
	}
}
function check_forget(f1){
	if (!f1.userid.value.length) {
	   alert("You Must Enter User Id");
	   f1.userid.focus();
	   return false;
	}

}

function check_feedback(f1){
	if (!f1.fname.value.length) {
	   alert("You Must Enter your first name");
	   f1.fname.focus();
	   return false;
	}
	if (!f1.email.value.length) {
	   alert("E-mail can not be left blank");
	   f1.email.focus();
	   return false;
	}
	var re_mail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z])+$/;
	if (!re_mail.test(f1.email.value))	{
			alert( "Enter Your Email-id correctly" );
			f1.email.focus();
			return false;
	}
	if (f1.country.options[f1.country.selectedIndex].value == '') {
	   alert("Please select your country");
	   f1.country.focus();
	   return false;
	}
	if (!f1.requirement.value.length) {
	   alert("You Must Enter your comments");
	   f1.requirement.focus();
	   return false;
	}

}
function CheckAll_enquiry(){
		var frm=document.formn;
		var count = frm.elements.length;
		for (i=0; i < count; i++){
			if(frm.elements[i].type=="checkbox"){
				if(frm.elements[i].checked == 0){
					frm.elements[i].checked = 1;
					document.getElementById('ch').value="Uncheck all";
					
				}else{
					frm.elements[i].checked = 0;
					document.getElementById('ch').value="Check all";
				}
			}
		}
	}
function chksendmail(){
	count = document.formn.elements.length;
	var c=0;
	for (i=0; i < count; i++){
		if(document.formn.elements[i].checked == 1){
			c = 1;
		}
		
	}
	if(c == 0){
		alert('First, select the record');
		return false;
	}
	else{
		if(document.formn.subject.value == ""){
				alert('Please enter subject.');
				document.formn.subject.focus();
				return false;
		}
		/*if(document.formn.message.value == ""){
				alert('Please enter your message.');
				//document.formn.message.focus();
				return false;
		}*/
	}
}
function isNumberFloat(inputString)
{
  return (!isNaN(parseFloat(inputString))) ? true : false;
}
function validate_plan(f1){
	if(f1.plandetail.value == ""){
		alert('Please enter plan detail.');
		f1.plandetail.focus();
		return false;
	}
	if(f1.duration.value == ""){
		alert('Please enter plan duration.');
		f1.duration.focus();
		return false;
	}
	if(isNaN(f1.duration.value)){
		alert('Duration must be a number.');
		f1.duration.focus();
		return false;
	}
	if(f1.price.value == "" || f1.price.value == "0.00"){
		alert('Please enter price.');
		f1.price.focus();
		return false;
	}
	if(isNaN(parseFloat(f1.price.value))){
		alert('Price must be a number.');
		f1.price.focus();
		return false;
	}
	if(f1.joblimit.value == ""){
		alert('Please enter Job Limit.');
		f1.joblimit.focus();
		return false;
	}
	if(isNaN(f1.joblimit.value)){
		alert('Job Limit must be a number.');
		f1.joblimit.focus();
		return false;
	}
	if(f1.view_contacts.value == ""){
		alert('Please enter plan View Contact Limit.');
		f1.view_contacts.focus();
		return false;
	}
	if(isNaN(f1.view_contacts.value)){
		alert('View Contact must be a number.');
		f1.view_contacts.focus();
		return false;
	}
	if(f1.reminder.value == ""){
		alert('Please enter reminder.');
		f1.reminder.focus();
		return false;
	}
	if(isNaN(f1.reminder.value)){
		alert('Reminder must be a number.');
		f1.reminder.focus();
		return false;
	}
		
}