// JavaScript Document

function checkForm(Obj){

	var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9])+$/;

	
	if (isBlank(Obj.Name.value))

	 {alert("Please specify Name");Obj.Name.focus();return false;}

	if (isBlank(Obj.Telephone.value))

	 {alert("Please specify Telephone");Obj.Telephone.focus();return false;}

	
	if (isBlank(Obj.Email.value))

	 {alert("Please specify email address");Obj.Email.focus();return false;}

	if (!filter.test(Obj.Email.value)) 

	 {alert('Incorrect email address.');Obj.Email.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;

}