/* *
 * Automatically execute these functions
 * */

function OnLoad()
{

	AutomaticPopup();

}

/* *
 * Automatically Open Popup
 * */

function AutomaticPopup()
{

	var searchString = document.location.search;
	
	searchString = searchString.substring(1);
	
	var nvPairs = searchString.split("&");
	
	for (i = 0; i < nvPairs.length; i++)
	{
		var nvPair = nvPairs[i].split("=");
		
		if (nvPair[0] == 'popup')
		{
		
			Popup(nvPair[1]);
			
		}
		
	}
			 
}

/* *
 * Submit Form
 * */

function FormSubmit(formname, elementname, elementvalue)
{
	
	document.forms[formname].elements[elementname].value = elementvalue;
	
	document.forms[formname].submit();

}

/* *
 * Expand Popup
 * */
 
var current_popup;
 
function Popup(id)
{

	object = window.document.getElementById(id).style;
	
	if (object.display == "block")
	{
	
		object.display = "none";
		
		current_popup = '';
		
	} else {
		
		if (document.getElementById(current_popup))
		{
		
			document.getElementById(current_popup).style.display = "none";
			
		}
		
		object.display = "block";
		
		current_popup = id;
		
	}

}