function goToUrl(url) {
	disableButtons();
	this.window.name="currentWindow";
	var childWindow = window.open(url,this.window.name,"",false); //add entry to browser history
}

/** The p_object parameter is the object that called
 *  this function (i.e., send 'this' (without the quotes)
 *  as a parameter).  If the object calling this function
 *  is determined to be a submit button, the form is not
 *  submitted via this function, thus preventing the form
 *  from being submitted twice.
 */
function submitMyForm(p_object){
	
	p_object.submit();
	
}

function submitForm(p_object, p_actionType)
{

	p_object.actionType.value = p_actionType;	
	p_object.submit();
/*	
	for (n=0; n<document.forms.length;n++){
		document.forms[n].actionType.value = p_actionType;
		if (p_object.type != 'submit')
		{
			//only submit if the calling object is not a submit button
			disableButtons();
			document.forms[n].submit();
		}	
	}
*/
}

function isBlank(strValue)
{
	if (strValue == null ||  strValue == "")
	{
		return true;
	} //end if

	return false;
}

// Runs through the all elements on the form,
// disabling all buttons.
// Note that we assume one form per page.  Throughout
// all of the functions in this JavaScript file, it is
// assumed that the submitted form is the only form, thus
// the references to forms[0].  Should we ever move away
// from this assumption, add an extra loop in this function
// to go through all forms in the document.

// 5/16/06 Added second loop becuase we can no longer assume one form per page!
function disableButtons(){}

function _disableButtons()
{
	for (j=0; j<document.forms.length;j++){		
		if (document.forms.length == 0
		||  document.forms[j].elements.length == 0)
		{
			return;
		}
		for (i=0; i<document.forms[j].elements.length;i++)
		{
			var form_element = document.forms[j].elements[i];
			if (form_element.type == 'submit'
			||  form_element.type == 'button')
			{
				form_element.disabled = 'true';
			}
		}	
	}
}

// This function should be called in the onSubmit attribute
// of the form tag for all JSPs.  It is an opportunity to handle
// any client-side JS necessary as the form is being submitted
// to the server.
function formOnSubmit()
{
	disableButtons();

	return true;
} //end formOnSubmit

// Used in the error page to show more details when needed
function toggleDisplayById(id){
	if(document.getElementById(id).style.display=="") {
		document.getElementById(id).style.display = "none";
	} else {
		document.getElementById(id).style.display = "";
	}
}


