


// Retrieve selected list box or drop-down list item 
// frm = name of Form
// itm = name of SELECT box
function getSelect(frm, itm)
{
  if (IE4)
  {
    return document.forms(frm).elements(itm).value;
  }
  else
  {
    return document.forms[frm].elements[itm].options[document.forms[frm].elements[itm].selectedIndex].value;
  }
}  


function validateForm(vForm)
{	


  	for (i=0 ; i<vForm.elements.length; i++)
	{

		if (( vForm.elements[i].name.indexOf("_",0)!=-1) &&  (vForm.elements[i].value==""))
			{ 
				alert("Please anter a value for the "+ vForm.elements[i].display.replace("_","")+" field")
				vForm.elements[i].focus();
				return(false);

			}
	}
			return(true);
}


//================== openWindow =======================
// Opens a page in a pop-up window.
// url = url of web page
// intWidth = width of window
// intHeight = height of window
// intScrollbar = show/hide scrollbar (0 = hide, 1 = show)
function openWindow(url, intWidth, intHeight, intScrollbar)
{
    wintop = (window.screen.availHeight - intHeight)/2;
    winleft = (window.screen.availWidth - intWidth)/2;
    wResult = window.open(url, null, "WIDTH=" + intWidth + ",HEIGHT=" + intHeight + ",SCROLLBARS=" + intScrollbar + ",LEFT=" + winleft + ",TOP=" + wintop);
}
function openWindowBottom(url, intWidth, intHeight, intScrollbar)
{
    wintop = (window.screen.availHeight - intHeight-80);
    winleft = (window.screen.availWidth - intWidth-50);
    wResult = window.open(url, null, "WIDTH=" + intWidth + ",HEIGHT=" + intHeight + ",SCROLLBARS=" + intScrollbar + ",LEFT=" + winleft + ",TOP=" + wintop);
}
