function CheckOnJS(){
	try {document.getElementById('esxDiscoverLogin').jsavail.value="Yes";}
	catch (error) {alert("hiJavaScript is not enabled")}
}

function setLoginFocus(){	
	if (document.getElementById('esxDiscoverLogin').esxSubmit){
		document.getElementById('esxDiscoverLogin').esxLogin.focus();
	}
	else if (document.getElementById('esxDiscoverLogin').emxMakeMandatoryChangeSubmit){
		document.getElementById('esxDiscoverLogin').CurrentPassword.focus();
	}
	else  {}
}

function submitForm(theForm) {
	// validate for empty username
	formRequired(theForm.esxLogin,'You need to enter a Username.');
	// validate username is valid email
	// formIsEmail(theForm.j_username,'Please enter a valid Username.');
	// validate for empty password
	formRequired(theForm.esxPassword,'You need to enter a Password.');
	// validate password is AlphaNumeric
	formIsAlphaNumeric(theForm.j_password,'Please enter a valid Password.');
	
	/*if(formSubmit) {
		theForm.esxPassword.value=sha1Hash(theForm.esxPassword.value).toUpperCase() + theForm.chap.value;
		return true;
	} else {
		formAlert();
		return false;
	}*/
}
function submitFormCP(theForm) {
	// validate for empty current password
	formRequired(theForm.CurrentPassword,'You need to enter your Current Password.');
	// validate password is AlphaNumeric
	// formIsAlphaNumeric(theForm.CurrentPassword,'Please enter a valid Current Password.'); // eliminate for UPGRADE Aug 2007
	// validate for empty password1
	formRequired(theForm.NewPassword1,'Please enter a New Password.');
	// validate password1 is AlphaNumeric
	// formIsAlphaNumeric(theForm.NewPassword1,'Please enter a valid New Password.');
	// validate for empty password2
	formRequired(theForm.NewPassword2,'Please enter your New Password again.');
	// validate password2 is AlphaNumeric
	// formIsAlphaNumeric(theForm.NewPassword2,'Please enter a valid Password.');
	// validate password1 and password2 match
	formIsSame(theForm.NewPassword1,theForm.NewPassword2,'The new passwords do not match')
	
	/*if(formSubmit) {
		alert('hello');
		theForm.CurrentPassword.value=sha1Hash(theForm.CurrentPassword.value).toUpperCase() + theForm.chap.value;
		return true;
	} else {
		formAlert();
		return false;
	}*/
}
