function chk_phone( str, req )
{
	var phone_RegEx = /^[0-9\(\)\-\.\s]{7,}$/;
	if( str.length == 0 && !req )
		return 0;
	var found = phone_RegEx.test( str );
	if( found == false )
		return 1;
	return 0;
}



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 appli_onsubmit()
{	
		
	if( chk_string( document.form1.qName.value, 1, 2, 50 ) )
	{
		alert("Name not specified");
		document.form1.qName.focus();
		return false;
	}	
	
	
	 if( chk_email( document.form1.qmail.value, 1, 2, 50 ) )
	{
		alert("Email address invalid or not specified");
		document.form1.qmail.focus();
		return false;
	}
	
	
	// if( chk_string( document.form1.qNo.value, 1, 2, 50 ) )
//	{
//		alert("Tel No not specified");
//		document.form1.qNo.focus();
//		return false;
//	}	
// 
// 

	 if( chk_phone( document.form1.qNo.value,7 ) )
	{
	alert("Tel not specified");	
  	document.form1.qNo.focus();  
	return false;
	}

 	 if( chk_string( document.form1.textarea.value, 1, 3, 350 ) )
	{
		alert("Message not specified");
		document.form1.textarea.focus();
		return false;
	}
	
	
	
   
 }   
 
function numbersonly(e)
		  
{
var unicode=e.charCode? e.charCode : e.keyCode
if (unicode!=8)
if (unicode<48||unicode>57) 
return false 

}
