var  timerId=0 ;
var posx=0;var posy=0;

function doMouseMove(e){
    var e=(!e)?window.event:e;//IE:Moz
    if (e.pageX){//Moz
        posx=e.pageX+window.pageXOffset;
        posy=e.pageY+window.pageYOffset;
    }
    else if(e.clientX){//IE
        if(document.documentElement){//IE 6+ strict mode
            posx=e.clientX+document.documentElement.scrollLeft;
            posy=e.clientY+document.documentElement.scrollTop;
        }
        else if(document.body){//Other IE
            posx=e.clientX+document.body.scrollLeft;
            posy=e.clientY+document.body.scrollTop;
        }
    }
    else{return false}//old browsers
}
    
document.onmousemove=doMouseMove

function clearTimer() {
  if (timerId!=0) {
    clearTimeout(timerId); timerId=0; }}

function startTimer() {
  clearTimer(); timerId=setTimeout('timerId=0;hideMenus()',200); }

        function getObjectRef (strName) {
            if (document.getElementById) {
  	            return document.getElementById(strName);
            }
            else if (document.all) {
                return document.all[strName];
            }
            else if (document.layers) {
   	            return document.layers[strName];
            }
        }

function showMenu(menuNum, name, image) {
    clearTimer();
    hideMenus();
    document.getElementById('menu_'+menuNum).style.display="";
    //document.getElementById('menu_'+menuNum).style.left = event.clientX - 10;
    //document.getElementById('menu_'+menuNum).style.left = (posx - 0) + "px";
    imageOn(name, image)
}

function hideMenus() {
  var  i=1 ;

  while (document.getElementById('menu_'+i)) {
    //document     .getElementById('menu_'+i).style.visibility="hidden";
    document     .getElementById('menu_'+i).style.display="none";
    i++; }
    
    imageOff('barrels', document.top_barrels)
    imageOff('markers', document.top_markers)
    imageOff('air', document.top_air)
    imageOff('field_gear', document.top_field_gear)
    imageOff('street_gear', document.top_street_gear)
    imageOff('promo', document.top_promo)
    imageOff('support', document.top_support)
    }

function hiLite(theOption) {
  clearTimer();
  //document.getElementById('opt_'+theOption).style.background='#9090FF';
  document.getElementById('a_'+theOption).style.color='red';
    }

function unLite(theOption) {
  startTimer();
  //document.getElementById('opt_'+theOption).style.background='#D0D0FF';
  document.getElementById('a_'+theOption).style.color='#FFFFFF';
  }

function optClick(theOption) {
  unLite(theOption); clearTimer(); hideMenus();
}

    function imageOn(name, image)
    {
        image.src = "images/top_" + name + "_on.gif";
    }
    function imageOff(name, image)
    {
        image.src = "images/top_" + name + "_off.gif";
    }
