<!-- 
// retrieve element by ID
function getElement(id) {
	if (document.getElementById) {
		return document.getElementById(id);
	}
	else if (document.all)   {
		return document.all[id];
	}
	else if (document.layers)  {
	 	return document.layers[id];
	}
}

function toggleMe(theid){
	var el = getElement(theid);
	el.style.display = (el.style.display == 'none') ? '' : 'none';
}

function openMe(theid){
	var el = getElement(theid);
	el.style.display = '';
}

function closeMe(theid){
	var el = getElement(theid);
	el.style.display = 'none';
}


// toggle the display style to hide/reveal an element with a certain id
function toggleShow(id,displayVal) {
	var element;
	
	element = getElement(id);
		
	if (element) {
		if (document.layers) {
			value = (displayVal) ? "visible" : "hidden";
			element.visibility=value;
		}else {
			value = (displayVal) ? "block" : "none";
			element.style.display=value;
		}
	}
}

// Help alert box for table object pages
function launchHelp(perpage){
	var msg = "Leave search fields blank to show all records.\n\n\nClick on column names to sort by column.\n\n\nResults are displayed "+perpage+" at a time. To display all results, click the 'show all results' link.\n\n\nClick the export button to export results to a textfile. If you are viewing in page mode, only results on the current page will be exported.";		
	alert(msg);
}


// Generic PopUp Script
function popUp(height,width,scrollbar,page) {
	var winopts = "resizable=yes,location=no,status=no,directories=no,scrollbars=" + scrollbar + ",menubar=no,toolbar=no,height=" + height + ",width=" + width;
	window.open(page,'',winopts);
}



// get a style property (needeed for non-inline style properties)
function getStyleProp(elementID,styleProp)
{
	var x = getElement(elementID);
	if (window.getComputedStyle)
		var y = window.getComputedStyle(x,null).getPropertyValue(styleProp);
	else if (x.currentStyle)
		var y = eval('x.currentStyle.' + styleProp);
	return y;
}



function URLEncode(plaintext)
{
	// The Javascript escape and unescape functions do not correspond
	// with what browsers actually do...
	var SAFECHARS = "0123456789" +					// Numeric
					"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +	// Alphabetic
					"abcdefghijklmnopqrstuvwxyz" +
					"-_.!~*'()";					// RFC2396 Mark characters
	var HEX = "0123456789ABCDEF";

	//var plaintext = document.URLForm.F1.value;
	var encoded = "";
	for (var i = 0; i < plaintext.length; i++ ) {
		var ch = plaintext.charAt(i);
	    if (ch == " ") {
		    encoded += "+";				// x-www-urlencoded, rather than %20
		} else if (SAFECHARS.indexOf(ch) != -1) {
		    encoded += ch;
		} else {
		    var charCode = ch.charCodeAt(0);
			if (charCode > 255) {
			    alert( "Unicode Character '" 
                        + ch 
                        + "' cannot be encoded using standard URL encoding.\n" +
				          "(URL encoding only supports 8-bit characters.)\n" +
						  "A space (+) will be substituted." );
				encoded += "+";
			} else {
				encoded += "%";
				encoded += HEX.charAt((charCode >> 4) & 0xF);
				encoded += HEX.charAt(charCode & 0xF);
			}
		}
	} // for

	//document.URLForm.F2.value = encoded;
	return encoded;
	//return false;
};



//-->