// JavaScript Document



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 consumer_validation()
{	
		
	if( chk_string( document.FORMMAILFORM.name.value, 1, 3, 250 ) )
	{
		alert("Name not specified");
		document.FORMMAILFORM.name.focus();
		return false;
	}
	
		
	if( chk_string( document.FORMMAILFORM.address.value, 1, 2, 500 ) )
	{
		alert("Address not specified");
		document.FORMMAILFORM.address.focus();
		return false;
	}	

 if(  chk_string( document.FORMMAILFORM.city.value, 1, 2, 250 ) )
	{
		alert("City not specified");
		document.FORMMAILFORM.city.focus();
		return false;
	}
	

	if( chk_string( document.FORMMAILFORM.country.value, 1, 2, 250 ) )
	{
		alert("Country not specified");
		document.FORMMAILFORM.country.focus();
		return false;
	}
	
	
	if( chk_string( document.FORMMAILFORM.tele.value, 1, 2, 250 ) )
	{
		alert("Telephone No not specified");
		document.FORMMAILFORM.tele.focus();
		return false;
	}
	
	
	if( chk_email( document.FORMMAILFORM.email.value, 1, 2, 50 ) )
	{
		alert("Email Id invalid or not specified");
		document.FORMMAILFORM.email.focus();
		return false;
	}

/*	
	if( chk_string( document.FORMMAILFORM.skyid.value, 1, 2, 250 ) )
	{
		alert("Skype Id not specified");
		document.FORMMAILFORM.skyid.focus();
		return false;
	}
	*/
	
	
	
	if(document.FORMMAILFORM.product.value =="" )
	{
		alert("Product not specified");
		document.FORMMAILFORM.product.focus();
		return false;
	}
	
	
	if( chk_string( document.FORMMAILFORM.interest.value,1, 9, 250 ) )
	{
		alert("Interest not specified");
		document.FORMMAILFORM.interest.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;
}
}
  
  
  
   

