/*
** Store  Javascript Form utilities functions.
**
*/

function submitForm(formName) {
	document.forms[formName].submit();
}

function loadPage(ListBox, url, argName) {
	var argValue = "";
	
	for (var i = 0; i < ListBox.length ;i++){
		if (ListBox.options[i].selected) {
			argValue = ListBox.options[i].value;
			break;
		}
	}

	if (argName.length == 0) // Use a friendly type url.
		window.location = url + "/" + argValue;
	
	else 
		window.location = url + "?" + argName + "=" + argValue;
}

function popUp(URL, toolBar, scrollBars, Location, statusBar, menuBar, Resizable, winWidth, winHeight) {
	var day = new Date();
	var id = day.getTime();
	
	var strWin = "page" + id + " = window.open(";
	strWin += "URL, '" + id + "', '";
	strWin += "toolbar=" + toolBar + ",";
	strWin += "scrollbars=" + scrollBars + ",";
	strWin += "location=" + Location + ",";
	strWin += "statusbar=" + statusBar + ",";
	strWin += "menubar=" + menuBar + ",";
	strWin += "resizable=" + Resizable + ",";
	strWin += "width=" + winWidth + ",height=" + winHeight + ",";
	strWin += "left = 400,top = 250');"
	
	eval(strWin);
}

function showHideContent(id, showdiv) {
	var elem = document.getElementById(id);

	if (elem) {
		if (showdiv) {
			elem.style.display = 'block';
			elem.style.visibility = 'visible';

		} else {
			elem.style.display = 'none';
			elem.style.visibility = 'hidden';
		}
	}
}        

