function validateSignIn(e)
{
	if ( !e ) var e = window.event;
	if (e.target) var targ = e.target;
	else if (e.srcElement) var targ = e.srcElement;
	if (targ.nodeType == 3) var targ = targ.parentNode;		// defeat Safari bug

	var oForm = targ.form;

	// Lock the form to prevent double-click saves
	if ( gForm_lock ) return;
	else gForm_lock = true;

	var errors	= new ErrorList();

	clearInputErrors(oForm);

	var email		= trim(getInputValue(oForm["email"]));
	var password	= trim(getInputValue(oForm["password"]));

	if ( email == "" || email == "Email" ) setError(oForm["email"], errors, "Please enter your email address\n");
	else if ( !checkEmail(email) ) setError(oForm["email"], errors, "Invalid email address\n");
	if ( !checkAlphaNum(password) )
	{
		setError(oForm["password_text"], errors, "Your password can only be characters and numbers\n");
		setError(oForm["password"], errors);
	}
	else if ( password.length < 6 )
	{
		setError(oForm["password_text"], errors, "Your password must be at least 6 characters/digits long\n");
		setError(oForm["password"], errors);
	}

	if ( errors.getNumErrors() )
	{
		errors.showErrors();
		gForm_lock = false;
	}
	else oForm.submit();
}


// Called when the password box in the top status bar is clicked or focused on.  Changes the box to a password box.
function checkPasswordInput(oInput)
{
	var oForm = oInput.form;
	var prefix = getInputValue(oForm["prefix"]);
	document.getElementById(prefix+"_password_text").style.display = "none";
	document.getElementById(prefix+"_password").style.display = "inline";
	document.getElementById(prefix+"_password").focus();
}
