// JavaScript Document

function checkForm(Obj){

	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;
	var num;
	num=Obj.txtPhone.value

	if (isBlank(Obj.txtName.value))

	 {alert("Please Enter Your Name");Obj.txtName.focus();return false;}

/*	if (isBlank(Obj.txtPhone.value))

	 {alert("Please Enter Your Telephone Number");Obj.txtPhone.focus();return false;}
*/

/*	
	if (!parseInt(num))	
	{alert("Invalid Telephone Number");Obj.txtPhone.focus();return false;}
*/	

	
 
	if (isBlank(Obj.txtEmail.value))
	 {alert("Please Enter Your Email Address");Obj.txtEmail.focus();return false;}
	
	if (!filter.test(Obj.txtEmail.value)) 
	 {alert('Invalid email address.');Obj.txtEmail.focus();return false;}

	if (isBlank(Obj.txtEnquiry.value))
	 {alert("Please Enter Your Enquiry Details ");Obj.txtEnquiry.focus();return false;}


	
	
	return true;

}


function isBlank(str) {

	var len = str.length;

	var enter = 0;

     if(len == 0) {

     	return true;

     }

	  //Check if user only enter

	  for (i=0; i<len; i++) {

	  		if((str.charCodeAt(i) == 13)||(str.charCodeAt(i) == 10)||(str.charCodeAt(i) == 32)) {

	  			enter = 0;

	  		}

	  		else {

	  			return false;

	  		}

	  }	  

	  	return true;

}
