/*************************************************************************
Routine: numeralsOnly

Input: window event

Description: checks the passed in event, if it is a key press of a number then it returns true,
	else it will return false (used to cancel the event) and alert the user to the fact thay they
	can only enter numerals in the given field.
-------------------------------------------------------------------------*/
function numeralsOnly(evt){var charCd = charCode(evt);if(charCd > 31 && (charCd < 48 || charCd > 57)){alert('Enter numerals only in this field.');return false;}return true;}
/*************************************************************************
Routine: lettersOnly

Input: window event

Description: checks the passed in event, if it is a key press of a english letter then it returns true,
	else it will return false (used to cancel the event) and alert the user to the fact thay they
	can only enter english letters in the given field.
-------------------------------------------------------------------------*/
function lettersOnly(evt){var charCd = charCode(evt);if (charCd > 31 && (charCd < 56 || charCd > 90) && (charCd < 97 || charCd > 122)){alert('Enter letters only.');return false;}return true;}
/*************************************************************************
Routine: autoTab

Input: Currnet screen object, the next screen objectID to give focus to, window event.

Description: If the user did not press delete then the code will check to see if the current value is 
	equal to the max length of the owning input box, if so it will set the focus to the passed in
	"next" object.
-------------------------------------------------------------------------*/
function autoTab(field, next, evt){var charCd = charCode(evt);if(charCd > 31 && field.value.length == field.maxLength){var o = document.getElementById(next);try{o.focus();o.select();}catch(e){}}}
/*************************************************************************
Routine: charCode

Input: window event

Description: converts the keyboard event into its given charactor code of use in other javascript functions.
-------------------------------------------------------------------------*/
function charCode(evt){evt=(evt)?evt:event;var charCd=(evt.charCode)?evt.charCode:((evt.keyCode)?evt.keyCode:((evt.which)?evt.which:0));return charCd;}
/*************************************************************************
Routine: openNewWindow

Input: URL

Description: Creates a new browser window and navigates it to the passedin URL.
-------------------------------------------------------------------------*/
var nWin = new Object;nWin.closed = true;
/************************/
function openNewWindow(url){var window_height=600;var window_width=950;var top_point=0;var left_point=0;try{nWin = window.open(url,'_blank','height=' + window_height + ',width=' + window_width + ',top=' + top_point + ',left=' + left_point + ',location=yes, menubar=yes, resizable=yes, scrollbars=yes, status=yes, toolbar=yes,url=yes');}catch(e){alert('Javascript soft error.\nFunction outsideWebPage(address).\nMessage: ' + e.message);}}