<!--    // hide from old browsers

	//generic function to open a page in a new browser window...
	function newWindow4(url, windowName, width, height)
	{
		var size = "width=" + width + ",height=" + height;
		var chrome = "top=20,left=20,scrollbars=1,title=0,address=0,status=0,toolbar=0,resizable=1," + size;
		var windo = window.open(url, windowName, chrome)
		windo.focus();
	}

	function findFormControl(idName)
	{
		var fld = findFormControlNoAlert(idName);
		if (!fld)
			alert("Cannot find the " + idName + " control??");
		return fld;
	}


	//generic "findControl" function...
	function findFormControlNoAlert(idName)
	{
		var frm = document.forms[0];
		var tlen = idName.length;
		//alert("There are " + frm.elements.length + " elements in this form.");
		for (var ii = 0; ii < frm.elements.length; ii++)
		{
			var fld = frm.elements[ii];
			var id = fld.id;
			//alert("checking element id=" + id);
			var len = id.length;
			if (len >= tlen)
			{
				if (id.substr(len - tlen) == idName)
				{
					//alert("id=" + idName + " found!");
					return fld;
				}
			}
		}
		return null;
	}

	var divNameOpen = ""; // id (name) of the "open" hidden div
	var showGrayOverlay = false; // only do this if specified

	// function to display specified hidden div (without gray overlay)
	function showDiv(divName)
	{
		showGrayOverlay = false;
		//alert("@showDiv(" + divName + ") : divOpen=" + divNameOpen);
		if (divNameOpen != "")
		{
			if (divName == divNameOpen)		// if div is already visible
				return;						// don't do anything
			hideDiv(divNameOpen); 	// else hide the currently-open div
		}
		var divobj = getFieldByID(divName)
		if (!divobj)
		    alert("could not find div: " + divName);
		else
		{
		    //alert("found div!!")
			//divobj.style.display = "block";
			$ ( '#' + divobj.id ).fadeIn();
			divNameOpen = divName; 	// remember name of open div
			//alert("div " + divName + "should be open!");
		}
	}

	// function to display hidden div and also display the gray background overlay
	function showDivWithOverlay(divName)
	{
		//alert("@showDivWithOverlay(" + divName + ") : divOpen=" + divNameOpen);
		showDiv(divName);
		showOverlay(true); // this will set the global variable: showGrayOverlay 
	}

	var g_scrollBackPosition = 0; // used to return scroll position back prior to when moved to show "special" divs
	
	// function to hide specified div and also hide the gray background overlay
	function hideDiv(divName)
	{
		if (divName == '') 
			divName = divNameOpen;
		//alert("@hideDiv(" + divName + ")");
		var divobj = getFieldByID(divName)
		if (!divobj)
		    alert("div " + divName + " not found");
	    else
	    {
			//divobj.style.display = "none";
			$ ( '#' + divobj.id ).fadeOut();
			divNameOpen = "";
			if (showGrayOverlay)
				showOverlay(false); // hide the overlay & reset the global variable: showGrayOverlay
		}
		//if (g_scrollBackPosition != 0)
		//	window.scrollBy(0, g_scrollBackPosition);
	}

	function showOverlay(show)	// boolean to show or hide the gray overlay
	{
		//alert("@showOverlay:show=[" + show + "]");
		var fld = getFieldByID('WindowOverlay');
		if (fld != null)
		{
			//show only if the browser supports opacity
			if ('opacity' in document.documentElement.style)
			{
				if (show)
				{
					var objDiv = getFieldByID('aspnetForm'); //'contentMain');
					if (objDiv != null)
					{
						var fullHeight = objDiv.offsetHeight;
						//alert("setOverlayFullHeight="+fullHeight);
						fld.style.height = fullHeight + "px"; 	// set height of the overlay to entire page height
					}
				}
				showGrayOverlay = show; 	// keep track if this is currently open
				if (show)
					show = 'block';
				else
					show = 'none';
				//alert("ShowingOverlay:style.display=[" + show + "]");
				fld.style.display = show;
			}
		}
	}

	function getASPFieldByID(ID)		// finds typical page fields
	{
		return getFieldByID("ctl00_ContentPlaceHolder1_" + ID);
	}

	function getFieldByID(ID)
	{
		var fld = document.getElementById(ID);
		if (!fld)
			alert(ID + " field is missing - please contact us.");
		return fld;
	}

	var fldToSetFocus; 		// global
	function setFieldFocus(fld)
	{
		fldToSetFocus = fld;
		setTimeout("fldToSetFocus.focus();", 1);
		//setTimeout("fld.focus();", 1);	// this fails, must use reference to a global variable
	}
	// end cloak -->

