/******************************
*  Vellum Court Functions     *  
*******************************/

/**
* highlight selected header tab 
*/
function highlight_tab(navItem) {
  if (navItem.length > 0) {
    myElement = document.getElementById(navItem);
    myElement.className = "current";
  }                  
}
/**
* submit a form 
* @param string formName name of form to be submitted
* @param string command optional parameter to modify the value of a hidden field called 'cmd', which represents the
* action to be taken
* @param string method GET or POST to submit the form
* @return boolean
*/
function submitForm(formName,command,method) {
  if(command){
    document.forms[formName].elements["cmd"].value = command;
  }
  if(method){
    document.forms[formName].method = method;
  }
  document.forms[formName].submit();
  return false;
}
/**
* check if the enter key has been pressed in an input field and submit form 
* @param string formName name of form to be submitted
* @param string command optional parameter to modify the value of a hidden field called 'cmd', which represents the
* action to be taken
*/
function checkForEnter(evt,formName,command) {
	evt = (evt) ? evt : event;
	var charCode = (evt.charCode) ? evt.charCode : ((evt.which) ? evt.which : evt.keyCode);
	if (charCode == 13) {
    if(command){
      document.forms[formName].elements["cmd"].value = command;
    }    
    document.forms[formName].submit();
		return false;
	}
	return true;
}
