function echeck(str) {

		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!")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid e-mail id!")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid e-mail id!")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid e-mail id!")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid e-mail id!")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid e-mail id!")
		    return false
		 }

 		 return true					
	}
	
	 function chkBlank()
  	{
	var emailID=document.form1.txtEmail
	
	if ((emailID.value==null)||(emailID.value=="")){
		alert("You have not entered your Email Address");
		emailID.focus();
		return false;
	}
	if (echeck(emailID.value)==false){
		emailID.value="";
		emailID.focus();
		return false;
	}	
	
	 var FName = document.form1.txtFName.value;
   	 FName1=FName.replace(/^\s+/,'').replace(/\s+$/,'');
	    if(FName1=="")
	{
	alert("Please enter first name!");	
	document.form1.txtFName.value="";			
	document.form1.txtFName.focus();
	return false;
	}

	 var LName = document.form1.txtLName.value;
   	 LName1=LName.replace(/^\s+/,'').replace(/\s+$/,'');
	    if(LName1=="")
	{
	alert("Please enter last name!");	
	document.form1.txtLName.value="";			
	document.form1.txtLName.focus();
	return false;
	}
	// var Address = document.form1.txtAddress.value;
   	// Address1=Address.replace(/^\s+/,'').replace(/\s+$/,'');
	//    if(Address1=="")
//	{
//	alert("Please enter address!");	
//	document.form1.txtAddress.value="";			
//	document.form1.txtAddress.focus();
//	return false;
//	}
//	 if(document.form1.txtAddress.length>250)
//	{
//		alert("Address must be 250 char long.");
//		document.form1.txtAddress.focus();
//		return false;
//	}
		 if(document.form1.cmbCountry.value=="0")
	{
		alert("Please select your Country");
		document.form1.cmbCountry.focus();
		return false;
	}
 if(isnumeric(document.form1.txtZip.value)==false)
	{
		alert("Please enter numeric digits for pin code!");
		//document.frmreg.txtZip.value="";
		document.form1.txtZip.focus();
 		return false;
	}	
	
	 var Tel = document.form1.txtTel.value;
   	 Tel1=Tel.replace(/^\s+/,'').replace(/\s+$/,'');
	    if(Tel1=="")
	{
	alert("Please enter mobile number!");	
	document.form1.txtTel.value="";			
	document.form1.txtTel.focus();
	return false;
	}
	if(document.form1.cmbPayMode.value=="0")
	{
		alert("Please select your Method of Payment");
		document.form1.cmbPayMode.focus();
		return false;
	}
	
 var Bank = document.form1.txtBank.value;
   	 Bank1=Bank.replace(/^\s+/,'').replace(/\s+$/,'');
	    if(Bank1=="")
	{
	alert("You have not entered your Bank Name");	
	document.form1.txtBank.value="";			
	document.form1.txtBank.focus();
	return false;
	}
 var ChqDDNo = document.form1.txtChqDDNo.value;
   	 ChqDDNo1=ChqDDNo.replace(/^\s+/,'').replace(/\s+$/,'');
	    if(ChqDDNo1=="")
	{
	alert("You have not entered your Cheque/DD No./ Cash Refrence No.");	
	document.form1.txtChqDDNo.value="";			
	document.form1.txtChqDDNo.focus();
	return false;
	}
	 if(document.form1.chkIsRead.checked==false)
	{
		alert("Please accept our Terms & Conditions");
		document.form1.chkIsRead.focus();
		return false;
	}
		else
		{
			return true;
		}	
				
		}
		
function isnumeric(a)
{
	len=a.length;
	for ( var i=0;i<len;i++ )
		{
			var x = a.substring(i,i+1);
			if (x>'9' || x<'0')
			{
				return false
			}	
		} 
		return true;
}	

function test()
{
	if (document.form1.cmbPayMode.value=="1")
	{
		document.form1.txtBank.value="by Credit Card / NetBanking";
		document.form1.txtChqDDNo.value="by Credit Card / NetBanking";		
		document.form1.txtBank.disabled=true;
		document.form1.txtChqDDNo.disabled=true;
		return true;		
	}
	else if(document.form1.cmbPayMode.value=="2")
	{
		document.form1.txtBank.value="";
		document.form1.txtChqDDNo.value="";		
		document.form1.txtBank.disabled=false;
		document.form1.txtChqDDNo.disabled=false;
		return true;
	}
}
		
-->
 
