/**
 * Currently shoiwn menu panel, if any
 */
var last = null;

/**
 * Show a menupanel
 * @param object o   Object reference to panel
 */
function s(o)
{
   if(!document.getElementById)
      return;

   if(last != null) h(last);

   var m = document.getElementById('m_' + o.id);
   m.style.left = (o.offsetLeft - 25) + 'px';
   m.style.display = 'block';

   last = o;
}

/**
 * Hide a menupanel
 * @param object o   Object reference to panel
 */
function h(o)
{
   if(o == null) return;

   var m = document.getElementById('m_' + o.id);
   m.style.display = 'none';
}

/**
 * Highlight a menu item
 * @param object o   Object reference to item
 */
function hilite(o)
{
   o.className = 'revmenuitem';
}

/**
 * Revert a menu item to normal
 * @param object o   Object reference to item
 */
function unhilite(o)
{
   o.className = 'menuitem';
}

/**
 * Simulate a button press in the top row
 * @param object o   Object reference to button being pressed
 */
function b(o)
{
   var other = document.getElementById('otherimg');

   var oldsrc = o.src;
   o.src = other.src;
   other.src = oldsrc;
}

/**
 * Reposition any fixed images to the top of the page,
 * resize the content DIV.
 */
function size()
{
   if(!document.getElementById)
      return;

   var box = document.getElementById("content");

   var fix1 = document.getElementById("fixme");
   if(fix1)
      fix1.style.top = (box.scrollTop + 5)  + "px";

   var fix2 = document.getElementById("fixme2");
   if(fix2)
      fix2.style.top = (box.scrollTop + 100) + "px";

   var mr = document.getElementById("mainrow");
   var bottom = document.getElementById("bottom");

   getSizes();
   box.style.height = (wHeight - (fix1 ? 130 : 60) - (bottom ? 70 : 0)) + "px";

   var dots = document.getElementById("stippen");
   if(dots)
   {
      if(fix1)
      {
         // If it will not fit, do not show it at all
         if(wHeight - 450 > 0)
            dots.style.top = (wHeight - 375) + "px";
         else
            dots.style.top = "10000px";
      }
      else
         dots.style.top = (wHeight - 300) + "px";
   }
}

/**
 * Select one of the dot background
 */
function setdots()
{
   if(!document.getElementById)
      return;

   var fix = document.getElementById("fixme");
   var dots = document.getElementById("stippen");

   if(dots)
   {
      if(fix)
      {
         dots.src = "http://www.frontier.nl/images/stippen2.gif";
         dots.style.left = "200px";
         dots.style.height = "300px";
      }
      else
      {
         dots.src = "http://www.frontier.nl/images/stippen1.gif";
         dots.style.height = "250px";

         var cases = document.getElementById("cases");
         if(cases)
            cases.style.display = "block";
      }
   }

   // Mozilla has some problems with the border row
   if(fix && navigator.userAgent.indexOf("MSIE") > 0 && navigator.userAgent.indexOf("Opera") <= 0)
   {
      var bottom = document.getElementById("bottom");
      if(bottom)
      {
         bottom.style.height = "75px";
         bottom.className = "gray";
      }
   }
}

