function CenterPopup(URL, width, height)
{
 // get position difference since init()
    if(window.screenTop == undefined){ // firefox
        ScreenLeft = window.screenX ;
        ScreenTop = window.screenY ;
    } else { // ie
        ScreenLeft = window.screenLeft ;
        ScreenTop = window.screenTop ;
    }
var X = obtener_ancho() / 2;
var Y = obtener_alto() / 2;
popup = window.open(URL, 'PopUp', 'scrollbars=0,toolbar=0,location=0,menubar=0, width=' + width + ',height=' + height + ',top=' + (ScreenTop + (Y - (height/2))) + ',' + 'left=' + 
(ScreenLeft + (X - (width/2))));
popup.focus();
}
/*POPUP*/
function obtener_ancho()
{
if (navigator.userAgent.indexOf("MSIE") > 0)
{
return(document.body.clientWidth);
}
else
{
return window.outerWidth;
}
}

function obtener_alto()
{
if (navigator.userAgent.indexOf("MSIE") > 0)
{
return(document.body.clientHeight);
} 
else
{
return(window.outerHeight);
}
}

var popup = new Object();

function CenterPopup(URL, width, height)
{
 // get position difference since init()
    if(window.screenTop == undefined){ // firefox
        ScreenLeft = window.screenX ;
        ScreenTop = window.screenY ;
    } else { // ie
        ScreenLeft = window.screenLeft ;
        ScreenTop = window.screenTop ;
    }
var X = obtener_ancho() / 2;
var Y = obtener_alto() / 2;
popup = window.open(URL, 'PopUp', 'scrollbars=1,toolbar=0,location=0,menubar=0, width=' + width + ',height=' + height + ',top=' + (ScreenTop + (Y - (height/2))) + ',' + 'left=' + 
(ScreenLeft + (X - (width/2))));
popup.focus();
}
