/**
 * Performs the onclick event of the the calling object from an onkeypress 
 * event to prevent from having to duplicate the onclick event call.  This
 * function looks for a keypress of the enter key.  This was originally
 * added due to an issue in FireFox where the browser treated the Tab key
 * as an alphanumeric.
 * 
 * <p><u>author(s)</u><br/>
 * unknown 11/03/2009 Initial version.<br/>
 * </p>
 * 
 * @param evt event of calling object used to 
 * @param obj object with onkeypress
 */
function performObjOnclick(evt, obj) {
	if (isEnterKeyPressed(evt)) {
		try {$(obj).click()} catch(error) {};
	} 
}

function isEnterKeyPressed(evt) {
	return isKeyPressed(evt, 13);
}

function isKeyPressed(evt, checkForCharCode) {
	var isPressed = false;
	evt = (evt) ? evt : (window.event) ? event : null;
	if (evt) {
		var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode :((evt.which) ? evt.which : 0));
		if (charCode == checkForCharCode) isPressed=true;
	}
	return isPressed;
}