//Set Focus To The 1st Enabled Text Box On The Form

//Obtain The Collection Of Input Controls
var objControls = window.document.getElementsByTagName("INPUT");
//Determine The Maximum Index
var iCount = objControls.length - 1;
//Loop Counter
var i
//Iterate Through The Controls
for (i = 0; i <= iCount; i++)
{
	//Obtain A Reference To An Individual Control
	var objControl = objControls[i];
	//If The Control Is A Text Box Or Password And Can Take The Focus Then Set Focus To It And Exit The Loop
	if ((objControl.type == "text" || objControl.type == "password") && objControl.disabled == false && objControl.isDisabled == false){objControl.focus(); break;}
}

function ValidateEmail(sEmail)
{
	//Create The Regular Expression Object
	var objRegExp = new RegExp("^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$");
	//Test The String
	return objRegExp.test(sEmail);
}
