var workInProgressOverlay=null;var myEngineWin=null;var pickerlist=null;var workInProgress=null;var GlobalCallbackCount=0;var GlobalCallback=new Array();var GlobalListenerCount=0;var GlobalCommands=new Array();var GlobalPrototypeCallCount=0;var GlobalPrototypeCalls=new Array();function OpenJahiaWindow(c,b,e,a){var f;if(screen.availHeight<=720||screen.availWidth<=950){e=screen.availWidth;a=screen.availHeight;f="width="+e+",height="+a+",left=10,top=10,resizable=yes,scrollbars=yes,status=no"}else{f="width="+e+",height="+a+",left=10,top=10,resizable=yes,scrollbars=no,status=no"}if(myEngineWin!=null){try{if(myEngineWin.closed){myEngineWin=null;myEngineWin=window.open(c,b,f)}else{if(myEngineWin.name!=b){myEngineWin.close();myEngineWin=null;myEngineWin=window.open(c,b,f)}else{myEngineWin.focus()}}}catch(d){}}else{myEngineWin=window.open(c,b,f)}}function OpenJahiaScrollableWindow(c,b,e,a){if(screen.availHeight<=720||screen.availWidth<=950){e=screen.availWidth;a=screen.availHeight}var f="width="+e+",height="+a+",left=10,top=10,resizable=yes,scrollbars=yes,status=no";if(myEngineWin!=null){try{if(myEngineWin.closed){myEngineWin=null;myEngineWin=window.open(c,b,f)}else{if(myEngineWin.name!=b){myEngineWin.close();myEngineWin=null;myEngineWin=window.open(c,b,f)}else{myEngineWin.focus()}}}catch(d){}}else{myEngineWin=window.open(c,b,f)}}function ReloadEngine(c){var a=location.href;var d=a.indexOf("&engine_params");if(d!=-1){a=a.substring(0,d)}var b=a+"&engine_params="+c;location.href=b}function closeEngineWin(){document.body.style.cursor="default";if(myEngineWin!=null){try{if(myEngineWin.closed){purge(myEngineWin.document);myEngineWin=null}else{myEngineWin.close();purge(myEngineWin.document);myEngineWin=null}}catch(a){}}else{purge(document.body)}}function closeEngineWinAllPopups(){document.body.style.cursor="default";try{if(myEngineWin!=null){if(myEngineWin.closed){if(myEngineWin.myWin&&!myEngineWin.myWin.closed){myEngineWin.myWin.close();purge(myEngineWin.myWin.document)}purge(myEngineWin.document);myEngineWin.myWin=null;myEngineWin=null}else{if(myEngineWin.myWin&&!myEngineWin.myWin.closed){myEngineWin.myWin.close();purge(myEngineWin.myWin.document)}myEngineWin.close();purge(myEngineWin.document);myEngineWin.myWin=null;myEngineWin=null}}}catch(b){}try{removeAll()}catch(a){}}function openWorkInProgressWindow(c){var b="width=200,height=200,left=0,top=0,resizable=no,scrollbars=no,status=no";var a=c;a+="/jsp/jahia/administration/work_in_progress.html";workInProgress=window.open(a,"workInProgressWin",b)}var oldLoc="";function CloseJahiaWindow(g){var f="";if(CloseJahiaWindow.arguments.length>1){f=CloseJahiaWindow.arguments[1]}if(!window.opener){window.close();delete window;if(myEngineWin!=null){purge(myEngineWin.document)}myEngineWin=null;return}var d=window.opener.location.href;var h=d.indexOf("&engine_params");if(h!=-1){d=d.substring(0,h)}var c=d.indexOf("#");var a=d.substring(c,d.length);if(c!=-1){d=d.substring(0,c)}var e="";if(d.indexOf("?")!=-1){e=d}else{e=d;if(c!=-1){e=e+a}}if(f!=""){e+=f;if(c!=-1){e=e+a}}if(e.charAt(e.length-1)=="#"){e=e.substring(0,e.length-1)}try{if(f.indexOf("submit")!=-1){if(g.indexOf("yes")!=-1){if(window.opener!=null){window.opener.document.forms[0].submit()}}else{window.opener.refreshMonitor()}}else{if(g.indexOf("yes")!=-1){window.opener.location.href=e}else{window.opener.refreshMonitor()}oldLoc=window.opener.location;WaitForRefresh()}window.close();if(myEngineWin!=null){purge(myEngineWin.document)}purge(window.document);delete window;myEngineWin=null}catch(b){window.close();if(myEngineWin!=null){purge(myEngineWin.document)}purge(window.document);myEngineWin=null;delete window}}function CloseJahiaWindowWithUrl(a){window.opener.location.href=a;oldLoc=window.opener.location;WaitForRefresh()}function saveAndAddNew(a,b){var c=window.opener.myEngineWin;if(window.opener.myEngineWin!=null){purge(window.opener.myEngineWin.document)}window.opener.myEngineWin=null;window.location.href=a;oldLoc=window.opener.location;while(window.opener.location!=null&&(oldLoc!=window.opener.location)){setTimeout("",1000)}window.opener.myEngineWin=c}function applyJahiaWindow(a){window.location.href=a}function closePopupWindow(){var c="";if(closePopupWindow.arguments.length>0){c=closePopupWindow.arguments[0]}if(closePopupWindow.arguments.length>1){var b=closePopupWindow.arguments[1];if(b=="yes"){var a=window.opener.location.href;if(a.indexOf("?")!=-1){if(c.charAt(0)=="&"){a+=c}else{a+="&"+c}}else{if(c.charAt(0)=="&"){a+="?"+c.substring(1,c.length)}else{a+="?"+c}}window.opener.location.href=a}}window.close();if(myEngineWin!=null){purge(myEngineWin.document)}purge(window.document);myEngineWin=null;delete window}function applyPopupWindow(b,a,d){if(d=="yes"){var c=window.opener.location.href;if(c.indexOf("?")!=-1){if(a.charAt(0)=="&"){c+=a}else{c+="&"+a}}else{if(a.charAt(0)=="&"){c+="?"+a.substring(1,a.length)}else{c+="?"+a}}window.opener.location.href=c;WaitForRefresh()}window.location.href=b}function WaitForRefresh(){var a=window.opener.location;if(a!=oldLoc){var b=setTimeout("WaitForRefresh()",100)}else{window.close()}}function MM_preloadImages(){var f=document;if(f.images){if(!f.MM_p){f.MM_p=new Array()}var e,c=f.MM_p.length,b=MM_preloadImages.arguments;for(e=0;e<b.length;e++){if(b[e].indexOf("#")!=0){f.MM_p[c]=new Image;f.MM_p[c++].src=b[e]}}}}function MM_swapImgRestore(){var d,b,c=document.MM_sr;for(d=0;c&&d<c.length&&(b=c[d])&&b.oSrc;d++){b.src=b.oSrc}}function MM_findObj(f,e){var c,b,a;if(!e){e=document}if((c=f.indexOf("?"))>0&&parent.frames.length){e=parent.frames[f.substring(c+1)].document;f=f.substring(0,c)}if(!(a=e[f])&&e.all){a=e.all[f]}for(b=0;!a&&b<e.forms.length;b++){a=e.forms[b][f]}for(b=0;!a&&e.layers&&b<e.layers.length;b++){a=MM_findObj(f,e.layers[b].document)}return a}function MM_swapImage(){var e,d=0,b,c=MM_swapImage.arguments;document.MM_sr=new Array;for(e=0;e<(c.length-2);e+=3){if((b=MM_findObj(c[e]))!=null){document.MM_sr[d++]=b;if(!b.oSrc){b.oSrc=b.src}b.src=c[e+2]}}}function setfocus(){}function changePage(c,b,d){b.value=d;var a=b.name.substring(10,b.name.length);c.elements["ctnlistpagination_"+a].value="true";c.submit()}function removeQueryParam(b,k){var d=b.indexOf("?");if(d<0){return b}var a=b.substring(d+1).split("&");var e=b.substring(0,d+1);var f=0;for(var c=0;c<a.length;c++){var h=a[c].indexOf("=");if(h>=0){var g=a[c].substring(0,h);var j=a[c].substring(h+1);if(g!=k){f++;if(f>1){e+="&"}e+=a[c]}}}return e}function displayPickers(b,d,c,a){params="width="+c+",height="+a+",top=0,left=0,resizable=yes,scrollbars=yes,status=yes";url=b+"/jsp/jahia/engines/importexport/dispPickers.jsp?id="+d;if(pickerlist){pickerlist.close()}pickerlist=window.open(url,"jwin",params)}function resizeZimbraShell(){try{DwtShell.getShell(window)}catch(a){return}try{if(DwtShell.getShell(window)){var b=DwtShell.getShell(window).getSize();var c=0;if(document.all||document.compatMode){if(document.compatMode&&document.compatMode!="BackCompat"){c=document.documentElement.scrollHeight}else{c=document.body.scrollHeight}}else{if(document.layers){c=document.body.document.height}else{if(document.height){c=document.height}}}DwtShell.getShell(window).setSize(b.x,c)}}catch(a){}}function initZimbraShell(j,d,k,c,g,b,l){try{DBG=new AjxDebug(AjxDebug.NONE,null,false);if(b){if(location.search&&(location.search.indexOf("debug=")!=-1)){var e=location.search.match(/debug=(\\d+)/);if(e.length){var f=parseInt(e[1]);var a=AjxDebug.DBG[f];if(a){DBG.setDebugLevel(a)}}}}}catch(i){return}var n=DwtShell.getShell(window);if(!n||n=="undefined"){var h=null;if(c){h=document.getElementById(c)}n=new DwtShell(j,d,k,h,g);n.setSize(0,0);Dwt.setVisibility(n.getHtmlElement(),"visible");if(l){n.getHtmlElement().style.backgroundColor=l}resizeZimbraShell();delete h}n=null}function removeAll(){window.onload=null;workInProgressOverlay=null;WorkInProgressLoader=null;if(jahia.config){jahia.config.contextPath=null;jahia.config.i18n["org.jahia.button.ok"]=null;jahia.config.i18n["org.jahia.button.saveAddNew"]=null;jahia.config.i18n["org.jahia.button.apply"]=null;jahia.config.i18n=null;jahia.config.contextPath=null;jahia.config.theScreen=null;jahia.config.lockKey=null;jahia.config.lockType=null;jahia.config.pid=null;jahia.config.needToRefreshParentPage=null;jahia.config.jspSource=null;jahia.config.sendKeepAliveTimeOut=null;jahia.config=null;jahia=null}for(e=0;e<GlobalListenerCount;e++){GlobalCommands[e].removeAllInvokeListeners();GlobalCommands[e].commandXmlDoc=null;GlobalCommands[e]._responseXmlDoc=null;GlobalCommands[e]._st=null;GlobalCommands[e]._en=null;GlobalCommands[e]=null}GlobalListenerCount=0;for(e=0;e<GlobalCallbackCount;e++){GlobalCallback[e].obj=null;GlobalCallback[e].func=null;GlobalCallback[e]._args=null;GlobalCallback[e]=null}GlobalCallbackCount=0;for(e=0;e<GlobalPrototypeCallCount;e++){GlobalPrototypeCalls[e].transport=null;GlobalPrototypeCalls[e]=null}GlobalPrototypeCallCount=0;try{if(FCKeditorAPI){FCKeditorAPI.GetInstance("jahiaEditor")=null;window.FCKeditorAPI=null;FCKeditorAPI=null;oFCKeditor=null;FCKJahialinker=null}}catch(b){}window.currentValue=null;var h=window.treeItems;if(h){var g=h.split(",");for(var e=0;e<g.length;e++){window["treeItem"+g[e]]=null}delete g;window.treeItems=null}delete h;var d=window.complexTree_tree1;if(d){d.clear()}delete d;window.complexTree_tree1=null;if((typeof AjxCore!="undefined")&&AjxCore._objectIds){for(var e=0;e<AjxCore._objectIds.length;e++){var j=AjxCore._objectIds[e];if(j){try{j.dispose();j=null;AjxCore._objectIds[e]=null}catch(c){j=null;AjxCore._objectIds[e]=null}}}AjxCore._objectIds=null}window._dwtShell=null;if(typeof unloadZimbra=="function"){unloadZimbra()}window.onbeforeunload=null;var f=document.getElementById("tree1");if(f){f.innerHTML=""}f=null;document.close();document.clear();purge(document);if(typeof DBG!="undefined"){DBG=null}if(typeof AjxRpc!="undefined"&&AjxRpc._rpcCache){for(e=0;e<AjxRpc._rpcCache.length;e++){if(AjxRpc._rpcCache[e]){AjxRpc._rpcCache[e].req._httpReq=null;AjxRpc._rpcCache[e].id=null;AjxRpc._rpcCache[e].req.ctxt=null;AjxRpc._rpcCache[e].req=null}AjxRpc._rpcCache[e]=null}AjxRpc._rpcCache=null;AjxRpcRequest._msxmlVers=null;AjxRpcRequest._inited=null}delete window}function addIframeElement(f,h,b,d,a,e,i,j,g){if(document.getElementById(a)){return}var k=document.createElement("iframe");k.setAttribute("width",b);k.setAttribute("height",d);k.setAttribute("frameborder",e);k.setAttribute("scrolling",i);k.setAttribute("align",j);k.setAttribute("id",a);k.setAttribute("name",a);k.className=g;var c=document.getElementById(f);if(c){c.parentNode.replaceChild(k,c);top[a].location.href=h}top[a].name=a}function adjustIFrameSize(a){if(a.document.height){var b=parent.document.getElementById(a.name);b.style.height=a.document.height+"px";b.style.width=a.document.width+"px"}else{if(document.all){var b=parent.document.all[a.name];if(a.document.compatMode&&a.document.compatMode!="BackCompat"){b.style.height=a.document.documentElement.scrollHeight+5+"px";b.style.width=a.document.documentElement.scrollWidth+5+"px"}else{b.style.height=a.document.body.scrollHeight+5+"px";b.style.width=a.document.body.scrollWidth+5+"px"}}}}function handleTimeBasedPublishing(e,b,d,f,a){var c=new TimeBasedPublishingStatus();c.run(e,b,d,f,a)}function fixPNG(f){var h=navigator.appVersion.split("MSIE");var c=parseFloat(h[1]);if((c>=5.5)&&(c<7)&&(document.body.filters)){var b=(f.id)?"id='"+f.id+"' ":"";var e=(f.className)?"class='"+f.className+"' ":"";var g=(f.title)?"title='"+f.title+"' ":"title='"+f.alt+"' ";var d="display:inline-block;"+f.style.cssText;var a="<span "+b+e+g+' style="width:'+f.width+"px; height:"+f.height+"px;"+d+";filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+f.src+"', sizingMethod='scale');\"></span>";f.outerHTML=a}}function purge(h){if(!h){return}try{var c=h.attributes,f,b,j;if(c){b=c.length;for(f=0;f<b;f+=1){j=c[f].name;if(typeof h[j]==="function"){h[j]=null}}}c=h.childNodes;if(c){b=c.length;for(f=0;f<b;f+=1){purge(h.childNodes[f])}}}catch(g){}c=null;j=null;h=null}function getPageOffsetLeft(b){var a;a=b.offsetLeft;if(b.offsetParent!=null){a+=getPageOffsetLeft(b.offsetParent)}return a}function getPageOffsetTop(a){var b;b=a.offsetTop;if(a.offsetParent!=null){b+=getPageOffsetTop(a.offsetParent)}return b}window.onunload=closeEngineWinAllPopups;