

// Tim Was Here, and again
var popWin = null																// use this when referring to pop-up window
var winCount = 0
var winName = "popWin"
	function openPopWin(winURL, winWidth, winHeight, winFeatures, winLeft, winTop){
		var d_winLeft = 420														// default, pixels from screen left to window left
		var d_winTop = 20														// default, pixels from screen top to window top
																				// winName = "popWin" + winCount++
																				// unique name for each pop-up window
		closePopWin()															// close any previously opened pop-up window
		if (openPopWin.arguments.length >= 4)									// any additional features? 
			winFeatures = "," + winFeatures
		else 
			winFeatures = "" 
			if (openPopWin.arguments.length == 6)								// location specified
				winFeatures += getLocation(winWidth, winHeight, winLeft, winTop)
			else
				winFeatures += getLocation(winWidth, winHeight, d_winLeft, d_winTop)
				popWin = window.open(winURL, winName, "width=" + winWidth
					+ ",height=" + winHeight + winFeatures)
  	}
	function closePopWin(){														// close pop-up window if it is open 
		if (navigator.appName != "Microsoft Internet Explorer" 
			|| parseInt(navigator.appVersion) >=4)								//	do not close if early IE
		if(popWin != null) if(!popWin.closed) popWin.close() 
	}
	function getLocation(winWidth, winHeight, winLeft, winTop){
		return ""
	}
//-->
																				// for Netscape 4+ and IE 4+
<!--
	function getLocation(winWidth, winHeight, winLeft, winTop){
		var winLocation = ""
		if (winLeft < 0)
			winLeft = screen.width - winWidth + winLeft
		if (winTop < 0)
			winTop = screen.height - winHeight + winTop
		if (winTop == "cen")
			winTop = (screen.height - winHeight)/2 - 20
		if (winLeft == "cen")
			winLeft = (screen.width - winWidth)/2
		if (winLeft>0 & winTop>0)
			winLocation =  ",screenX=" + winLeft + ",left=" + winLeft
				+ ",screenY=" + winTop + ",top=" + winTop
		else
			winLocation = ""
		return winLocation
	}
//-->
<!-- Begin
	function popUp(URL) {
		day = new Date();
		id = "OneWinPopupOnly";
		openPopWin(URL, 621, 480, 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1', 140, 20);
																				// eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=621,height=480,left = 160,top = -300');");
	}
// End -->
var persistmenu="yes"															// "yes" or "no". Make sure each SPAN content contains an incrementing ID starting at 1 (id="sub1", id="sub2", etc)
var persisttype="sitewide"														// enter "sitewide" for menu to persist across site, "local" for this page only
	if (document.getElementById){												// DynamicDrive.com change
		document.write('<style type="text/css">\n')
		document.write('.submenu{display: none;}\n')
		document.write('</style>\n')
	}
	function SwitchMenu(obj){
    	if(document.getElementById){
	    var el = document.getElementById(obj);
    	var ar = document.getElementById(obj).getElementsByTagName("span");		// DynamicDrive.com change
        if(el.style.display != "block"){										// DynamicDrive.com change
            for (var i=0; i<ar.length; i++){
                if (ar[i].className=="submenu")									// DynamicDrive.com change
                ar[i].style.display = "none";
            }
            el.style.display = "block";
        }else{
            el.style.display = "none";
        }
    }
}
function get_cookie(Name) { 
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) { 
        offset += search.length
        end = document.cookie.indexOf(";", offset);
        if (end == -1) end = document.cookie.length;
            returnvalue=unescape(document.cookie.substring(offset, end))
        }
    }
    return returnvalue;
}
function onloadfunction(){
if (persistmenu=="yes"){
    var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
    var cookievalue=get_cookie(cookiename)
    if (cookievalue!="")
        document.getElementById(cookievalue).style.display="block"
    }
}
function savemenustate(){
	var inc=1, blockid=""
	while (document.getElementById("sub"+inc)){
    	if (document.getElementById("sub"+inc).style.display=="block"){
        	blockid="sub"+inc
	        break
    	}
	    inc++
	}
	var cookiename=(persisttype=="sitewide")? "switchmenu" : window.location.pathname
	var cookievalue=(persisttype=="sitewide")? blockid+";path=/" : blockid
	document.cookie=cookiename+"="+cookievalue
}
if (window.addEventListener)
	window.addEventListener("load", onloadfunction, false)
else if (window.attachEvent)
	window.attachEvent("onload", onloadfunction)
else if (document.getElementById)
	window.onload=onloadfunction

if (persistmenu=="yes" && document.getElementById)
	window.onunload=savemenustate
