/**
* File: util.js
* Description: Common utility functions in javascript.
*/

function changeFieldArea()
{
	objForm = document.forms.FieldAreasForm;
	if (objForm.intFieldAreaID.selectedIndex > 0)
		document.location = objForm.intFieldAreaID.options[objForm.intFieldAreaID.selectedIndex].value;
}
 
// Clears a form
function clearForm(sName)
{
   //alert("..");
   document.forms[sName].reset();
}

// Opens a popup window
function openPopup(sUrl, iWidth, iHeight, iLeft, iTop, sName, bScroll) {
	var pos;
	
	if (sName == "") {
		sName = "popupWindow";
	}
	
	if (bScroll == true) {
		bScroll = 1;
	} else {
		bScroll = 0;
	}
		
   window.open(sUrl, sName, "left=" + iLeft + ",top=" + iTop + ",toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=" + bScroll + ",resizable=0,copyhistory=0,width=" + iWidth + ", height=" + iHeight);
}