function doSubmit()
{
if (document.frmCareer.tbName.value=="") 
{
alert("Enter Name")
document.frmCareer.tbName.focus();
return false;
}


if (document.frmCareer.tbEmail.value=="")
{
 alert("Enter E-Mail Address")
 document.frmCareer.tbEmail.focus();
return false;
}

	var email=document.frmCareer.tbEmail.value;
        	elen= email.length;
        	efirstchar = email.substring(0, 1);
	elastchar  = email.substring(elen-1, elen);

	atPos = email.indexOf("@",1)	
	if (atPos == -1) 
	{
		alert("Please Enter Valid Email Id");
		document.frmCareer.tbEmail.focus();
		document.frmCareer.tbEmail.select();
							return false;
	}
	
	periodPos = email.indexOf(".",atPos)
	if (periodPos == -1) 
	{	
	alert("Please Enter Valid Email Id");
		document.frmCareer.tbEmail.focus();
		document.frmCareer.tbEmail.select();
							return false;
	}
	
	
	if (periodPos+3 > elen)	
	{ alert("Please Enter Valid Email Id");
		document.frmCareer.tbEmail.focus();
		document.frmCareer.tbEmail.select();
							return false;
	}
	
	if (email.indexOf("..",1) != -1)
	 {
	alert("Please Enter Valid Email Id");
		document.frmCareer.tbEmail.focus();
		document.frmCareer.tbEmail.select();
						return false;
	}
	
	if (email.indexOf("@.",1) != -1) {
	alert("Please Enter Valid Email Id");
		document.frmCareer.tbEmail.focus();
		document.frmCareer.tbEmail.select();
							return 0
	}
	
	if (email.indexOf(".@",1) != -1)
	 {
	 alert("Please Enter Valid Email Id");
		document.frmCareer.tbEmail.focus();
		document.frmCareer.tbEmail.select();
							return false;
	}
	if (email.indexOf("-@",1) != -1)
	 {
	 alert("Please Enter Valid Email Id");
		document.frmCareer.tbEmail.focus();
		document.frmCareer.tbEmail.select();
				return false;
	}
	if (email.indexOf("@-",1) != -1)
	 {
	 alert("Please Enter Valid Email Id");
		document.frmCareer.tbEmail.focus();
		document.frmCareer.tbEmail.select();
							return 0
	}
	
	if (email.indexOf("-.",1) != -1)
	 {
	 alert("Please Enter Valid Email Id");
		document.frmCareer.tbEmail.focus();
		document.frmCareer.tbEmail.select();
				   return false;
	}
	if (email.indexOf(".-",1) != -1)
	 {
	 alert("Please Enter Valid Email Id");
		document.frmCareer.tbEmail.focus();
		document.frmCareer.tbEmail.select();
				return 0
	}
	if (email.indexOf("--",1) != -1)
	 {
	 alert("Please Enter Valid Email Id");
		document.frmCareer.tbEmail.focus();
		document.frmCareer.tbEmail.select();
				   return false;
	}        
	if((efirstchar<"a" || efirstchar>"z") && (efirstchar<"A" || efirstchar>"Z"))
	{
	alert("Please Enter Valid Email Id");
		document.frmCareer.tbEmail.focus();
		document.frmCareer.tbEmail.select();
				   return false;
	}

	
//else if (document.frmCareer.tbEmail.value!="")  {
 
//return subEmail(document.frmCareer.tbEmail.value);
// document.frmCareer.tbEmail.focus();
//}

if (document.frmCareer.tbSubject.value =="") {
alert("Enter Subject")
document.frmCareer.tbSubject.focus();
return false;

}
if (document.frmCareer.tbMessage.value =="") {
alert("Enter Message")
document.frmCareer.tbMessage.focus();
return false;
}
var filePath=document.frmCareer.tbfileFilePath.value;
if (filePath=="")
{
alert("Select the File")
document.frmCareer.tbfileFilePath.focus();
return false;
}

var arryFP=filePath.split(".");
var XXX=arryFP[1];
if (XXX=='txt' || XXX=='doc' || XXX=='pdf' || XXX=='docx')
{
}
else
{
 alert("upload the correct file");
 document.frmCareer.tbfileFilePath.focus();
return false;
}
document.frmCareer.action="Apply_online_handler.asp";
document.frmCareer.submit();
/*document.frmCareer.action="apply-online.asp?done=1";
document.frmCareer.submit();*/
}
