/**
 * Window handling functions
 * @author George Alin COSTEA
 */

/**
 * Open a popup window
 * @param string url
 * @param int wdth
 * @param int hght
 */
function wndOpen(url, wdth, hght)
{
    if(wdth < 1 || hght < 1) return true;

    var wndTop  = (screen.availHeight - hght) / 2;
    var wndLeft = (screen.availWidth  - wdth) / 2;

    wnd = window.open(url, "ViewImage", "top="+wndTop+",left="+wndLeft+
                                        ",height="+hght+",width="+wdth+
                                        ",menubar=0,status=0,scrollbars=0");
    if(wnd)
    {
        wnd.focus();
    }
    else
    {
        window.location.href = url;
    }

    return false;
}