function onKeyPressBlockNumbers(e)
{
	var key = window.event ? e.keyCode : e.which;
	var keychar = String.fromCharCode(key);
	if (keychar=='`')
    return !(keychar) ;
	reg = /\d/;
	
	return !reg.test(keychar);
}


function chk_string( str, req, min, max )// Checking the lent of the text box
{
	if( str.length == 0 && !req )
		return 0;
	if( str.length < min || str.length > max )
		return 1;
	return 0;
}


function chk_email( str, req )
{
	var email_RegEx = /^\w+([-.]\w+)*\@\w+([-.]\w+)*\.\w+$/;
	if( str.length == 0 && !req )
	    return 0;
	var found = email_RegEx.test( str );
	if( found == false )
	    return 1;
	return 0;
}
function distributor_validation()
{	
		
	if( chk_string( document.FORMMAILFORM2.name1.value, 1, 2, 250 ) )
	{
		alert("Firm's name not specified");
		document.FORMMAILFORM2.name1.focus();
		return false;
	}
	
		
	if( chk_string( document.FORMMAILFORM2.address1.value, 1, 2, 250 ) )
	{
		alert("Address not specified");
		document.FORMMAILFORM2.address1.focus();
		return false;
	}	
//
 if(  chk_string( document.FORMMAILFORM2.city1.value, 1, 2, 250 ) )
	{
		alert("City not specified");
		document.FORMMAILFORM2.city1.focus();
		return false;
	}

 if(  chk_string( document.FORMMAILFORM2.zip1.value, 1, 2, 250 ) )
	{
		alert("Zip Code not specified");
		document.FORMMAILFORM2.zip1.focus();
		return false;
	}
 if(  chk_string( document.FORMMAILFORM2.country1.value, 1, 2, 250 ) )
	{
		alert("Country not specified");
		document.FORMMAILFORM2.country1.focus();
		return false;
	}

 if(  chk_string( document.FORMMAILFORM2.tele1.value, 1, 2, 250 ) )
	{
		alert("Telephone No. not specified");
		document.FORMMAILFORM2.tele1.focus();
		return false;
	}





	if( chk_email( document.FORMMAILFORM2.email1.value, 1, 2, 50 ) )
	{
		alert("Email Id invalid or not specified");
		document.FORMMAILFORM2.email1.focus();
		return false;
	}
	
	
	if((document.FORMMAILFORM2.typeofcompany[0].checked == false)&&(document.FORMMAILFORM2.typeofcompany[1].checked == false)&&(document.FORMMAILFORM2.typeofcompany[2].checked == false))
	{
			alert("Type of Company not specified")
			document.FORMMAILFORM2.typeofcompany[0].focus();
			return false;
	}
	
	
	if((document.FORMMAILFORM2.salelocal1[0].checked == false)&&(document.FORMMAILFORM2.salelocal1[1].checked == false))
	{
			alert("Please Select any Sales Tax Regn. Nos")
			document.FORMMAILFORM2.salelocal1[0].focus();
			return false;
	}
	

	
 if(  chk_string( document.FORMMAILFORM2.nameproprietor.value, 1, 2, 250 ) )
	{
		alert("Personal name not specified");
		document.FORMMAILFORM2.nameproprietor.focus();
		return false;
	}



if( chk_string( document.FORMMAILFORM2.productorga.value, 1, 1, 250 ) )
	{
		alert("Distributor not specified");
		document.FORMMAILFORM2.productorga.focus();
		return false;
	}

/* --------------- */
if((document.FORMMAILFORM2.officeorga.value == "") && (document.FORMMAILFORM2.showroomorga.value == "") && (document.FORMMAILFORM2.cumshowroomorga.value == ""))
	{
			alert("Space available not specified")
			document.FORMMAILFORM2.officeorga.focus();
			return false;
	}
	



	if(  chk_string( document.FORMMAILFORM2.territory.value, 1, 2, 250 ) )
	{
		alert("Interested city name not specified");
		document.FORMMAILFORM2.territory.focus();
		return false;
	}







   
}   

function checkField(which) {
if (/[^a-z]/gi.test(which.value)) {
alert ("Only alpha characters are valid in this field"); // no spaces, full stops or anything but A-Z
which.focus();
return false;
}
}


function numbersonly(e)

{
var unicode=e.charCode? e.charCode : e.keyCode
if (unicode!=8)
if (unicode<48||unicode>57) 
return false 


}


  function specialChars1()
{
var nbr;
nbr=event.keyCode ;
if ((nbr>=65 && nbr<90)||(nbr>=97 && nbr<=122))
{
return true;
}
else
{
return false;
}
}
  
  
  
   

