<!--

// Browser
NS6 = (document.getElementById&&!document.all);
IE = (document.all);
NS = (navigator.appName=="Netscape" && navigator.appVersion.charAt(0)=="4");

// worker functions
moving=setTimeout('null',1)
function MoveOut()
{
   if ( ( NS6 && parseInt(lyrStyle.left) < 0) || (IE && lyrStyle.pixelLeft < 0)
        || (NS && lyrStyle.left < 0))
   {
      clearTimeout(moving);
      moving = setTimeout('MoveOut()', slideSpeed);
      if (NS6)
      {
         theleft += 10;
         lyrStyle.left = theleft;
      }
      if (IE)
      {
         lyrStyle.pixelLeft += 10;
      }
      if (NS)
      {
         lyrStyle.left += 10;
         lyrStyle.clip.left -= 10;
      }
   }
   else
   {
      clearTimeout(moving);
      moving = setTimeout('null', 1);
   }
};

function MoveBack()
{
   clearTimeout(moving);
   moving = setTimeout('MoveBack1()', waitTime);
};

function MoveBack1()
{
   if ((NS6 && parseInt(lyrStyle.left) > (-menuWidth))
        || (IE && lyrStyle.pixelLeft > (-menuWidth))
        || (NS && lyrStyle.left > (-menuWidth)))
   {
      clearTimeout(moving);
      moving = setTimeout('MoveBack1()', slideSpeed);
      if (NS6)
      {
         theleft -= 10;
         lyrStyle.left = theleft;
      }
      if (IE)
      {
         lyrStyle.pixelLeft -= 10;
      }
      if (NS)
      {
         lyrStyle.left -= 10;
         lyrStyle.clip.left += 10;
      }
   }
   else
   {
      clearTimeout(moving);
      moving = setTimeout('null', 1);
   }
};

// make static
lastY = 0;
function makeStatic()
{
   if (IE)
   {
      winY = document.body.scrollTop;
   }
   if (NS || NS6)
   {
      winY = window.pageYOffset;
   }
   if (NS6 || IE || NS)
   {
      if (winY != lastY && winY > YOffset - staticYOffset)
      {
         smooth = 0.3 *(winY - lastY - YOffset + staticYOffset);
      }
      else if (YOffset - staticYOffset + lastY > YOffset - staticYOffset)
      {
         smooth = 0.3*(winY - lastY);
      }
      else
      {
         smooth = 0;
      }
      if (smooth > 0)
         smooth = Math.ceil(smooth);
      else
         smooth = Math.floor(smooth);
      if (NS6)
         lyrStyle.top = parseInt(lyrStyle.top) + smooth;
      if (IE)
         lyrStyle.pixelTop += smooth;
      if (NS)
         baseLyr.top += smooth;
      lastY = lastY + smooth;
      setTimeout('makeStatic()', 1);
   }
}

// load menu
function InitSlide()
{
   if (NS6)
   {
      lyrStyle = document.getElementById("div_nm").style;
      lyrStyle.visibility = "visible";
      lyrStyle.left = -menuWidth;
   }
   else if (IE)
   {
      lyrStyle = document.all("div_nm").style;
      lyrStyle.visibility = "visible";
      lyrStyle.pixelLeft = -menuWidth;
   }
   else if (NS)
   {
      baseLyr = document.layers["lyr_nm1"];
      lyrStyle = baseLyr.document.layers["lyr_nm2"].document.layers["div_nm"];
      lyrStyle.clip.left = menuWidth;
      lyrStyle.left = -menuWidth;
      lyrStyle.visibility = "show";
   }
   if (menuIsStatic == "yes")
      makeStatic();
}

// build menu
function StartMenu(menuHeader, barText)
{
   if (IE || NS6)
   {
      document.write('<DIV ID="div_nm" style="visibility:hidden;Position : Absolute ;Left : 0 ;Top : '
         + YOffset + ' ;Z-Index : 20;width:1px;clip:" onmouseover="MoveOut()" onmouseout="MoveBack()">');
   }
   if (NS)
   {
      document.write('<LAYER name="lyr_nm1" top="' + YOffset +
                     '" LEFT=0 visibility="show" width="' + (menuWidth + barWidth + 10) +
                     '"><ILAYER name="lyr_nm2" width="' + (menuWidth + barWidth + 20) +
                     '"><LAYER visibility="hide" name="div_nm" bgcolor="' + menuBGColor +
                     '" left="0" onmouseover="MoveOut()" onmouseout="MoveBack()">');
   }
   if (NS6)
   {
      document.write('<table border="0" cellpadding="0" cellspacing="0" width="' +
                     (menuWidth + barWidth + 2) + '" bgcolor="' + menuBGColor +
                     '"><TR><TD>');
   }
   document.write('<table border="0" cellpadding="0" cellspacing="1" width="' +
                  (menuWidth + barWidth + 2) + '" bgcolor="' + menuBGColor + '">');
   tempBar = '';
   AddHdr(menuHeader);
   if (barText.indexOf( '<IMG' ) > -1)
   {
      tempBar = barText;
   }
   else
   {
      for (i = 0; i < barText.length; i++)
      {
         tempBar += barText.substring(i, i + 1) + "<BR>";
      }
   }
   document.write('<td align="center" rowspan="100" width="' + barWidth + '" bgcolor="' +
                   barBGColor + '" valign="' + barVAlign + '" halign="' + barHAlign +
                   '"><p align="center"><font face="' + barFontFamily + '" Size="' +
                   barFontSize + '" COLOR="' + barFontColor + '"><B>' + tempBar +
                   '</B></font></p></TD></tr>');
   theleft = -menuWidth;
}

function EndMenu()
{
   AddHdr('&nbsp;');
   document.write('</table>');
   if (NS6)
   {
      document.write('</TD></TR></TABLE>');
   }
   if (IE || NS6)
   {
      document.write('</DIV>');
   }
   if (NS)
   {
      document.write('</LAYER></ILAYER></LAYER>');
   }
   if (NS6 || IE || NS)
      setTimeout('InitSlide();', 1);
}

function AddHdr(text)
{
   document.write('<tr><td bgcolor="' + hdrBGColor + '" HEIGHT="' + hdrHeight +
                  '" ALIGN="' + hdrAlign + '" VALIGN="' + hdrVAlign + '" WIDTH="' +
                  (menuWidth - 1) + '">&nbsp;<font face="' + hdrFontFamily +
                  '" Size="' + hdrFontSize + '" COLOR="' + hdrFontColor + '"><b>' +
                  text + '</b></font></td>' + ((!tempBar) ? "" : "</TR>"));
}

function AddItem(text, link, target)
{
   if (!target)
   {
      target = linkTarget;
   }
   document.write('<TR><TD BGCOLOR="' + linkBGColor + '" onmouseover="bgColor=\'' +
                  linkOverBGColor + '\'" onmouseout="bgColor=\'' + linkBGColor +
                  '\'" WIDTH="' + (menuWidth - 1) +
                  '"><ILAYER><LAYER onmouseover="bgColor=\'' + linkOverBGColor +
                  '\'" onmouseout="bgColor=\'' + linkBGColor +
                  '\'" WIDTH="100%" ALIGN="' + linkAlign + '"><DIV  ALIGN="' +
                  linkAlign + '"><FONT face="' + linkFontFamily + '" Size="' +
                  linkFontSize + '" COLOR="' + linkFontColor + '">&nbsp;<A HREF="' +
                  link + '" target="' + target +
                  '" CLASS="menuItems">' + text + '</DIV></LAYER></ILAYER></TD></TR>');
}

