﻿function startFocusUsername()
{
	if (document.getElementById("aspnetForm").username != null)
	{
		document.getElementById("aspnetForm").username.focus();
	}
}

function startFocusPassword()
{
	if (document.getElementById("aspnetForm").password != null)
	{
		document.getElementById("aspnetForm").password.focus();
	}
}

function startFocusNewPassword()
{
	if (document.getElementById("aspnetForm").newpassword != null)
	{
		document.getElementById("aspnetForm").newpassword.focus();
	}
}

function delayedRedirect(url, seconds)
{
	setTimeout("window.location.href = '" + url + "'", seconds*1000);
}

function delayedRedirectAndFocus(url, seconds)
{
	delayedRedirect(url, seconds);
	startFocusNewPassword();
}

function hashPassword(form)
{
	form.saltedhashpwd.value = hashStringToBase64stringWithSalt(form.password.value, form.salt.value);
	form.saltedhashpwdnocase.value = hashStringToBase64stringWithSalt(form.password.value.toUpperCase(), form.salt.value);
	
	form.password.value = "";
}

function popupHelp(url)
{
	window.open(url, "", "menubar=1,resizable=1,scrollbars=1,width=700,height=700");
}
