
function obrePopup(laUrl,imgWidth,imgHeight,winName,border)
{
    var features;
    var w;
    var h;
    var popup;
    
    winWidth = (imgWidth<100) ? 100 : imgWidth+border;
    winHeight = (imgHeight<100) ? 100 : imgHeight+border;

    features = "scrollbars=yes";        

    if (imgWidth+border > screen.width) {
        winWidth = screen.width-10;
        w = (screen.width - winWidth)/2;
        features = "scrollbars=yes";      
    } else {
        w = (screen.width - (imgWidth+border))/2;
    }
    if (imgHeight+border > screen.height) {
        winHeight = screen.height-60;
        h = 0;
        features = "scrollbars=yes";      
    } else {
        h = (screen.height - (imgHeight+border))/2 - 20;
    }
 
    features = features+',toolbar=no,resizable=yes,width='+winWidth+',height='+winHeight+',top='+h+',left='+w;

    popup = window.open(laUrl,winName,features);
    popup.focus();  
}

function obrePopup_principal(laUrl,imgWidth,imgHeight,winName,border)
{
    var features;
    var w;
    var h;
    var popup;
    
    winWidth = (imgWidth<100) ? 100 : imgWidth+border;
    winHeight = (imgHeight<100) ? 100 : imgHeight+border;

    features = "scrollbars=yes";        

    if (imgWidth+border > screen.width) {
        winWidth = screen.width-10;
        w = (screen.width - winWidth)/2;
        features = "scrollbars=yes";      
    } else {
        w = (screen.width - (imgWidth+border))/2;
    }
    if (imgHeight+border > screen.height) {
        winHeight = screen.height-60;
        h = 0;
        features = "scrollbars=yes";      
    } else {
        h = (screen.height - (imgHeight+border))/2 - 20;
    }
 
    features = features+',toolbar=yes,resizable=yes,width='+winWidth+',height='+winHeight+',top='+h+',left='+w;

    popup = window.open(laUrl,winName,features);
    popup.focus();  
}
