// JavaScript Document
function cvvalid(){
	if(document.getElementById('fname').value==''){
		document.getElementById('fnameerror').innerHTML=" Enter the First Name";
		document.getElementById('fname').focus();
		return false;
	}
	if(document.getElementById('lname').value==''){
		document.getElementById('lnameerror').innerHTML="Enter the Last Name";
		document.getElementById('lname').focus();
		return false;
	}
	if(document.getElementById('phone').value==''){
		document.getElementById('phoneerror').innerHTML="Enter the Phone Number";
		document.getElementById('phone').focus();
		return false;
	}
	if(document.getElementById('email').value==''){
		document.getElementById('emailerror').innerHTML="Enter the Email Id ";
		document.getElementById('email').focus();
		return false;
	}
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
  	var address = document.getElementById('email').value;
  	if(reg.test(address) == false) {
 	document.getElementById('emailerror').innerHTML="Invalid Email Id ";
	document.getElementById('email').focus();
 	return false;
   }
  // if(document.getElementById('resume').value!='')
	//{
	//if (!/(\.(doc|docx|pdf))$/i.test(document.getElementById('resume').value))
	//{
		//document.getElementById('cverror').innerHTML="Please Select doc|docx|pdf Format only...!";
		//document.getElementById('resume').focus();
		//return false;	
	//}
	//}
	if(document.getElementById('security_code').value==''){
		document.getElementById('secerror').innerHTML="Enter Security Code";
		document.getElementById('security_code').focus();
		return false;
	}
}

//location

//end location

//ask the question
function askvalid(){
	if(document.getElementById('yourname').value==''){
		document.getElementById('nameerror').innerHTML=" Enter Your Name";
		document.getElementById('yourname').focus();
		return false;
	}	
	if(document.getElementById('youremail').value==''){
		document.getElementById('emailerror').innerHTML="Enter the Email Id ";
		document.getElementById('youremail').focus();
		return false;
	}
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
  	var address = document.getElementById('youremail').value;
  	if(reg.test(address) == false) {
 	document.getElementById('emailerror').innerHTML="Invalid Email Id ";
	document.getElementById('youremail').focus();
 	return false;
   }
   if(document.getElementById('askquestion').value==''){
		document.getElementById('askerror').innerHTML=" Enter Your Question";
		document.getElementById('askquestion').focus();
		return false;
	}
}
//end ask

//contact us
function convalid(){
	if(document.getElementById('yourname').value==''){
		document.getElementById('yournameerror').innerHTML=" Enter Your Name";
		document.getElementById('yourname').focus();
		return false;
	}
	if(document.getElementById('comname').value==''){
		document.getElementById('comnameerror').innerHTML="Enter Your Company Name";
		document.getElementById('comname').focus();
		return false;
	}
	if(document.getElementById('youremail').value==''){
		document.getElementById('emailiderror').innerHTML="Enter the Email Id ";
		document.getElementById('youremail').focus();
		return false;
	}
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
  	var address = document.getElementById('youremail').value;
  	if(reg.test(address) == false) {
 	document.getElementById('emailiderror').innerHTML="Invalid Email Id ";
	document.getElementById('youremail').focus();
 	return false;
   }
   if(document.getElementById('contactno').value==''){
		document.getElementById('connoerror').innerHTML="Enter the Contact Number";
		document.getElementById('contactno').focus();
		return false;
	}
   if(document.getElementById('askquestion').value==''){
		document.getElementById('askerror').innerHTML="Enter Your Queries";
		document.getElementById('askquestion').focus();
		return false;
	}
	if(document.getElementById('security_code').value==''){
		document.getElementById('secerror').innerHTML="Enter Security Code";
		document.getElementById('security_code').focus();
		return false;
	}
}
//end contact

//jobspecification

function jobvalid(){
	if(document.getElementById('emailid').value==''){
		document.getElementById('emailerror').innerHTML="Enter the Email Id ";
		document.getElementById('emailid').focus();
		return false;
	}
	var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
  	var address = document.getElementById('emailid').value;
  	if(reg.test(address) == false) {
 	document.getElementById('emailerror').innerHTML="Invalid Email Id ";
	document.getElementById('emailid').focus();
 	return false;
   }
   if(document.getElementById('jobtitle').value==''){
		document.getElementById('joberror').innerHTML="Enter the Job Title ";
		document.getElementById('jobtitle').focus();
		return false;
	}
	if(document.getElementById('location').value==''){
		document.getElementById('locationerror').innerHTML="Enter the Location ";
		document.getElementById('location').focus();
		return false;
	}
	if(document.getElementById('salary').value==''){
		document.getElementById('salaryerror').innerHTML="Enter the Salary Details ";
		document.getElementById('salary').focus();
		return false;
	}
	/*if(document.getElementById('attachfiles').value!='')
	{
	if (!/(\.(doc|docx|pdf))$/i.test(document.getElementById('attachfiles').value))
	{
		document.getElementById('cverror').innerHTML="Please Select doc|docx|pdf Format only...!";
		document.getElementById('attachfiles').focus();
		return false;	
	}
	}*/
	if(document.getElementById('security_code').value==''){
		document.getElementById('secerror').innerHTML="Enter Security Code";
		document.getElementById('security_code').focus();
		return false;
	}
	
}
function numbersonly(e){
var unicode=e.charCode? e.charCode : e.keyCode
if (unicode!=8){ //if the key isn't the backspace key (which we should allow)
if (unicode<48||unicode>57) //if not a number
return false //disable key press
}
}
//end job
