﻿    var CurrentPopup;    
    CurrentPopup=-1;
    
    var holdTimer;
    var removeTimer;
    
    var xpos;
    var ypos;
    
    var xxpos;
    var xypos;
    
    var foTimer;
    var foOpacity;
    var URL;
    
    
    function mouseX(evt) {
        if (evt.pageX) return evt.pageX;
        else if (evt.clientX)
        return evt.clientX + (document.documentElement.scrollLeft ?
        document.documentElement.scrollLeft :
        document.body.scrollLeft);
        else return null;                      
    }
    
    function mouseY(evt) {
        if (evt.pageY) return evt.pageY;
        else if (evt.clientY)
        return evt.clientY + (document.documentElement.scrollTop ?
        document.documentElement.scrollTop :
        document.body.scrollTop);
        else return null;
    }
    
    
    document.onmousemove = function (event) {    
        if (!event) {     
        event = window.event;
        }      
       xxpos = mouseX(event);
       xypos = mouseY(event);     
    }
           

    function foPu()
    {
        pu=document.getElementById("popup");
        pu.style.filter= "alpha(opacity=" + foOpacity + ")";
        pu.style.opacity = foOpacity/10;
        foOpacity -=10;
        if (foOpacity<0)
        {
            window.clearInterval(foTimer);
            pu.style.visibility = "hidden";
        }
    }
      
    function closepu()
    {
        CurrentPopup =0;
        
        document.getElementById("popup").style.visibility="hidden";    
    }
    
    
    function removepu()
    {
        window.clearTimeout(holdTimer);        
        removeTimer = window.setTimeout("closepu()",300);
              
    }
    
    function startpopup(popupid)
    {
        popupid = 0;
        
        window.clearTimeout(holdTimer);        
        holdTimer = window.setTimeout("showPopup(" + popupid +")",300);               
    }
    
    
    function showPopup(popupid)
    {
        CurrentPopup=popupid;            
    
         //cancel any existing remove timers
         window.clearTimeout(removeTimer);
         
        //Wait for hover
        xpos = xxpos+20;
        ypos = xypos; 
         
    
        var pu;
                                           
        pu=document.getElementById("popup");
                     
        //pu.style.visibility = "hidden";        
        pu.style.filter = "alpha(opacity=100)";
        pu.style.opacity = 10;
        pu.style.left = "" + xpos-10 + "px";
        pu.style.top = "" + ypos-10 + "px";
                   
        pu.style.visibility = "visible";       
    }
    
 
    
    function pulaunch()
    {
        window.open(URL);
    }
    
    function puOver()
    {
        window.clearInterval(removeTimer);
    }
