// JavaScript Document

function forgot_pass()
{
// user name
	//var name=document.forgot_frm.txtusername.value;
	//if(document.forgot_frm.txtusername.value=="")
//	{
//		alert("Please specify your username.");
//		document.forgot_frm.txtusername.focus();
//		return false;
//	}
//	else if(name.search(/^[a-zA-Z][a-zA-Z' ]+$/))
//	{
//		alert("Please specify valid username.");
//		document.forgot_frm.txtusername.focus();
//		return false;
//	}
	// email
	 if(document.forgot_frm.txtemail.value=="")
 	{
		alert("E-mail must be specified.");
		document.forgot_frm.txtemail.focus();
		return false;
 	}
	else
	{
		if(!isValidEmailId("txtemail"))
		{
			return false;
		}
	}
	

}


function isValidEmailId(elm)
{
	var id=document.forgot_frm.txtemail.value;
	if (id.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
	{
		return true;
	}
	else
	{
		alert("E-mail address is not valid.");
		//elm.select();
		document.forgot_frm.txtemail.focus();
		//id.select();
		return false;
	}
}
