/* ----------- png-tooltipHover-workaround ----------- */

function showMapHover (obj) {
  
  obj.getElementsByTagName('img')[0].style.visibility = 'visible';
  
}
function hideMapHover (obj) {
  
  obj.getElementsByTagName('img')[0].style.visibility = 'hidden';
  
}




/* ----------- tooltip ----------- */
wmtt = null;

function updateWMTT(e){
  
    if (wmtt != null) {
        var x;
        var y;
        if (!e) {
            e = window.event;
        }
        
        if (e.pageX) {
            x = e.pageX;
            y = e.pageY;
        }
        else {
            x = e.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
            y = e.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
        }
        if ( Gposition == 'left') {
          wmtt.style.left = (x - ddw - 12) + "px";
        }
        else {
          wmtt.style.left = (x + 12) + "px";
        }
        wmtt.style.top = (y - (ddh/2) + 5) + "px";
    }
}


function showWMTT(id, posi){
    
    wmtt = document.getElementById(id);
    wmtt.style.display = "block";
    Gposition = posi;
    ddw = document.getElementById(id).offsetWidth;
    ddh = document.getElementById(id).offsetHeight;
    document.onmousemove = updateWMTT;
}

function hideWMTT(){
    wmtt.style.display = "none";
    wmtt = null;
    Gposition = null;
}


/* ----------- Popup ----------- */

var win = null;
function openView(WinUrl, WinName, WinWidth, WinHeight){
    Left = (screen.width) ? (screen.width - WinWidth) / 2 : 0;
    Top = (screen.height) ? (screen.height - WinHeight) / 2 : 0;
    settings = 'height=' + WinHeight + ', width=' + WinWidth + ', top=' + Top + ', left=' + Left + ', dependent=yes,hotkeys=yes,innerHeight= '+ (WinHeight - 20) +',innerWidth= '+ (WinWidth - 20) +', location=no, resizable=no,scrollbars=yes,status=no,toolbar=no';
    win = window.open(WinUrl, WinName, settings);
    win.focus();
}






