function setOther(selval,othercnt)
{
	if(othercnt!='otherproductstype')
	{
		if(selval=="Other")
		{
			document.getElementById(othercnt).disabled=false;
			document.getElementById(othercnt).focus();
		}
		else
		{		
			document.getElementById(othercnt).disabled=true;
			document.getElementById(othercnt).value='';	
		}
	}
	else
	{		
		var bln=0;
		if(document.getElementById('productstypeother').checked==true)
		{
				bln=1;
		}
		if(bln==1)
		{
			document.getElementById(othercnt).disabled=false;
			document.getElementById(othercnt).focus();
		}
		else
		{
			document.getElementById(othercnt).disabled=true;
			document.getElementById(othercnt).value='';	
		}
	}
}
function validatefrm(frm)
{
	if ( frm.name.value.split(" ").join("") == "" ) {
		alert("Please enter a full name"); frm.name.focus(); return false;
		}
	if ( frm.company.value.split(" ").join("") == "" ) {
		alert("Please enter a company name");frm.company.focus(); return false;
		}	
	if ( frm.email.value.split(" ").join("") == "" ) {
		alert("Please enter an email"); frm.email.focus(); return false;
		}
	if ( !isEmail(frm.email.value) ) {
		alert("Please enter a valid email"); frm.email.focus(); return false;
		}
	if ( frm.phone1.value.split(" ").join("") == "" ) {
		alert("Please enter a phone1"); frm.phone1.focus(); return false;
		}	
	else if ( frm.phone1.value.split(" ").join("").length != "3" ) {
		alert("Please enter a 3 digits in phone1"); frm.phone1.focus(); return false;
	}
	
	if ( frm.phone2.value.split(" ").join("") == "" ) {
		alert("Please enter a phone2"); frm.phone2.focus(); return false;
		}
	else if ( frm.phone2.value.split(" ").join("").length != "3" ) {
		alert("Please enter a 3 digits in phone2"); frm.phone2.focus(); return false;
	}
	
	if ( frm.phone3.value.split(" ").join("") == "" ) {
		alert("Please enter a phone3"); frm.phone3.focus(); return false;
		}		
	else if ( frm.phone3.value.split(" ").join("").length != "4" ) {
		alert("Please enter a 4 digits in phone3"); frm.phone3.focus(); return false;
	}
	
	if(frm.fax1.value.split(" ").join("") != "" || frm.fax2.value.split(" ").join("") != "" || frm.fax3.value.split(" ").join("") != "")
	{
		if ( frm.fax1.value.split(" ").join("").length != "3") {
			alert("Please enter a 3 digits in fax1"); frm.fax1.focus(); return false;
		}
		if ( frm.fax2.value.split(" ").join("").length != "3") {
			alert("Please enter a 3 digits in fax2"); frm.fax2.focus(); return false;
		}
		if ( frm.fax3.value.split(" ").join("").length != "4") {
			alert("Please enter a 4 digits in fax3"); frm.fax3.focus(); return false;
		}
	}
	if ( frm.city.value.split(" ").join("") == "" ) {
			alert("Please enter a city"); frm.city.focus(); return false;
			}
		
/*	if ( frm.country.value.split(" ").join("") == "" ) {
		alert("Please select country"); frm.country.focus(); return false;
		}
	else
	{
		if(frm.country.value=='United States')
		{
*/			if ( frm.state.value.split(" ").join("") == "") {
			alert("Please enter a state"); frm.state.focus(); return false; 
			}
/*		}
		else
		{
			if (frm.txtState.value.split(" ").join("") == "" ) {
			alert("Please enter a state"); frm.txtState.focus();return false;
			}				
		}
	}
*/	if ( frm.zip.value.split(" ").join("") == "")	{
		alert("Please enter zip."); frm.zip.focus(); return false;
		}
	else if ( frm.zip.value.split(" ").join("").length != "5" ) {
		alert("Please enter a 5 digits in zip"); frm.zip.focus(); return false;
	}	

	if ( frm.businesstype[0].checked==false && frm.businesstype[1].checked==false && frm.businesstype[2].checked==false && frm.businesstype[3].checked==false){
		alert("Please select business type."); frm.businesstype[0].focus(); return false;
		}	
		
	if (!checkValue('businesstypeOther','otherbusinesstype')){
		alert("Please enter value for other business type."); frm.otherbusinesstype.focus(); return false;
		}	
	
	var bool=0;
	var chks = document.getElementsByName('productstype[]');
	var total = document.getElementsByName('productstype[]').length;
	for(i=0;i< total;i++)	
	{
		if( chks[i].checked==true)
			bool=1;	
	}
	if ( bool == 0)	{
		alert("Please select product type."); chks[0].focus();; return false;
		}
	
	if (!checkValue('productstypeother','otherproductstype')){
		alert("Please enter value for other product type."); frm.otherproductstype.focus(); return false;
		}				
		
	bool=0;
	
	for(i=0;i< frm.quantities.length;i++)	
	{
		if( frm.quantities[i].checked==true)
			bool=1;	
	}
	if ( bool == 0)	{
		alert("Please select quantities."); frm.quantities[0].focus(); return false;
	}
	
	if (!checkValue('quantities7','otherquantities')){
		alert("Please enter value for quantities fewer than 1,000."); frm.otherquantities.focus(); return false;
		}
		
	if (!checkValue('quantities1','otherquantities')){
		alert("Please enter value for quantities grater than 1,000."); frm.otherquantities.focus(); return false;
		}
		
	if(document.getElementById('hearabout').value=="Other" && document.getElementById('otherhearabout').value=="")
	{
		alert("Please enter value for other hear about us."); 
		frm.otherhearabout.focus(); return false;
		return false;
	}
							
	return true;
}