// JavaScript Document
function validate()
{
  if(trim(document.cafe.txtemail.value) == '')
	{
		alert('Please Enter Email.');
		document.getElementById('txtemail').focus();
		return false;
	}
if(trim(document.cafe.txtemail.value)!="")
	{
		var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
		var ans = document.cafe.txtemail.value.match(emailExp);
		if(ans!=document.cafe.txtemail.value)
		{
			alert("Please Enter Valid Email.");
			document.cafe.txtemail.focus();
			return false;				
		}
	}
	
 if(trim(document.cafe.txtpassword.value) == '')
	{
		alert('Please Enter Password.');
		document.getElementById('txtpassword').focus();
		return false;
	}	
}
function trim(stringToTrim)
{
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}