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

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID2")
		   return false
		}
		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID3")
		    return false
	   }

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

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

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

 		 return true					
	}


function validation(formname)
{
//alert(formname);
var name=formname.get_first_name.value;
var get_phone_1=formname.get_phone_1.value;
var get_phone_length=formname.get_phone_1.value.length;

var get_phone_2=formname.get_phone_2.value;
var get_phone_lenght2=formname.get_phone_2.value.length;

var get_phone_3=formname.get_phone_3.value;
var get_phone_lenght3=formname.get_phone_3.value.length;

var get_email=formname.get_email.value;
var get_total_amount=formname.get_total_amount.value;

var state=formname.state.value;
//alert(get_phone_length);
if(name=="" || name==null)
{
alert("First Name can not be empty");
document.getElementById("get_first_name").focus();
return false;
}
if(get_phone_1=="")
{
alert("Day Phone can not be empty");
document.getElementById("get_phone_1").focus();
return false;
}
if(isNaN(get_phone_1))
{
alert("Numeric value is valid");
document.getElementById("get_phone_1").focus();
return false;	
}
if(get_phone_length<3)
{
alert("Please Enter valid phone no.");
document.getElementById("get_phone_1").focus();
return false;
}

if(get_phone_2=="")
{
alert("Day Phone can not be empty");
document.getElementById("get_phone_2").focus();
return false;
}
if(isNaN(get_phone_2))
{
alert("Numeric value is valid");
document.getElementById("get_phone_2").focus();
return false;	
}
if(get_phone_lenght2<3)
{
alert("Please enter a valid phone");
document.getElementById("get_phone_2").focus();
return false;	
}

if(get_phone_3=="")
{
alert("Day Phone can not be empty");
document.getElementById("get_phone_3").focus();
return false;
}
if(isNaN(get_phone_3))
{
alert("Numeric value is valid");
//alert(get_phone_length);
document.getElementById("get_phone_3").focus();
return false;
}

if(get_phone_lenght3<4)
{
alert("Please enter a valid phone");
document.getElementById("get_phone_3").focus();
return false;	
}

if(get_email=="")
{
alert("Email-id can not be empty");
document.getElementById("get_email").focus();
return false;
}
if(echeck(get_email)==false)
{
document.getElementById("get_email").focus();
return false;	
}

if(get_total_amount=="")
{
alert("Please select amount")
document.getElementById("get_total_amount").focus();
return false;
}

if(state=="")
{
alert("Please select state");
document.getElementById("state").focus();
return false;
}



return true; 
}