
function popWin(deeURL, namen, w, h) 
{
	var newWin = window.open( deeURL, namen, "toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,width=" + w + ",height=" + h + ",resizable=yes" );
	newWin.focus();
	newWin.visibility = "visible";
	window.status = "";
	return true;
}

function focusFirstField()
{
	//try to find the first user input type form field on the first available form and set focus on it
	for (x=0; x < document.forms.length; x++)
	{
		zForm = document.forms[x];
		for (y=0; y < zForm.elements.length; y++)
		{
			zElem = zForm.elements[y];
			if (zElem.type != "hidden") //can't focus on a hidden
			{
				zElem.focus();
				if (zElem.type != "button" && zElem.type != "reset" && zElem.type != "submit"  && zElem.type.indexOf("select") < 0)
					zElem.select(); //can't select on the above types (or you can but it looks terrible)
				break;
			}
		}
	}
}

// test the browser for ie or nets version 3 or greater
if ((navigator.appVersion.substring(0,1) >= 3) && 
	(navigator.appName == ("Netscape") || 
	(navigator.appName == "Microsoft Internet Explorer"))) {
	// build the array for on images (when mouseover) and off
	    offImages = new Array();
	    onImages = new Array();
	    for (var i = 0; i<= 9; i++) {
	        offImages[i] = new Image();
	        offImages[i].src = "images/topnav/n" + i + "d.gif";
	        onImages[i] = new Image();
	        onImages[i].src = "images/topnav/n" + i + "s.gif";
	    }
}
// swap to the on images when mouseover
function select(i) {
	if (document.images) {
	    var itemname = "n" + i;
	    document.images[itemname].src = onImages[i].src;
	}
}
// swap to the off images when mouseout
function deselect(i) {
	if (document.images) {
	    var itemname = "n" + i;
	    document.images[itemname].src = offImages[i].src;

	}
}