// anon OpenJahiaWindow kmh
function OpenJahiaWindow(url, name, width, height) {
    var params;var anonEngineWin = null;
    // check for very very small screens
    if (screen.availHeight <= 720 || screen.availWidth <= 950) {
        width = screen.availWidth;
        height = screen.availHeight;
        params = "width=" + width + ",height=" + height + ",left=10,top=10,resizable=yes,scrollbars=yes,status=no";
    } else {
        params = "width=" + width + ",height=" + height + ",left=10,top=10,resizable=yes,scrollbars=no,status=no";
    }

    // Hollis : check if the popup is alread opened, if so, give it the focus
    if (anonEngineWin != null) {
      try {    
        if (anonEngineWin.closed) { // need to test it first...
            anonEngineWin = null;
            anonEngineWin = window.open(url, name, params);
        } else {
            if (anonEngineWin.name != name) {
                anonEngineWin.close();
                anonEngineWin = null;
                anonEngineWin = window.open(url, name, params);
            } else {
                anonEngineWin.focus();
            }
        }
      } catch (ex) {
        // suppress exception
      }        
    } else {
        anonEngineWin = window.open(url, name, params);
    }

}
// end OpenJahiaWindow

// Used with container list pagination
// Set
function changePage(whatForm, scrollingInput, val) {
    scrollingInput.value = val;
    var ctnListname = scrollingInput.name.substring(10,scrollingInput.name.length);
    whatForm.elements['ctnlistpagination_' + ctnListname].value='true';
    whatForm.submit();
}
