function validate(pt){
	
	if(!checkBlank(pt.name.value)){
		alert("Please enter name");
		pt.name.focus();
		return false;
	}
	
	if(!checkBlank(pt.lastName.value)){
		alert("Please enter Last Name");
		pt.lastName.focus();
		return false;
	}
	
	if(pt.id=="frmJobseekers"){
		if(!checkBlank(pt.designation.value)){
			alert("Please enter designation");
			pt.designation.focus();
			return false;
		}
	}
	
	if(!checkBlank(pt.phone.value)){
		alert("Please enter Mobile no.");
		pt.phone.focus();
		return false;
	}
	
	if(!isNumber(pt.phone.value)){
		alert("Please enter Valid Mobile no.");
		pt.phone.focus();
		return false;
	}
	
	if(pt.Lphone.value!=""){
		if(!isNumber(pt.Lphone.value)){
			alert("Please enter Valid Land line no.");
			pt.Lphone.focus();
			return false;
		}
	}
	
	if(!checkBlank(pt.email.value)){
		alert("Please enter E-mail");
		pt.email.focus();
		return false;
	}
	
	if(!validateEmail(pt.email.value)){
		pt.email.focus();
		return false;
	}
	
	if(pt.id=="frmJobseekers")
		var doc=document.frmJobseekers;
	else
	    var doc=document.frmJobReferances;
	
	var myindex=doc.areaOfWork.selectedIndex;
	if(myindex==0){
		alert("Please select area of work");
		pt.areaOfWork.focus();
		return false;
	}
	
	
	if(doc.areaOfWork.value=="Other"){
		if(doc.jobArea.value==""){
			alert("Please enter area of work");
			doc.jobArea.focus();
			return false;
		}
	}
		
	/*if(!checkBlank(pt.experience.value)){
		alert("Please enter total year of experience");
		pt.experience.focus();
		return false;
	}
	
	if(!isNumber(pt.experience.value)){
		alert("Please enter valid total year of experience");
		pt.experience.focus();
		return false;
	}*/
	
	var myindex=doc.company.selectedIndex;
	if(myindex==0){
		alert("Please select present company");
		pt.company.focus();
		return false;
	}
	
	if(doc.company.value=="Other"){
		if(doc.pcompany.value==""){
			alert("Please specify present company");
			doc.pcompany.focus();
			return false;
		}
	}
	
	
	if(!checkBlank(pt.cv.value)){
		alert("please select Resume to uplode");
		pt.cv.focus();
		return false;
	}
	
	if(pt.id=="frmJobseekers"){
		if(!pt.tc.checked){
			alert("Read the Terms and condition.");
			pt.tc.focus();
			return false;
		}
	}
}


/*function addElement(elmName){
	var docId=document.getElementById(elmName);
	if(docId.options[docId.selectedIndex].text=="Other")
		var flag=0;
	else
		var flag=1;
		
	if(flag==0){
		if(elmName=="areaOfWork")
			document.getElementById("workAreaLi").style.display="block";
		else if(elmName=="company")
			document.getElementById("compLi").style.display="block";
	}else{
		if(elmName=="areaOfWork")
			document.getElementById("workAreaLi").style.display="none";
		else if(elmName=="company")
			document.getElementById("compLi").style.display="none";
	}
}*/
function addElement(elmName,addto,name){
var docId=document.getElementById(elmName);
var textbox=document.getElementById(addto);
	if(docId.options[docId.selectedIndex].text=="Other"){
		textbox.style.display="block";
		var qty=document.createElement("input");
		qty.type="text";
		qty.value="";
		qty.name=name;
		qty.id=name;
		qty.className="name_area";
		textbox.appendChild(qty);
	}else{
		var elm = document.getElementById(name);
		if(elm){
			textbox.style.display="none";
			textbox.removeChild(elm);
		}
	}
}
