function appFocus(){
	var aForm = document.forms[0];
	document.focus();
	if (aForm == null){ return;} // no forms, no buttons, no URL's
	if (aForm == ""){
		alert('blankForms');
		return;
	}
	if (aForm.elements == null){
		return;
	}								 // form tags with no elements
	if (aForm.elements[0] == null){
		return;
	}
	j2 = aForm.length;
	j1 = 0;
	// first seek the first form field that is not hidden or a button
	while (	(j1 < j2)
		&&( GetType(aForm[j1]) == "hidden"
			|| GetType(aForm[j1]) == "submit"
			|| GetType(aForm[j1]) == "button" )
		)
	{
		j1 = j1 + 1;
	}
	// if we didn't get one, get the first non-hidden button
	if (j1 >= j2){
		j1 = 0;
		while (GetType(aForm[j1]) == "hidden")
		{
			j1 = j1 + 1;
		}
	}

	if (j1 >= j2){
		alert('hiddenOnly');
		return 0;
	}
	aForm[j1].focus();
}
function GetType( ob){
	return ob.type;
//	try{ return ob.type;}
//	catch(e){ return "";}
}

function TrapIn(){
	var keyF5 = 116;					// keycode for F5 key
	var keyBS = 8;						// keycode for BackSpace
	var keyNull = 0;
  	if (window.event.keyCode == keyF5){
		window.event.keyCode = keyNull;
		event.cancelBubble = true;
		event.returnValue = false;
		self.location.reload();
		return false;
	}
	return true;
}
function NoBacks(){
	history.forward();
}
