var loadDone = "no";
var elementsLoaded = "no";

function loadImg() {
  if (document.images) {
    menu1on	= new Image();	menu1on.src	= "images/menuon_1x1.gif";
    menu1off	= new Image();	menu1off.src	= "images/menu_1x1.gif";
    menu2on	= new Image();	menu2on.src	= "images/menuon_2x1.gif";
    menu2off	= new Image();	menu2off.src	= "images/menu_2x1.gif";
    menu3on	= new Image();	menu3on.src	= "images/menuon_3x1.gif";
    menu3off	= new Image();	menu3off.src	= "images/menu_3x1.gif";
    menu4on	= new Image();	menu4on.src	= "images/menuon_4x1.gif";
    menu4off	= new Image();	menu4off.src	= "images/menu_4x1.gif";
    menu5on	= new Image();	menu5on.src	= "images/menuon_5x1.gif";
    menu5off	= new Image();	menu5off.src	= "images/menu_5x1.gif";
    menu6on	= new Image();	menu6on.src	= "images/menuon_6x1.gif";
    menu6off	= new Image();	menu6off.src	= "images/menu_6x1.gif";
    menu7on	= new Image();	menu7on.src	= "images/menuon_7x1.gif";
    menu7off	= new Image();	menu7off.src	= "images/menu_7x1.gif";
    menu8on	= new Image();	menu8on.src	= "images/menuon_8x1.gif";
    menu8off	= new Image();	menu8off.src	= "images/menu_8x1.gif";
    menu10on	= new Image();	menu10on.src	= "images/menuon_10x1.gif";
    menu10off	= new Image();	menu10off.src	= "images/menu_10x1.gif";
    loadDone = "yes";
  }
}
function show(currElem) {
  if (elementsLoaded == "yes") {
    stdBrowser = (document.getElementById) ? true : false;
    if (currElem) {
      popUpWin = (stdBrowser) ? document.getElementById(currElem).style : eval("document." + currElem);
      popUpWin.visibility = "visible";
    }
  }
}
function hide(currElem) {
  if (elementsLoaded == "yes") {
    stdBrowser = (document.getElementById) ? true : false;
    if (currElem) {
      popUpWin = (stdBrowser) ? document.getElementById(currElem).style : eval("document." + currElem);
      popUpWin.visibility = "hidden";
    }
  }
}
function showPos(currElem,obj) {
  if (elementsLoaded == "yes") {
    stdBrowser = (document.getElementById) ? true : false;
    var newX = findPosX(obj);
    var newY = findPosY(obj);
    popUpWin = (stdBrowser) ? document.getElementById(currElem).style : eval("document." + currElem);
    popUpWin.top =  (newY + 2);
    popUpWin.left = (newX + 2);
    var agt=navigator.userAgent.toLowerCase();
    // fix position for Netscape and Opera
    if ((agt.indexOf('opera')>-1) || (agt.indexOf('netscape')>-1)) {
      popUpWin.top =  (newY - 58);
    }
    popUpWin.visibility = "visible";
  }
}
function cImg() {
  if (loadDone == "yes") {
    if (document.images) {
      for (var i=0; i<cImg.arguments.length; i+=2) {
        document[cImg.arguments[i]].src = eval(cImg.arguments[i+1] + ".src");
      }
    }
  }
}
function findPosX(obj) {
  var curleft = 0;
  if (document.getElementById || document.all) {
    while (obj.offsetParent) {
      curleft += obj.offsetLeft
      obj = obj.offsetParent;
    }
  }
  else if (document.layers)
    curleft += obj.x;
    return curleft;
}
function findPosY(obj){
  var curtop = 0;
  var printstring = '';
  if (document.getElementById || document.all) {
    while (obj.offsetParent) {
      curtop += obj.offsetTop
      obj = obj.offsetParent;
    }
  }
  else if (document.layers)
    curtop += obj.y;
    return curtop;
}
function popWin(floc) {
  min = window.open(floc, "OPEN_WINDOW", "width=550, height=400, scrollbars=yes");
}
function popUp(url) {
  sealWin=window.open(url,"win",'toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1,width=500,height=400');
  self.name = "mainWin";
}