  var lastElement;
  var lastlayerID;
  var oldElement='';
  var timerID=null;
  var loaded=false;

//for gallery
  var last_BIG_PIC='';
  var last_SMALL_PIC_X=0;
  var last_SMALL_PIC_Y=0;
  var last_SCROLL_PIC=0;


    function loadOnInit()
    {
        detectExplorerType();
        loaded=true;
    }



    function findPos(layerID)
    {
        obj=document.getElementById(layerID)

	    var curleft = curtop = 0;
        curwidth = 180;
//      Firefox
        if (explorertype==0)
        {
           curleft=obj.offsetLeft;
           curtop=obj.offsetTop;
           curwidth=obj.offsetWidth;
        }
        else
//      Internet Explorer
        if (explorertype==1)
        {
            curwidth=obj.offsetWidth;
            curleft=0;
            curtop=0;
        }
//      Opera
        if (explorertype==2)
        {
           curleft=0;
           curtop=0;
           curwidth=obj.offsetWidth;
        }
        oldwidth=curwidth;
        if (curwidth<180) curwidth=180;
        return [curleft,curtop,curwidth,oldwidth];
    }


    function ResetTimer()
    {
        if (timerID)
        {
            clearTimeout(timerID);
        }
    }

    function delayedhideMenu(elmnt)
    {
        if (elmnt)
        {
            document.getElementById(elmnt).style.visibility="hidden";
        }
        else if (lastElement)
            document.getElementById(lastElement).style.visibility="hidden";

        if (lastlayerID)
        {
          document.getElementById(lastlayerID).style.backgroundColor=colourMENU_LINK_A;
        }
    }

    function hidemenu(elmnt)
    {
        lastElement=elmnt;
        timerID=setTimeout("delayedhideMenu()",500);
    }

    function showmapwindow(ip_address)
    {
        mywindow=window.open(ip_address,'_blank','toolbar=1,resizable=0');

    }

