var strSessionID;

strSessionID = location.search;

if (strSessionID.indexOf ("id=") != -1 && strSessionID.indexOf ("&") != -1)
   {
      strSessionID = strSessionID.substring (0, strSessionID.indexOf ("&"))
   }

if ((navigator.appName != "Netscape" && navigator.appVersion.substring(0, 4) > "3") || (navigator.appName == "Netscape" && navigator.appVersion.substring(0, 4) > "5"))
   {
      var timerID = "global";

      if (navigator.appName == "Netscape" || sniffBrowser("opera"))
         {
            document.write ("<table cellpadding=\"3\" cellspacing=\"2\" width=\"200\" border=\"1\" id=\"resourcesmenu\" onMouseOver=\"menu('resources')\" onMouseOut=\"menuout()\" style=\"visibility: hidden; position: absolute; background-color: #ffffff\">");
         }
      else
         {
            document.write ("<table cellpadding=\"3\" cellspacing=\"2\" width=\"200\" border=\"0\" id=\"resourcesmenu\" onMouseOver=\"menu('resources')\" onMouseOut=\"menuout()\" class=\"menutable\" style=\"visibility: hidden; position: absolute; background-color: #ffffff\">");
         }

      document.write ("   <tr>");
      document.write ("      <td class=\"menu\" onMouseOver=\"menucolor('annualreports')\" onMouseOut=\"menucolorout('annualreports')\" id=\"annualreports\"><a href=\"/scripts/english/resources/annualreports.asp\">Annual Reports</a></td>");
      document.write ("   </tr>");
      document.write ("   <tr>");
      document.write ("      <td class=\"menu\" onMouseOver=\"menucolor('brochures')\" onMouseOut=\"menucolorout('brochures')\" id=\"brochures\"><a href=\"/scripts/english/resources/brochures.asp\">Brochures</a></td>");
      document.write ("   </tr>");

	  document.write ("   <tr>");
      document.write ("      <td class=\"menu\" onMouseOver=\"menucolor('policy')\" onMouseOut=\"menucolorout('policy')\" id=\"policy\"><a target=\"_blank\" href=\"/english/docs/publications/Health_Boards_Complaint_Policy.pdf\">Public Complaints Policy</a></td>");
      document.write ("   </tr>");

	  
      document.write ("</table>");


   }

function menucolor (menuitem)
   {
      if ((navigator.appName != "Netscape" && navigator.appVersion.substring(0, 4) > "3") || (navigator.appName == "Netscape" && navigator.appVersion.substring(0, 4) > "5"))
         {
            document.getElementById(menuitem).style.backgroundColor="#dddddd";
            document.getElementById(menuitem).style.borderColor="#808080";
         }
   }

function menucolorout (menuitem)
   {
      if ((navigator.appName != "Netscape" && navigator.appVersion.substring(0, 4) > "3") || (navigator.appName == "Netscape" && navigator.appVersion.substring(0, 4) > "5"))
         {
            document.getElementById(menuitem).style.backgroundColor="#ffffff";
            document.getElementById(menuitem).style.borderColor="#ffffff";
         }
   }

function menu (section)
{
	
      if ((navigator.appName != "Netscape" && navigator.appVersion.substring(0, 4) > "3") || (navigator.appName == "Netscape" && navigator.appVersion.substring(0, 4) > "5"))
         {
            clearTimeout(timerID);
            menuoutout();
            document.getElementById(section+"menu").style.visibility="visible";
            document.getElementById(section+"menu").style.left=getLeftPosition(document.getElementById(section)) - 7;

            if (section == "aboutus")
               {
                  document.getElementById(section+"menu").style.left=document.getElementById(section).offsetLeft+2;
               }

            document.getElementById(section+"menu").style.top=getTopPosition(document.getElementById(section)) + 16;
         }
   }

function menuout ()
   {
      if ((navigator.appName != "Netscape" && navigator.appVersion.substring(0, 4) > "3") || (navigator.appName == "Netscape" && navigator.appVersion.substring(0, 4) > "5"))
         {
            clearTimeout(timerID);
            timerID = setTimeout("menuoutout ()", 500);
         }
   }

function menuoutout ()
   {
      document.getElementById("resourcesmenu").style.visibility="hidden";
      document.getElementById("resourcesmenu").style.left=0;
      document.getElementById("resourcesmenu").style.top=0;

   }

function sniffBrowser(browser)
   {
      var sniff = navigator.userAgent.toLowerCase();
      return sniff.indexOf(browser) + 1;
   }

function getLeftPosition(objx) {
var curleft = 0;
   if (objx.offsetParent) {
    while (1) {
        curleft += objx.offsetLeft;
        if (!objx.offsetParent) {
            break;
            }
            objx = objx.offsetParent;
        }
    } else if (objx.x) {
        curleft += objx.x;
        return curleft;
    }
    return curleft;
}

function getTopPosition(objx) {
var curtop = 0;
   if (objx.offsetParent) {
    while (1) {
        curtop += objx.offsetTop;
        if (!objx.offsetParent) {
            break;
            }
            objx = objx.offsetParent;
        }
    } else if (objx.x) {
        curtop += objx.x;
        return curtop;
    }
    return curtop;
}


function openAWindow( pageToLoad, winName, width, height, center) {				 
    xposition=0; yposition=0;
    if ((parseInt(navigator.appVersion) >= 4 ) && (center)){
        xposition = (screen.width - width) / 2;
        yposition = (screen.height - height) / 2;
    }
    args = "width=" + width + "," 
    + "height=" + height + "," 
    + "location=0," 
    + "menubar=0,"
    + "resizable=1,"
    + "scrollbars=1,"
    + "status=0," 
    + "titlebar=0,"
    + "toolbar=0,"
    + "hotkeys=0,"
    + "screenx=" + xposition + ","  //NN Only
    + "screeny=" + yposition + ","  //NN Only
    + "left=" + xposition + ","     //IE Only
    + "top=" + yposition;           //IE Only

    window.open( pageToLoad,winName,args );
}
