
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 ValidateForm(){
		var emailID=document.frm.email
		var name=document.frm.name
		var knew=document.frm.knew
		var name=document.frm.name
		var country=document.frm.country
		var layout=document.frm.layout
		var loadtime=document.frm.loadtime
		var ca=document.frm.contentaccess
		var msgtype=document.frm.msgtype
		var message=document.frm.message
		var verification=document.frm.verification
		var countrycode=document.frm.countrycode
		var areacode=document.frm.areacode
		var number=document.frm.number
		var mobile=document.frm.mobile

			



	if((name.value==null)||(name.value==""))
	{
		document.getElementById('name').style.color="red";
		document.getElementById('name').background="images/error.GIF";
		name.focus()
		return false
	}
		else
	{
		document.getElementById('name').style.color="";
		document.getElementById('name').background="";
	}




	if ((emailID.value==null)||(emailID.value=="")){
		document.getElementById('email').style.color="red";
		document.getElementById('email').background="images/error.GIF";
		emailID.focus()
		return false
	}
		else
	{
		document.getElementById('email').style.color="";
		document.getElementById('email').background="";
	}
	if (echeck(emailID.value)==false){
		emailID.value=""
		emailID.focus()
		return false
	}
	
	if((isNaN(countrycode.value)||isNaN(areacode.value)||isNaN(number.value)) &&(countrycode.value!="ISD" || areacode.value!="Area Code" || number.value!="Phone No." ))
	{	//alert(countrycode.value)
		document.getElementById('contact').style.color="red";
		document.getElementById('contact').background="images/error.GIF";
		countrycode.focus()
		return false
	}
		else
	{
		document.getElementById('contact').style.color="";
		document.getElementById('contact').background="";
	}

	if(isNaN(mobile.value))
	{
		document.getElementById('mobile').style.color="red";
		document.getElementById('mobile').background="images/error.GIF";
		mobile.focus()
		return false
	}
		else
	{
		document.getElementById('mobile').style.color="";
		document.getElementById('mobile').background="";
	}


	if((country.value==null)||(country.value==""))
	{
		document.getElementById('country').style.color="red";
		document.getElementById('country').background="images/error.GIF";
		country.focus()
		return false
	}
		else
	{
		document.getElementById('country').style.color="";
		document.getElementById('country').background="";
	}


	if((knew.value==null)||(knew.value==""))
	{
		document.getElementById('knew').style.color="red";
		document.getElementById('knew').background="images/error.GIF";
		knew.focus()
		return false
	}
		else
	{
		document.getElementById('knew').style.color="";
		document.getElementById('knew').background="";
	}





	if((layout.value==null)||(layout.value==""))
	{
		document.getElementById('layout').style.color="red";
		document.getElementById('layout').background="images/error.GIF";
		document.getElementById('rate').style.color="red";
		document.getElementById('rate').background="images/error.GIF";
		layout.focus()
		return false
	}
		else
	{
		document.getElementById('layout').style.color="";
		document.getElementById('layout').background="";
	document.getElementById('rate').style.color="";
		document.getElementById('rate').background="";
	}
	if((loadtime.value==null)||(loadtime.value==""))
	{
		document.getElementById('loadtime').style.color="red";
		document.getElementById('loadtime').background="images/error.GIF";
		document.getElementById('rate').style.color="red";
		document.getElementById('rate').background="images/error.GIF";
		loadtime.focus()
		return false
	}
		else
	{
		document.getElementById('loadtime').style.color="";
		document.getElementById('loadtime').background="";
			document.getElementById('rate').style.color="";
		document.getElementById('rate').background="";
	}

	if((ca.value==null)||(ca.value==""))
	{
		document.getElementById('ca').style.color="red";
		document.getElementById('ca').background="images/error.GIF";
		document.getElementById('rate').style.color="red";
		document.getElementById('rate').background="images/error.GIF";
		ca.focus()
		return false
	}
		else
	{
		document.getElementById('ca').style.color="";
		document.getElementById('ca').background="";
			document.getElementById('rate').style.color="";
		document.getElementById('rate').background="";
	}


	if((message.value==null)||(message.value==""))
	{
		document.getElementById('message').style.color="red";
		document.getElementById('message').background="images/error.GIF";
		message.focus()
		return false
	}
		else
	{
		document.getElementById('message').style.color="";
		document.getElementById('message').background="";
	}

	if((verification.value==null)||(verification.value==""))
	{
		document.getElementById('verification').style.color="red";
		document.getElementById('verification').background="images/error.GIF";
		message.focus()
		return false
	}
		else
	{
		document.getElementById('verification').style.color="";
		document.getElementById('verification').background="";
	}


return true
 }