function lstUtility_onblur() {
var intIndex;
var strValue = "";
var intSize;
var intUtil_id;

	intSize = document.frmUtility.lstUtility.length;
	frmUtility.lstUtility.options
	for (intIndex = 0; intIndex < intSize; intIndex++){
		if (document.frmUtility.lstUtility.options[intIndex].selected){
			if (strValue == ""){
				strValue = document.frmUtility.lstUtility.options[intIndex].text;
				intUtil_id = document.frmUtility.lstUtility.options[intIndex].value;
			}
			else{
				strValue = strValue + "," + document.frmUtility.lstUtility.options[intIndex].text;
				intUtil_id = intUtil_id + "," + document.frmUtility.lstUtility.options[intIndex].value;
			}				
		}
	}
	document.frmButtons.util_name.value = strValue;
	document.frmButtons.util_id.value = intUtil_id;	
}

function get_timeframe(){
	var intIndex;
	var strValue;

	intIndex = document.frmTimeFrame.lstTimeFrame.selectedIndex;
	strValue = document.frmTimeFrame.lstTimeFrame.options[intIndex].value;
	return strValue;
}


function hide_dates() {
	if (document.layers){
	//if (browser == 0){
		// Netscape
		document.DateBoxes.visibility = "hidden";
	}
	else if (document.all){
		//DateBoxes.style.visibility = "hidden";
		DateBoxes.style.display = "none";
	}
}

	
function show_dates() {
	if (document.layers){
	//if (browser == 0){
		// Netscape
		document.DateBoxes.visibility = "show";		
	}
	else if (document.all){
		//DateBoxes.style.visibility = "visible";
		DateBoxes.style.display = "";
	}
}


function show_hide_dates(){
	if ( get_timeframe() == "daterange"){
		show_dates();
	}
	else {
		hide_dates();
	}
}


function lstTimeFrame_onchange(){
	show_hide_dates();
}


function window_onresize() {
	// Only necessary for netscape.
	show_hide_dates();
}


function submit_onclick() {
	//window.alert("Browse: " + browser);
	if (document.layers){
	//if (browser == 0) { 
		// Netscape
		// Netscape syntax for referring to layers & FORMs
		
		document.frmButtons.start_dt.value = document.DateBoxes.document.frmDateBoxes.txtStart.value;
		window.alert("Start" + document.frmButtons.start_dt.value);
		document.frmButtons.end_dt.value = document.DateBoxes.document.frmDateBoxes.txtEnd.value;
		document.frmButtons.timeframe.value = get_timeframe();
		document.frmButtons.submit();
	}
	else if (document.all){
		// IE
		//window.alert("You picked IE");
		frmButtons.start_dt.value = frmDateBoxes.txtStart.value;
		frmButtons.end_dt.value = frmDateBoxes.txtEnd.value;
		frmButtons.timeframe.value = frmTimeFrame.lstTimeFrame.value;
		frmButtons.submit();
	}
}

function window_onload() {
	if ( DateError == 1 ){	
		show_dates();
		if (document.layers){
		//if (browser == 0) { 
			// Netscape
			document.DateBoxes.document.frmDateBoxes.txtStart.value = StartDt2;
			document.DateBoxes.document.frmDateBoxes.txtEnd.value = EndDt2;
		}
		else if (document.all){
			// IE
			frmDateBoxes.txtStart.value = StartDt2;
			frmDateBoxes.txtEnd.value = EndDt2;
		}
	}
	else{
		show_hide_dates();		
	}
}

