	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 contactus()
{
//alert(url);
var name=document.formcontactus.name.value;
name= name.replace(/\s+$/g,'');
if(name.length==0)
{
alert("Please Enter your name");
document.formcontactus.name.value="";
document.formcontactus.name.focus();
return false;
}
var emailID=document.formcontactus.email;
	if ((emailID.value==null)||(emailID.value=="")){
		alert("Please Enter your Email ID")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}

var city=document.formcontactus.city.value;
city= city.replace(/\s+$/g,'');
if(city.length==0)
{
   alert ( "Please enter your City Name." );
		document.formcontactus.city.focus();
		document.formcontactus.city.value="";
        return false;
}

var state=document.formcontactus.state.value;
state= state.replace(/\s+$/g,'');
if(state.length==0)
{
   alert ( "Please enter your State." );
		document.formcontactus.state.focus();
		document.formcontactus.state.value="";
        return false;
}

var zip=document.formcontactus.zip.value;
zip= zip.replace(/\s+$/g,'');
if(zip.length==0)
{
   alert ( "Please enter your Zip Code." );
		document.formcontactus.zip.focus();
		document.formcontactus.zip.value="";
        return false;
}


var comments=document.formcontactus.comments.value;
comments= comments.replace(/\s+$/g,'');
if(comments.length==0)
{
   alert ( "Please enter your commnets." );
		document.formcontactus.comments.focus();
		document.formcontactus.comments.value="";
        return false;
}
var security_code=document.formcontactus.security_code.value;
security_code= security_code.replace(/\s+$/g,'');
if(security_code.length==0)
{
   		alert ( "Please Enter Security Code." );
		document.formcontactus.security_code.focus();
		document.formcontactus.security_code.value="";
        return false;
}
}
