function openNewWin( url, winName, width, height )
{
    var sx = screen.width / 2 - width / 2;
    var sy = screen.height / 2 - height / 2;
    var win = window.open( url, winName, 'width=' + width + ',height=' + height + ',location=0,menu=0,scrollbars=0,status=0,titlebar=0,title=0,toolbar=0,screenx='
        + sx +',left=' + sx + ',screeny=' + sy + ',top=' + sy );
    return ( win )? false: true;
}

function fixInnerSize( ww, wh )
{
    var iw;
    var ih;

    for ( var i = 0; i < 2; i++ ) // to fix a bug in Opera if the window is resized manually, sized are not updated
    {    
        if ( window.innerWidth )
        {
            iw = window.innerWidth;
            ih = window.innerHeight;
        }
        else if ( document.documentElement && document.documentElement.clientHeight )
        {
            iw = document.documentElement.clientWidth;
            ih = document.documentElement.clientHeight;
        }
        else
        {
            iw = document.body.clientWidth;
            ih = document.body.clientHeight;
        }
        if ( iw > 0 || ih > 0 )
        {
            window.resizeBy( ww - iw, wh - ih );
        }
    }
    window.focus();
}

