function trim(strText) {
    // this will get rid of leading spaces
    while (strText.substring(0,1) == ' ')
        strText = strText.substring(1, strText.length);

    // this will get rid of trailing spaces
    while (strText.substring(strText.length-1,strText.length) == ' ')
        strText = strText.substring(0, strText.length-1);

   return strText;
}

/*-----------------------------------------------------
  args: 
	popup name:	name for this window,
	URL		page to display in this window,
	X-dimension	width of window,
	Y-Dimension	height of window,
	scrollbars	1=yes, 0=no
------------------------------------------------------*/
var winPopup
function NewWindow(name, page, x, y, scroll) {
        scroll = (isNaN(scroll)) ? 0:scroll;
	x = (isNaN(x))? 480:x;
	y = (isNaN(y))? 288:y;
	winPopup = window.open(page, name, 'width=' + x + ',height=' + y + ',toolbar=0,menubar=0,resizable=yes,status=0,scrollbars=' + scroll + ',left=100,top=50');
}

function getRadioValue(formName, elementName) {
	radioArray = eval("document." + formName + "." + elementName );
	for(i=0; i<radioArray.length; i++) {
		if(radioArray[i].checked) {
			return radioArray[i].value
		}
	}
	return "";
}

function getSelectValue(formName, elementName) {
	selectObj = eval("document." + formName + "." + elementName );
	i = selectObj.selectedIndex
	return selectObj.options[i].value
}

