// JavaScript Document
	//begin validation for mkcontact.asp
	function checkmkcontact()
	{
		if(document.frmmkcontact.T3.value=="")	
		{
			alert("Please Enter Company Name");
			document.frmmkcontact.T3.focus();
			return false;
		}
		else if(document.frmmkcontact.T8.value=="")
		{
			alert("Please Enter Contact");
			document.frmmkcontact.T8.focus();
			return false;
		}
		else if(document.frmmkcontact.T10.value=="")
		{
			alert("Please Enter Phone No");
			document.frmmkcontact.T10.focus();
			return false;
		}
		else if(echeck(document.frmmkcontact.T9.value)==false)
		{
			document.frmmkcontact.T9.focus();
			return false;
		}
		else if(document.frmmkcontact.S1.value=="")
		{
			alert("Please Enter Information");
			document.frmmkcontact.S1.focus();
			return false;
		}
		else
			document.frmmkcontact.submit()
	}
	
	//end validation for mkcontact.asp
	
	//begin vaidation for mycontact.asp
	function vaidate_contact_info()
	{
		//mkcontinfo_id
		//var mkcontinfo_company=document.frmcontinfo.T3.value;
		var mkcontinfo_contact=document.frmcontinfo.T8.value;
		var mkcontinfo_phno=document.frmcontinfo.T15.value;
		var mkcontinfo_email=document.frmcontinfo.T16.value;
		var mkcontinfo_strteet=document.frmcontinfo.T13.value;
		var mkcontinfo_city=document.frmcontinfo.T14.value;
		var mkcontinfo_state=document.frmcontinfo.ddstatecont.value;
		var mkcontinfo_zip=document.frmcontinfo.T26.value;
		var mkcontinfo_pwd=document.frmcontinfo.T9.value;
		/*if(mkcontinfo_company == "")
		{
			alert("Please enter company name")
			document.frmcontinfo.T3.focus();
			return false;
		}*/
		if(mkcontinfo_contact == "")
		{
			alert("Please enter ccontact")
			document.frmcontinfo.T8.focus();
			return false;
		}
		else if(mkcontinfo_phno == "")
		{
			alert("Please enter phone no.")
			document.frmcontinfo.T15.focus();
			return false;
		}
		else if(echeck(mkcontinfo_email)==false)
		{
			document.frmcontinfo.T16.focus();
			return false;
		}
		else if(mkcontinfo_strteet == "")
		{
			alert("Please enter street")
			document.frmcontinfo.T13.focus();
			return false;
		}
		else if(mkcontinfo_city == "")
		{
			alert("Please enter city")
			document.frmcontinfo.T14.focus();
			return false;
		}
		else if(mkcontinfo_state == "0")
		{
			alert("Please select state")
			//document.frmcontinfo.T25.focus();
			return false;
		}
		else if(mkcontinfo_zip == "")
		{
			alert("Please enter zip")
			document.frmcontinfo.T26.focus();
			return false;
		}
		else if(mkcontinfo_pwd == "")
		{
			alert("Please enter company name")
			document.frmcontinfo.T9.focus();
			return false;
		}
		else
		{
			document.frmcontinfo.submit()
		}
	}
	function validatebilling()
	{
		/*if(document.frmbilling.T17.value== "")
		{
			alert("Please enter company name")
			document.frmbilling.T17.focus();
			return false;
		}*/
		if(document.frmbilling.T18.value == "")
		{
			alert("Please enter ccontact")
			document.frmbilling.T18.focus();
			return false;
		}
		else if(document.frmbilling.T19.value == "")
		{
			alert("Please enter phone no.")
			document.frmbilling.T19.focus();
			return false;
		}
		else if(echeck(document.frmbilling.T20.value)==false)
		{
			document.frmbilling.T20.focus();
			return false;
		}
		else if(document.frmbilling.T21.value == "")
		{
			alert("Please enter street")
			ocument.frmbilling.T21.focus();
			return false;
		}
		else if(document.frmbilling.T22.value == "")
		{
			alert("Please enter city")
			document.frmbilling.T22.focus();
			return false;
		}
		else if(document.frmbilling.ddstatebill.value == "0")
		{
			alert("Please select state")
			//ddocument.frmbilling.T23.focus();
			return false;
		}
		else if(document.frmbilling.T24.value == "")
		{
			alert("Please enter zip")
			document.frmbilling.T24.focus();
			return false;
		}
		else
		{
			document.frmbilling.submit()
		}
	}
	//end vaidation for mycontact.asp
	
	//function for email check
	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;
	}
