iKnowBase={Version:"@app.version@",locations:{ikbViewer:"/ikbViewer",resource:"/ressurs"},ensures:{facebox:{js:"/ressurs/iknowbase/libs/jquery-plugins/facebox/facebox.js",css:"/ressurs/iknowbase/libs/jquery-plugins/facebox/facebox.css"},ikbPopup:{js:["/ressurs/iknowbase/libs/jquery-plugins/ikbPopup/ikbPopup.js","/ressurs/iknowbase/libs/jquery-plugins/jquery.bgiframe.js"],css:"/ressurs/iknowbase/libs/jquery-plugins/ikbPopup/ikbPopup.css"},form:{js:"/ressurs/iknowbase/libs/jquery-plugins/jquery.form.js"}}};iKnowBase.errorPopup=function(A){jQuery("<div class='ikbErrorPopup' onclick='jQuery(this).slideUp();' />").hide().append(A).prependTo("body").slideDown();iKnowBase.log(A)};iKnowBase.log=function(A){if(window.console&&console.log){console.log(A)}else{if(window.opera&&opera.postError){opera.postError(A)}}};iKnowBase.nvl=function(A,B){if(A!=null){return A}else{return B}};iKnowBase.assert=function(A,B){if(!A){alert("iKnowBase.assert",B)}};iKnowBase.setCookie=function(B,D,A,F,C,E){document.cookie=B+"="+escape(D)+((A)?"; expires="+A.toGMTString():"")+((F)?"; path="+F:"")+((C)?"; domain="+C:"")+((E)?"; secure":"")};iKnowBase.getCookie=function(C){var B=document.cookie;var E=C+"=";var D=B.indexOf("; "+E);if(D==-1){D=B.indexOf(E);if(D!=0){return null}}else{D+=2}var A=document.cookie.indexOf(";",D);if(A==-1){A=B.length}return unescape(B.substring(D+E.length,A))};iKnowBase.deleteCookie=function(A,C,B){if(getCookie(A)){document.cookie=A+"="+((C)?"; path="+C:"")+((B)?"; domain="+B:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT"}};iKnowBase.toggleClassForClass=function(A,B){var C=document.getElementsByClassName(A);for(i=0;i<C.length;i++){this.toggleClassForElement("toggle",C[i],B)}};iKnowBase.toggleClassForElement=function(D,E,B,A){switch(D){case"toggle":return this.toggleClassForElement("check",E,B)?this.toggleClassForElement("remove",E,B):this.toggleClassForElement("add",E,B);case"swap":E.className=!this.toggleClassForElement("check",E,B)?E.className.replace(A,B):E.className.replace(B,A);break;case"add":if(!this.toggleClassForElement("check",E,B)){E.className+=E.className?" "+B:B}break;case"remove":var C=E.className.match(" "+B)?" "+B:B;E.className=E.className.replace(C,"");break;case"check":return new RegExp("\\b"+B+"\\b").test(E.className)}return E.className!=null?E.className:""};iKnowBase.ensure=function(A,B){jQuery.ensure(A,B)};iKnowBase.withFacebox=function(A){iKnowBase.ensure(iKnowBase.ensures.facebox,A)};iKnowBase.withIkbPopup=function(A){iKnowBase.ensure(iKnowBase.ensures.ikbPopup,A)};iKnowBase.withForm=function(A){iKnowBase.ensure(iKnowBase.ensures.form,A)};iKnowBaseDevelopment={Version:"@app.version@"};iKnowBaseDevelopment.showPortletCacheStatus=function(A,C){var D="ikb.showPortletCacheStatus."+A;var B=iKnowBase.getCookie(D);if(B==null){style="ikbPortletCacheUnknown";status="unknown status"}else{if(B==C){style="ikbPortletCacheCached";status="from cache"}else{style="ikbPortletCacheNotCached";status="not from cache"}}document.write("<div class='"+style+"'>");document.write("<!-- ");document.write("name="+D);document.write("; renderTime="+C);document.write("; cookieTime="+B);document.write(" -->");document.write("Cache");document.write(": delta="+(C-B));document.write("; "+status);document.writeln("</div>");iKnowBase.setCookie(D,C)};jQuery(function(){jQuery(".ikbComponentInformation .ikbHeader").bind("click",function(){jQuery(this).next().toggle()})});(function(A){A.ContentViewer={};function F(K,H,J){if(K){J=jQuery.extend({_rtarget:K,_ikbController:H,portlet:K},J||{})}var I=(K?location.href.match(/[^\?]*/)[0]:A.locations.ikbViewer+H);if(J!=null&&J!="undefined"){I=I+"?"+jQuery.param(J)}return I}function D(K,H,J){K=null;var I=F(K,H,J);A.log("Request: "+I);A.withIkbPopup(function(){jQuery.ikbPopup({post:I})});return false}function E(I){var H=jQuery("<div><img src='/ressurs/evita/iKBDesktop/images/common/loading-16x16.gif' /></div>").insertBefore(tree);this.navLoad(tree,params,function(){H.remove()})}function C(K,I){var H=jQuery("#"+K);var J=jQuery("<div class='ikbContentViewerLoading'></div>").prependTo(H);H.load(I,{ikbRender:K},function(M,L){if(L!="success"){J.remove();A.errorPopup("refreshComponent error: id="+K+"; status="+L)}});return false}function G(J,I,H){var K=jQuery("<form method='post'>");K.append("<input type='hidden' name='ikbAction' value='"+J+"' />");K.append("<input type='hidden' name='"+J+".operation' value='"+I+"' />");K.append("<input type='hidden' name='"+J+".arg' value='"+H+"' />");K.appendTo("body").submit();return false}function B(J,I,H){var K=jQuery("<form method='post'>");K.append("<input type='hidden' name='"+J+".operation' value='"+I+"' />");if(I=="startrow"||I=="sortinfo"){K.append("<input type='hidden' name='"+J+".arg' value='"+H+"' />")}else{if(I=="checkin"||I=="checkout"){K.append("<input type='hidden' name='"+J+".document_id' value='"+H+"' />")}}K.appendTo("body").submit();return false}jQuery.extend(A.ContentViewer,{getUrl:F,navigatePage:G,navigatePortal:B,reloadComponent:C,deleteDocument:function(I,H,J){return D(J,"/private/document/delete/request",{docid:I,version:(H||0)})},deleteDocumentConfirm:function(I,H,K,J){return D(J,"/private/document/delete/confirm",{docid:I,version:(H||0),mode:K})},changeDocumentType:function(H,I,J){return D(J,"/private/document/changeDocumentType/request",{docid:H,quickLinkGuid:I})},changeDocumentTypeConfirm:function(H,I,J){return D(J,"/private/document/changeDocumentType/confirm",{docid:H,formGuid:I})},copyDocument:function(H,I,J){return D(J,"/private/document/copy/request",{docid:H,quickLinkGuid:I})},copyDocumentConfirm:function(H,I,J){return D(J,"/private/document/copy/confirm",{docid:H,formGuid:I})},selectPersonalAcl:function(J,I,H){return D(J,"/private/personalAcl/popup",{cbFunction:I,cbClosure:H})}})})(iKnowBase);iKnowBase.ContentViewer.EditOpenOfficeDocument=function(M,L,C,E,F){if(C==null){C=""}try{var B="";if(M=="INDIRECT"){var D=jQuery.ajax({type:"GET",async:false,url:encodeURI(L),beforeSend:function(N){N.setRequestHeader("x-iknowbase-getcontent-url",L)}});if(D.status!=200){iKnowBase.errorPopup("XMLHTTPError: "+D.status+"="+D.statusText+" (url="+L+")");return }L=D.getResponseHeader("x-iknowbase-content-url");B=D.getResponseHeader("x-iknowbase-content-filename")}var G=new ActiveXObject("com.sun.star.ServiceManager");var A=G.createInstance("com.sun.star.reflection.CoreReflection");var I=G.createInstance("com.sun.star.frame.Desktop");var K=new Array();var H=I.loadComponentFromURL(L,"_blank",0,K)}catch(J){iKnowBase.errorPopup("Error opening document. Error= "+J.name+"; description="+J.message)}};iKnowBase.ContentViewer.EditMSOfficeDocument=function(J,I,C,E,F){if(!window.ActiveXObject){iKnowBase.errorPopup("This function requires support for ActiveXObject (typically Microsoft Internet Explorer)");return }if(C==null){C=""}var D=null;var K=null;try{var A="";if(J=="INDIRECT"){var B=jQuery.ajax({type:"GET",async:false,url:encodeURI(I),beforeSend:function(L){L.setRequestHeader("x-iknowbase-getcontent-url",I)}});if(B.status!=200){iKnowBase.errorPopup("XMLHTTPError: "+B.status+"="+B.statusText+" (url="+I+")");return }I=B.getResponseHeader("x-iknowbase-content-url");A=B.getResponseHeader("x-iknowbase-content-filename")}if(this.ikbCustomEditWindowsDocument){var G=ikbCustomEditWindowsDocument("PREOPEN",null,I,C,A,F);if(!G){return }}D=new ActiveXObject("iKnowBase.RemoteDocument");K=D.OpenDocument("",I,C,E,A);if(K){if(this.ikbCustomEditWindowsDocument){var G=ikbCustomEditWindowsDocument("POSTOPEN-SUCCESS",K,I,C,A,F);if(!G){return }}}else{if(this.ikbCustomEditWindowsDocument){var G=ikbCustomEditWindowsDocument("POSTOPEN-FAILURE",K,I,C,A,F);if(!G){return }}window.open(I,"_blank")}D=null;K=null}catch(H){iKnowBase.errorPopup("Error opening document. Error= "+H.name+"; description="+H.message);D=null;K=null}};function openOODoc(D,B,E,A,C){iKnowBase.ContentViewer.EditOpenOfficeDocument(D,B,E,A,C)}function ikbEditWindowsDocument(D,B,E,A,C){iKnowBase.ContentViewer.EditMSOfficeDocument(D,B,E,A,C)}function ikbOfficeSetProperty(D,A,B){try{D.CustomDocumentProperties(A).Value=B}catch(C){D.CustomDocumentProperties.Add(A,false,4,B)}}