function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);


function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

// Map of id's to objects
var objs = new Object();

// Map of id's to timeout-handles
var handles = new Object();

function MR_reallyHide( obj)
{
  if (obj != null)
  {
    if (obj.style)
      obj.style.visibility = 'hidden';
    else
      obj.visibility = 'hide';
  }
}

var hideTimeout = 150;
function MR_markForHide( obj)
{
  if (handles[obj.id] == null)
  {
    objs[obj.id] = obj;
    handles[obj.id] = setTimeout( "MR_hidePending('" + obj.id + "')", hideTimeout);
  }
}

function MR_unmarkForHide( obj)
{
  if (obj != null && handles[obj.id] != null)
  {
    clearTimeout( handles[obj.id]);
    handles[obj.id] = null;
  }
}

function MR_showMenu( obj)
{
  MR_unmarkForHide( obj);

  // Show object.
  if (obj.style)
    obj.style.visibility = 'visible';
  else
    obj.visibility = 'show';
}

function MR_hideMenu( obj)
{
  // MR_unmarkForHide( obj);
  MR_markForHide( obj);
}

function MR_hidePending( id)
{
  handles[id] = null;
  MR_reallyHide( objs[id]);
}

var dontHideMe = '';
function MR_hideMenus()
{
  var i, obj, args=MR_hideMenus.arguments;
  for (i=0; i<args.length; ++i)
  {
    if (args[i] != dontHideMe && (obj = MM_findObj(args[i])) != null)
    {
      MR_hideMenu( obj);
    }
  }
}

function MR_reallyHideMenus()
{
  var i, obj, args=MR_reallyHideMenus.arguments;
  for (i=0; i<args.length; ++i)
  {
    if (args[i] != dontHideMe && (obj = MM_findObj(args[i])) != null)
    {
      MR_reallyHide( obj);
    }
  }
}

function MR_showMenus()
{
  var i, obj, args=MR_showMenus.arguments;
  for (i=0; i<args.length; ++i)
    if ((obj = MM_findObj(args[i])) != null)
    {
      MR_showMenu( obj);
      if (navigator.appName == 'Konqueror')
        MR_hideMenus(args[i] + '_pic');
    }
}

function MR_setMenuColor( id, color)
{
  var obj = MM_findObj(id);
  if (obj != null)
  {
    obj.bgColor = color;
  }
}

function MR_setMenuYellow( id)
{
  MR_setMenuColor( id, '#f7ebcc');
}

function MR_setMenuPink( id)
{
  MR_setMenuColor( id, '#edd3e4');
}

function MR_setMenuGray( id)
{
  MR_setMenuColor( id, '#84919b');
}

var dontSetMeWhite = '';
function MR_setMenuWhite( id)
{
  if (id != dontSetMeWhite)
    MR_setMenuColor( id, '#ffffff');
}

