<!--
	/* ///////////////////////////////////////////////////////////////////////////////////////////
	* Purpose:  submitForm prepares a specified DOM form element for submission by setting the
	* action, target, and method attributes and then submits the form.
	* 
	* Parameters:  
	*				formID:  The DOM string identifying the form
	*				formAction:  Sets or retrieves the URL to which the form content is sent for processing.
	*				formTarget:  Sets or retrieves the window or frame at which to target content
	*				formMethod:  Sets or retrieves the name of the form
	*/ ///////////////////////////////////////////////////////////////////////////////////////////
	function submitForm(formID, formAction, formTarget, formMethod)
	{
		// Check for the form element in the document.
		if (formID != "")
		{
			var documentForm = document.getElementById(formID);
			
			// Proceed with setting the form properties using the values of the function parameters.
			if (documentForm != null)
			{
				// Set the form action attribute.
				if (formAction != "")
				{
					documentForm.action = formAction;
				}
				// Set the form target attribute.
				if (formTarget != "")
				{
					documentForm.target = formTarget;
				}
				// Set the form method attribute.
				if (formMethod != "")
				{
					documentForm.method = formMethod;
				}
				
				// Submit the form.
				documentForm.submit();
			}
		}
				
		return;
	}
	
	/* ///////////////////////////////////////////////////////////////////////////////////////////
	 * Purpose:  This function spawns a new browser window with a customized parameter list. 
	 * 
	 * Parameters:  windowName:  The name to assign to the browser window.
	 *				windowPath:  The URL for the new window.
	 *				windowOpenString:  The parameters for the new browser window.
	*/ ///////////////////////////////////////////////////////////////////////////////////////////
	function spawnNewWindow(windowName, windowPath, windowOpenString)
	{
		// Spawn the browser window and return the newly opened window's handle.
		return (window.open(windowPath, windowName, windowOpenString)); 
	}
	
	/* ///////////////////////////////////////////////////////////////////////////////////////////
	 * Purpose:  This function spawns a new resizable browser window for viewing and printing reports.
	 * 
	 * Parameters:  windowName:  The name to assign to the browser window.
	 *				windowPath:  The URL for the new window.
	*/ ///////////////////////////////////////////////////////////////////////////////////////////
	function spawnNewPrintingWindow(windowName, windowPath)
	{
		var windowOpenString = "toolbar=yes,width=600,height=600,left=0,top=0,status=no,scrollbars=yes,menubar=yes,location=no,resizable=yes,directories=no"; 
		// Spawn the light browser window and return the newly opened window's handle.
		return (window.open(windowPath, windowName, windowOpenString)); 
	}
	
	/* ///////////////////////////////////////////////////////////////////////////////////////////
	 * Purpose:  The current window is refreshed.
	 * 
    */ ///////////////////////////////////////////////////////////////////////////////////////////
	function refreshCurrentWindow()
	{
		window.location.href = window.location;
	}
	
	/* ///////////////////////////////////////////////////////////////////////////////////////////
	 * Purpose:  This function allows the user to cancel the window closing event.
	 * 
	 * Parameters:  message:  A custom message to display to the user.
	*/ ///////////////////////////////////////////////////////////////////////////////////////////
	function confirmWindowClosing(message)
	{
		event.returnValue = message;
	}	
	
	var VIEWPORT_X_DIMENSION_INDEX = 0;
	var VIEWPORT_Y_DIMENSION_INDEX = 1;
	
	/* ///////////////////////////////////////////////////////////////////////////////////////////
	 * Purpose:  This function retrieves the dimensions of the current client viewport.
	 * 
	*/ ///////////////////////////////////////////////////////////////////////////////////////////	
	function getWindowClientDimensions()
	{
		var dimensionArray = new Array(0,0);
		
		// All browsers except IE
		if (self.innerHeight)
		{
			dimensionArray[0] = self.innerWidth;
			dimensionArray[1] = self.innerHeight;
		}
		// Internet Explorer Strict Mode:
		else if (document.documentElement && document.documentElement.clientHeight)
		{
			dimensionArray[0] = document.documentElement.clientWidth;
			dimensionArray[1] = document.documentElement.clientHeight;
		}
		// Internet Explorer Other:
		else if (document.body)
		{
			dimensionArray[0] = document.body.clientWidth;
			dimensionArray[1] = document.body.clientHeight;
		}	
		
		return dimensionArray;
	}
	
	/* ///////////////////////////////////////////////////////////////////////////////////////////
	* Purpose:  alterImageOpacity sets the opacity for a specified image using a cross-browser
	*			approach.
	* 
	* Parameters:  
	*				image:  The DOM reference to the image to alter
	*				opacity:  The new opacity setting (specified in decimal format 
	*						  e.g., 0.10 = 10% opaque
	*/ ///////////////////////////////////////////////////////////////////////////////////////////		
	function alterImageOpacity(image, opacity)
	{
		if (image != null)
		{
			// Set the style attributes for the various browsers.
			image.style.opacity = opacity;
			image.style.MozOpacity = opacity;
			image.style.KhtmlOpacity = opacity;
			
			// IE requires the use of a filter to alter the opacity.  The filter expects a value
			// between 1 and 100.
			if (opacity < 1)
			{
				opacity*=100;
			}
			image.style.filter = "alpha(opacity=" + opacity + ")"; 	
		}
	}
	
	/* ///////////////////////////////////////////////////////////////////////////////////////////
	* Purpose:  displayObjectSummary is a useful function which displays the current style attributes
	*			for a DOM element via an alert message.
	* 
	* Parameters:  
	*				element:  The DOM reference to the object of interest
	*/ ///////////////////////////////////////////////////////////////////////////////////////////		
	function displayObjectSummary(element)
	{
		if (element != null)
		{
			var summary = "LEFT:" + element.style.left + " TOP:" + element.style.top + " WIDTH:" + element.style.width + " HEIGHT:" + element.style.height;
			alert(summary);
		}
	}
-->
