function validatenum(e){
		//'"|\/<>?~`#$%^-+*,:;
		var reg = /^[a-zA-Z'"~`!@<>;{}()\/\\\|#\$\.,=\+\?-_^&*%:\-\[\]\s]*$/;
		var key = window.event ? e.keyCode : e.which;
		var keychar = String.fromCharCode(key);
		return !reg.test(keychar);
		
 	}//funtion
function validatetext(e){
		//'"|\/<>?~`#$%^-+*,:;
		var reg = /^[1-90'"~`!@<>;{}\/\\\|#\$\.,=\+\?_^&*%:\-\[\]]*$/;
		var key = window.event ? e.keyCode : e.which;
		var keychar = String.fromCharCode(key);
		return !reg.test(keychar);
 	}//funtion
function checkmuskan(){
	if(document.applynow.name.value==""){
		alert("Enter your name");
		document.applynow.name.focus();
		return false;
	}
	if(document.applynow.con1.value==""){
		alert("Enter cell no.");
		document.applynow.con1.focus();
		return false;
	}
	if(document.applynow.email.value==""){
		alert("Enter Email");
		document.applynow.email.focus();
		return false;
	}
	var str=document.applynow.email.value;
		
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){
	   alert("Invalid E-mail ID")
	   return false
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   alert("Invalid E-mail ID")
	   document.applynow.email.focus()
	   return false
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		alert("Invalid E-mail ID")
	   document.applynow.email.focus()
		return false
	}

	 if (str.indexOf(at,(lat+1))!=-1){
		alert("Invalid E-mail ID")
		document.applynow.email.focus()
		return false
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		alert("Invalid E-mail ID")
		document.applynow.email.focus()
		return false
	 }

	 if (str.indexOf(dot,(lat+2))==-1){
		alert("Invalid E-mail ID")
		document.applynow.email.focus()
		return false
	 }
	
	 if (str.indexOf(" ")!=-1){
		alert("Invalid E-mail ID")
		document.applynow.email.focus()
		return false
	 }
	if(document.applynow.cnic.value==""){
		alert("Enter your NIC No.");
		document.applynow.cnic.focus();
		return false;
	}
	if(document.applynow.city.value==""){
		alert("Enter your City");
		document.applynow.city.focus();
		return false;
	}
	if(document.applynow.income.value==""){
		alert("Enter Income");
		document.applynow.income.focus();
		return false;
	}
	
	return true;
}

function verify22(){
	if(document.frm.name.value==""){
		alert("Enter your name");
		document.frm.name.focus();
		return false;
	}
	if(document.frm.cell.value==""){
		alert("Enter cell no.");
		document.frm.cell.focus();
		return false;
	}
	if(document.frm.landline.value==""){
		alert("Enter Landline no.");
		document.frm.landline.focus();
		return false;
	}	
	if(document.frm.email.value==""){
		alert("Enter Email");
		document.frm.email.focus();
		return false;
	}
	var str=document.frm.email.value;
		
	var at="@"
	var dot="."
	var lat=str.indexOf(at)
	var lstr=str.length
	var ldot=str.indexOf(dot)
	if (str.indexOf(at)==-1){
	   alert("Invalid E-mail ID")
	   return false
	}

	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
	   alert("Invalid E-mail ID")
		document.frm.email.focus();
		return false
	}

	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		alert("Invalid E-mail ID")
		document.frm.email.focus();
		return false
	}

	 if (str.indexOf(at,(lat+1))!=-1){
		alert("Invalid E-mail ID")
		document.frm.email.focus();
		return false
	 }

	 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		alert("Invalid E-mail ID")
		document.frm.email.focus();
		return false
	 }

	 if (str.indexOf(dot,(lat+2))==-1){
		alert("Invalid E-mail ID")
		document.frm.email.focus();
		return false
	 }
	
	 if (str.indexOf(" ")!=-1){
		alert("Invalid E-mail ID")
		document.frm.email.focus();
		return false
	 }
	if(document.frm.nic.value==""){
		alert("Enter your NIC No.");
		document.frm.nic.focus();
		return false;
	}
	if(document.frm.city.value==""){
		alert("Enter your City");
		document.frm.city.focus();
		return false;
	}
	return true;
}

