	function validate()
	 {
	
	if(document.frm.fname.value=="")
	{
	alert("Kindly fill First Name field!")
	document.frm.fname.focus()
	return false
	}
	
	if(document.frm.mname.value=="")
	{
	alert("Kindly fill Middle Name field!")
	document.frm.mname.focus()
	return false
	} 		
	
	if(document.frm.sname.value=="")
	{
	alert("Kindly fill Sur Name field!")
	document.frm.sname.focus()
	return false
	}
	 	
	str10 = document.frm.fname.value;
    for (var i = 0; i < str10.length; i++) {
		var ch = str10.substring(i, i + 1);
		if (ch == "0" || ch == "1" ||ch == "2" ||ch == "3" ||ch == "4" ||ch == "5" ||ch == "6" ||ch == "7" ||ch == "8" ||ch == "9") 
		{
		if(ch==" "){}
		else {
			alert("Kindly fill valid value for First Name field");
			document.frm.fname.focus();		
			document.frm.fname.select();		
			return false;
		}
		}
	}

	if(document.frm.address.value=="")
	{
	alert("Kindly fill Address field!")
	document.frm.address.focus()
	return false
	}
	
	str9 = document.frm.res_phone.value
	if (str9=="")
	{
	alert("Kindly fill Phone field!")
	document.frm.res_phone.focus()
	return false
	}
	else{
    for (var i = 0; i < str9.length; i++) {
		var ch = str9.substring(i, i + 1);
		if (ch < "0" || "9" < ch) 
		{
		if(ch==" "){}
		else {
			alert("\nThe Phone field only accepts integers.\n\nPlease re-enter your phone no..");
			document.frm.res_phone.focus();		
			document.frm.res_phone.select();		
			return false;
			}
		}
	}
	}
		
	ok=true
	if(document.frm.res_email.value=="")
	{
		alert("Please enter Email address.")
		document.frm.res_email.focus()
		ok=false
		return ok
	}
	else
	{
	
	var str =/[-a-zA-Z0-9_\.]+@[-a-zA-Z0-9]+\.[-a-zA-Z0-9\.]+/;
	var eflag = document.frm.res_email.value.match(str);
	if(eflag!=document.frm.res_email.value)
	{
		alert("Please enter a valid Email Address")
		document.frm.res_email.focus();
		document.frm.res_email.select();
		return false;
	}
	}

	
		
				 
	 /********** Validation for upload file******/
			 
str=document.frm.file.value
if(str=="")
{
alert("Please Upload your resume");
document.frm.file.focus();
return false;
}
if(document.frm.file.value !="") 
{
start=str.indexOf(".")
last=str.length
str1=str.substring(start+1,last)
if(str1!="rtf")
{
alert("Please select .rtf file.")
return false;
}

}
return true;
}
