﻿
function SetUpPage() {
	window.onerror = stopError;
	SetFocus();
}

function SetFocus() {
	document.LoginForm.RepLogin.focus();
}

function stopError() {
	return true;
}

function Login_Rep() {
//updated 12/12/2003 to combat SQL injection

//	declare variables
	var loginName
	var repPassword
	
//	set variable values
	loginName = document.LoginForm.RepLogin.value
	repPassword = document.LoginForm.RepPassword.value
	
//	check login name - disallow blank username, <6 or >15 char entries, special characters
	if (loginName == "") {
		alert('You must enter a login name.');
		document.LoginForm.RepLogin.focus();
		return false;
	}
	if (loginName.length < 3 || loginName.length > 15 ) {
		alert('The Login name must be between 6 and 15 characters long.');
		document.LoginForm.RepLogin.focus();
		return false;
	}
	if (CheckExtendedASCII(loginName) == false) {
		alert('The Login name may only contain alpha and numeric characters. Special characters are not allowed.')
		document.LoginForm.RepLogin.focus();
		return false;
	}

//	validate password entry
	//disallow blanks
	if (repPassword == "") {
		alert('Blank passwords are not permitted.');
		document.LoginForm.RepPassword.focus();
		return false
	}
	//disallow short or long entries
	if (repPassword.length < 6 || repPassword.length > 15 ) {
		alert('The new password must be between 6 and 15 characters long.');
		document.LoginForm.RepPassword.focus();
		return false;
	}	
	//disallow extended ASCII characters
	if (CheckExtendedASCII(repPassword) == false) {
		alert('The password may only contain alpha and numeric characters. Special characters are not allowed.')
		document.LoginForm.RepPassword.focus();
		return false;
	}
	
	document.LoginForm.OKToSend.value="Rep"
	document.LoginForm.submit()
}

function ReturnKeyRep() {
	if(event.keyCode==13) {
		Login_Rep();
	}
}
