// Javascript functions used by many if not all AutoTime Web reports

// Builds and returns the Dialog argument string for the LOV Popup window.
function fnSetLOVDialogArgs(Height, Width){
	var sFeatures = "dialogHeight: " + Height + "px;" + 
					"dialogWidth: " + Width + "px;" +
					"resizable: yes;" +
					"edge: sunken;" +
					"help: no;" + 
					"status: no;"
	return sFeatures;
}

// Returns the value of a Text field or a Dropdown field that returns one item
function fnGetFieldValue(Field) {
	switch(Field.type) {
	case "text" :
	    // trim the value returned
		return Field.value.replace(/^\s+|\s+$/g, '');
		break;

	case "select-one" :
		var i = Field.selectedIndex;

		if (i == -1)
			return "";
		else
			return (Field.options[i].value == "") ? Field.options[i].text : Field.options[i].value;
		break;

	default:
		return "";
		break;
   }
}

// Prints the current web page.
function fnPrintPage(that){
      that.style.display='none';
      window.print(); 
      that.style.display='';
} 