    function openPopup(url) {
        myPopup = window.open(url,'popupWindow','alwaysRaised=yes,width=500,height=400');
            myPopup.focus()
        if (!myPopup.opener)
             myPopup.opener = self; 
    }
        

    function getX(width) {                           
    if (document.all)
    {
    var x = window.screenLeft;
    var w = window.document.body.offsetWidth;
    }
    else
    {
    var x = window.screenX;
    var w = window.outerWidth;
    }
    return cntx = x + Math.round((w - width) / 2);                      
    }

    function getY(height) {
    if (document.all)
    {
    var y = window.screenTop;
    var h = window.document.body.offsetHeight;
    }
    else
    {
    var y = window.screenY;
    var h = window.outerHeight;
    }
    return cnty = y + Math.round((h - height) / 2);                         
    }

    

    function popUpLegendaLoc(width,height,popX,popY,URL) {
    var cntx=getX(width);                        
    var cnty =getY(height);
    popLegLoc = window.open(URL, 'popupWindow', 'alwaysRaised=yes, left=' + cntx + ',top=' + cnty + ',width=' + width + ',height=' + height);
    popLegLoc.focus();         
    if (!popLegLoc.opener)                          
    popLegLoc.opener = self; 
    }
    function popUpLegendaAcco(width,height,popX,popY,URL) {
    var cntx=getX(width);
    var cnty =getY(height);
    popLegAcco = window.open(URL, 'popupWindow', 'alwaysRaised=yes, left=' + cntx + ',top=' + cnty + ',width=' + width + ',height=' + height);
    popLegAcco.focus();         
    if (!popLegAcco.opener)                          
    popLegAcco.opener = self; 
    }

    function popUpLegendaAree(width,height,popX,popY,URL) {                               
    var cntx=getX(width);                        
    var cnty =getY(height);                          
    popLegAree = window.open(URL, 'popupWindow', 'alwaysRaised=yes, left=' + cntx + ',top=' + cnty + ',width=' + width + ',height=' + height);                        
    popLegAree.focus();         
    if (!popLegAree.opener)                          
    popLegAree.opener = self;                            
    }      
    
        