// JavaScript Document
function checkall()
{
	if(document.frm1.gentle.value=="")
	{
		alert('Please select one.');
		document.frm1.gentle.focus();
		return false;
	}
	if(document.frm1.txtfname.value=="")
	{
		alert('First Name field can not be left blank.');
		document.frm1.txtfname.focus();
		return false;
	}
	if(document.frm1.txtlname.value=="")
	{
		alert('Last Name field can not be left blank.');
		document.frm1.txtlname.focus();
		return false;
	}
	if(document.frm1.txtemail.value=="")
	{
		alert('Please enter your E-mail Id.');
		document.frm1.txtemail.focus();
		return false;
	}
	
	if(document.frm1.textcomment.value=="")
	{
		alert('Please write down few comments.');
		document.frm1.textcomment.focus();
		return false;
	}		
	var email=document.frm1.txtemail.value;
	var len=email.length;
	for(i=0;i<len;i++)
	{
		if(email.charAt(i)==" ")
		{
			alert('Invalid E-mail Id.');
			document.frm1.txtemail.focus();
			return false;
		}
	}
	if(email.charAt(0)=='@' || email.charAt(0)=='.')
	{
		alert('Invalid E-mail Id.');
		document.frm1.txtemail.focus();
		return false;
	}
	var i=1;
	while(i<len && email.charAt(i)!='@')
	{
		i++;
	}
	if(i>len || email.charAt(i)!='@')
	{
		alert('Invalid E-mail Id.');
		document.frm1.txtemail.focus();		
		return false;
	}
	var i=1;
		while(i<len && email.charAt(i)!='.')
	{
		i++;
	}
	if(i>len-2 || email.charAt(i)!='.')
	{
		alert('Invalid E-mail Id.');
		document.frm1.txtemail.focus();		
		return false;
	}
	
	  var char="a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,`,~,!,@,#,$,%,^,&,*,(,),_,+,=,{,},[,],|,\,:,;,',.,<,>,?,/";
	  var val=document.frm1.txtmobile.value;
	  if(val!="")
	  {
		for(var i=0;i<val.length;i++)
		{
			if(char.indexOf(val.charAt(i))!=-1)
			{
				alert('Please enter a valid contact no.');
				 document.frm1.txtmobile.focus();
				  return false;
			}
		}
	      if(val.length<10)	 
		{
    	  alert('Must enter 10 number.');
		  document.frm1.txtmobile.focus();
		  return false;
		}
	 }
	 
	 //cganges
	  var val1=document.frm1.txttelephone.value;	 
	 if(val1!="")
	  {
		for(var i=0;i<val1.length;i++)
		{
			if(char.indexOf(val1.charAt(i))!=-1)
			{
				alert('Please enter a valid contact no.');
				 document.frm1.txttelephone.focus();
				  return false;
			}
		}
	  }
	 //changes
}
function changestate(val)
{
	 if(val=="")
	{
		document.getElementById('other').style.visibility="hidden";
		document.getElementById('statelist').style.visibility="hidden";
	}else if(val!="IND")
	{
		document.getElementById('other').style.visibility="visible";
		document.getElementById('statelist').style.visibility="hidden";
		document.frm1.txtstatelist.value="";
	}else if(val=="IND")
	{
		
		document.getElementById('other').style.visibility="hidden";
		document.frm1.txtstate.value="";
		document.getElementById('statelist').style.visibility="visible";
	}
}
	