function chkemail(emval){        var posi = 0;        var posj = 0;        var iflg = "false";        var jflg = "false";        for(i=0;i<=emval.length;i++)        {                if(emval.substr(i, 1) == "\@")                {                        posi = i+1;                        iflg = "true";                }                if(emval.substr(i, 1) == ".")                {                        posj = i+1;                        jflg = "true";                }        }        if(posi == "1" || (posi+1) == posj || posj == emval.length || iflg == "false" || jflg == "false")        {                return false;        }        else        {                return true;        }} function validateForm(fastapply){ 	fastapply.onsubmit = function()   {            	if(fastapply.insure.selectedIndex == 0)	   {		alert("Please select Insurance");		fastapply.insure.value = "";		fastapply.insure.focus();		return false;	}		if(fastapply.insure_required_for.selectedIndex == 0)	{		alert("Please select Life Insurance Required For");		fastapply.insure_required_for.focus();		return false;	}             if(fastapply.elements['cust_fname'].value.length<1)	{		alert("Please Enter First Name");		fastapply.cust_fname.value = "";		fastapply.cust_fname.focus();		return false;	}       if(fastapply.elements['cust_lname'].value.length<1)	{		alert("Please Enter Last Name");		fastapply.cust_lname.value = "";		fastapply.cust_lname.focus();		return false;	}		if(fastapply.day.options.selectedIndex=="0")	{	    day_selected=fastapply.day.options.selectedIndex		alert("Please enter day");		fastapply.day.focus();		return false;        	}	if(fastapply.month.options.selectedIndex=="0")	{		alert("Please enter month");		fastapply.month.focus();		return false;		 }		  	   		 							if(fastapply.year.options.selectedIndex=="0")	{		alert("Please enter year");		fastapply.year.focus();		return false;				}				 	   				   	if(fastapply.cust_city.options.selectedIndex==0)	  {	     alert("Please Select a CITY From the List");		 fastapply.cust_city.focus();		 return false;		 	 	 		} 						if(!chkemail(fastapply.cust_email.value))				{		   alert("Please Enter Correct Email Address");		 fastapply.cust_email.focus();		 return false;		 	 	 		} 				           		if(fastapply.cust_mob.value.length<10)		     {	    			 alert("Please Enter 10 Digit Mobile Number");					fastapply.cust_mob.focus();					return false;					    }						      				else					{							 							for(i = 0; i < fastapply.cust_mob.value.length; i++)							{								if(parseInt(fastapply.cust_mob.value.charAt(i)) >= 0 && parseInt(fastapply.cust_mob.value.charAt(i)) <= 9)												{								 	}									else									{									 alert("Please enter Numeric value");									 fastapply.cust_mob.focus();									 return false;									 }								}																        if(parseInt(fastapply.cust_mob.value.charAt(0))==9)										   {										       }											   											else 										    	{   										          alert("Please Enter Mobile With 9");											      fastapply.cust_mob.focus();											      return false;											 }																																							}								return true;  }}
