  // Menu functions
  var boolNS4 = navigator.appVersion.indexOf("Nav") > 0 && parseInt(navigator.appVersion) == 4;
	
  function GetElement(strElement) {
    if (document.getElementById) return (document.getElementById(strElement))  // IE5+, Netscape 6, Mozilla
    else if (document.all) return (eval("document.all." + strElement))  // IE4
    else if (document.layers) return (eval("document." + strElement))  // Netscape 4
    else return (null)  // Crap!
  }
	
  function toggleDesc(strProgramID,obj) {
	if(boolNS4) return false;
    objCurrentLink = GetElement("UML"+strProgramID+"LINK");
    if (objCurrentLink != null) {
		clsName = obj.className.substring(0,6)
		clsExt = obj.className.substring(6,7)
		if (clsExt=="a") {
			objCurrentLink.style.display = "block"
			obj.className = clsName+"b"
            openList = getCookie("openList")
            if (openList == null) openList =""
            if (openList.indexOf(strProgramID) == -1) {
              openList = openList + strProgramID + ","
               setCookie("openList", openList)
            }
	 	}
		else {
			objCurrentLink.style.display = "none"
			obj.className = clsName+"a"
	        num = ""+strProgramID
	        if (openList.indexOf(num) != -1) { // If ID exists in openList
	          numLen = num.length
	          numPos = openList.indexOf(num)
	          toTheLeft = openList.substring(0, numPos);
	          toTheRight = openList.substring(numPos+numLen+1, openList.length);
	          openList = toTheLeft + toTheRight;
	          setCookie("openList", openList)
	        }
		}
	}	   
  }

  function initMenu() {
    openList = getCookie("openList")
    if (openList != null) {
      var ids = openList.split(",")
      for (var i = 0; i < ids.length; ++i) {
        objCurrentLink = GetElement("UML"+ids[i]+"LINK");
        if (objCurrentLink != null) {
          obj = GetElement("UML"+ids[i]+"IMG");
  		  clsName = obj.className.substring(0,6)
		  obj.className = clsName+"b"
          objCurrentLink.style.display = "block"
        }
      }
    }
  }
  
    // Cookie functions
  function setCookie(name, value, expires, path, domain, secure) {
    var curCookie = name + "=" + escape(value) +
    ((expires) ? "; expires=" + expires.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "")
    document.cookie = curCookie
  }
	
  function getCookie(name) {
    var prefix = name + "="
    var cookieStartIndex = document.cookie.indexOf(prefix)
    if (cookieStartIndex == -1) return null
    var cookieEndIndex = document.cookie.indexOf(";", cookieStartIndex + prefix.length)
    if (cookieEndIndex == -1) cookieEndIndex = document.cookie.length
    return unescape(document.cookie.substring(cookieStartIndex + prefix.length, cookieEndIndex))
  }

