var bx_ajax = null; var bx_ajaxCallback = null; function bx_initAjax(){ if (bx_ajax){ return true; } if (window.XMLHttpRequest){ bx_ajax = new XMLHttpRequest(); return true; }else if (window.ActiveXObject){ bx_ajax = new ActiveXObject("Microsoft.XMLHTTP"); return true; } return false; } function bx_ajaxRequest( url, method, callback, rnd ){ if (!bx_initAjax()){ return false; } if (rnd){ url += "&rnd="+Math.random(); } bx_ajaxCallback = callback; bx_ajax.open(method,url,true); bx_ajax.onreadystatechange=bx_ajaxResponse; bx_ajax.send(null); return true; } function bx_ajaxResponse(){ if ((bx_ajax.readyState==4) || (bx_ajax.readyState=="complete")){ if (bx_ajaxCallback){ bx_ajaxCallback(); } } } function bx_getElementSafe( id ){ if (document.getElementById){ if (document.getElementById(id)) { return document.getElementById(id); } if (document.getElementsByName) { var elms = document.getElementsByName(id); if (elms.length>0){ return elms.item(0); } } return document.getElementById(id); }else if (document.all){ return document.all[id]; }else if (document.layers){ return document.layers[id]; }else{ return false; } } function bx_submit(){ var fm = bx_getElementSafe('bxform'); if (fm){ fm.submit(); } } function bx_dologin(){ var c = ''; var ci = bx_getElementSafe('in_bxcompany'); if (ci){ c = ci.value; } var u = bx_getElementSafe('in_bxusername').value; var p = bx_getElementSafe('in_bxpassword').value; bx_taskbarChange('/index.php?prms=boxed,ajax,dologin,'+c+','+u+','+p); } function bx_doLogout(){ bx_taskbarChange('/index.php?prms=boxed,ajax,dologout'); } function bx_closeTaskbar(){ bx_taskbarChange('/index.php?prms=boxed,ajax,close'); } function bx_hideTaskbar(){ bx_taskbarChange('/index.php?prms=boxed,ajax,hide'); } function bx_showTaskbar(){ bx_taskbarChange('/index.php?prms=boxed,ajax,show'); } function bx_taskbarChange(url){ bx_ajaxRequest(url,"GET",bx_taskbarSet,true); } function bx_taskbarSet(){ var tb = bx_getElementSafe('bx_taskbar'); if (tb){ tb.innerHTML = bx_ajax.responseText; } } function bx_fixIE(){ theObjects = document.getElementsByTagName("object"); for (var i = 0; i < theObjects.length; i++) { theObjects[i].outerHTML = theObjects[i].outerHTML; } } function bx_popEditor(module,editor){ bx_popWindowFixed('/index.php?prms='+module+','+editor, 'editor', 450, 350); } function bx_popWindow(url, name, width, height){ newWin = window.open(url, name, 'height='+height+',width='+width+',fullscreen=no,location=no,menubar=no,status=no,toolbar=no,scrollbars=no,resizable=yes'); if (newWin.opener == null){ newWin.opener = self; } newWin.focus(); return newWin; } function bx_popWindowFixed(url, name, width, height){ newWin = window.open(url, name, 'height='+height+',width='+width+',fullscreen=no,location=no,menubar=no,status=no,toolbar=no,scrollbars=no,resizable=no'); if (newWin.opener == null){ newWin.opener = self; } newWin.focus(); return newWin; } function bx_popWindowFull(url, name, width, height){ newWin = window.open(url, name, 'height='+height+',width='+width+',fullscreen=no,location=no,menubar=no,status=no,toolbar=no,scrollbars=yes,resizable=yes'); if (newWin.opener == null){ newWin.opener = self; } newWin.focus(); return newWin; }