iKnowBase={Version:"5.9.3",loadTime:new Date().getTime(),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/content-services/common-popup/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"}},config:{ikbLanguage:"us",locale:"en",href:(function(){var A=/([^?#]*)(#[^?]*)?(.*)/.exec(window.location.href);return A[1]+(A[3]||"")})()}};iKnowBase.init=function(A){jQuery.extend(iKnowBase.config,A)};iKnowBase.setLanguage=function(B,A){iKnowBase.ikbLanguage=B||iKnowBase.ikbLanguage;iKnowBase.locale=A||iKnowBase.locale};iKnowBase.setLocale=function(A){iKnowBase.locale=A};iKnowBase.errorPopup=function(A){jQuery("<div class='ikbErrorPopup' onclick='jQuery(this).slideUp();' />").hide().append(A).prependTo("body").slideDown();iKnowBase.log(A)};iKnowBase.log=function(){var A=Array.prototype.slice.call(arguments);if(window.console&&console.log){console.log(new Date().getTime()-iKnowBase.loadTime,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){iKnowBase.errorPopup("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.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)};iKnowBase.withImagepicklist=function(C){var B=iKnowBase.locations.resource+"/iknowbase/cs";var A={js:[iKnowBase.locations.resource+"/iknowbase/libs/jquery-plugins/jquery.form.js",B+((document.location.href.indexOf("jsdebug=true")<=0)?"/js/image-archive-full-min.js":"/js/image-archive-full.js"),"/ikbViewer/ext/cs/imagearchive/picklist.js",B+"/js/content-studio.js"],css:B+"/css/imagearchive.css"};if(iKnowBase.config.ikbLanguage == 'n'){A.js.push(B+"/js/image-archive/image-archive-no_NB.js")}iKnowBase.ensure(A,C)};iKnowBase.withExt3=function(C){var B=iKnowBase.locations.resource+"/iknowbase/libs/ext3";var A=null;iKnowBase.ensure({js:[B+"/ext-base.js",B+"/ext-all.js"],css:B+"/resources/css/ext-ikb.css",wait:function(){A=A||jQuery("<div class='ikb-cssmarker-ext3' style='display:none'>").appendTo("body");iKnowBase.log("Waiting...",A.css("position"));return A.css("position")=="fixed"}},function(){C(Ext)})};iKnowBase.withExt4=function(D){if(window.Ext4){D(Ext4);return }var C=iKnowBase.locations.resource+"/iknowbase/libs/ext4";var B=null;var A={js:[C+"/builds/ext-all-sandbox"+((document.location.href.indexOf("jsdebug=true")<=0)?".js":"-debug.js")],css:C+"/resources/css/ext-sandbox.css",wait:function(){B=B||jQuery("<div class='ikb-cssmarker-ext4' style='display:none'>").appendTo("body");iKnowBase.log("Waiting...",B.css("position"));return B.css("position")=="fixed"}};if(iKnowBase.config.ikbLanguage == 'n'){A.js.push(C+"/locale/ext-lang-no_NB.js")}iKnowBase.ensure(A,function(){Ext4.onReady(function(){Ext4.fly(document.body).removeCls("x4-body");Ext4.tip.QuickTipManager.init();D(Ext4)});if(!Ext4.EventManager.hasFiredReady){Ext4.EventManager.fireDocReady()}})};function ikbPopup(A,C,D){var B=(typeof A==="string"?A:A.href);window.open(B,C,D).focus();return false}iKnowBaseDevelopment={Version:"5.9.3"};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(B,G){var E=[];B.ensure=function(H,I){F(G.makeArray(H.js),G.makeArray(H.css),H.wait,I)};function F(H,I,L,M){var K=0;G.each(I,function(){var N=""+this;if(A(N)||D("link[href$='"+N+"']")){B.log("Already loaded: "+N)}else{B.log("Requesting CSS: "+N);var P=document.createElement("link");P.setAttribute("href",N);P.setAttribute("rel","stylesheet");P.setAttribute("type","text/css");var O=document.getElementsByTagName("head")[0]||document.documentElement;O.appendChild(P);C(N)}});G.each(H,function(){var N=this;if(A(N)||D("script[src$='"+N+"']")){B.log("Already loaded: "+N)}else{B.log("getScript() starts: "+N);++K;G.ajax({type:"GET",async:false,url:N,success:function(){C(N)},error:function(){B.errorPopup("getScript() failed: "+N)},complete:function(){B.log("getScript() complete: "+N);K--},dataType:"script",cache:true,timeout:12000})}});var J=0;(function(){++J;if(K<=0&&(!L||L())){return(M&&M())}else{if(J>100){B.log("Reached iteration #100 ... exiting");return false}else{B.log("waitForScripts: scriptsToLoad="+K+"; iteration="+J+"; waiting for 25msec");window.setTimeout(arguments.callee,25)}}})()}function D(H){count=G(H).length;return count>0}function A(H){return E[H]===true}function C(H){E[H]=true}})(iKnowBase,jQuery);(function(B){B.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]:B.locations.ikbViewer+H);if(J!=null&&J!="undefined"){I=I+"?"+jQuery.param(J)}return I}function E(K,H,J){K=null;var I=F(K,H,J);B.log("Request: "+I);B.withIkbPopup(function(){jQuery.ikbPopup({post:I})});return false}function D(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();B.errorPopup("refreshComponent error: id="+K+"; status="+L)}});return false}function A(J,I,H){iKnowBase.log("clickAction",arguments);if(H&&(H.altKey||H.ctrlKey||H.shiftKey)){return true}return iKnowBase.PageEngine.reloadComponent(J,I.href)}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 C(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(B.ContentViewer,{getUrl:F,navigatePage:G,navigatePortal:C,reloadComponent:D,clickAction:A,deleteDocument:function(I,H,J){return E(J,"/private/document/delete/request",{docid:I,version:(H||0)})},deleteDocumentConfirm:function(I,H,K,J){return E(J,"/private/document/delete/confirm",{docid:I,version:(H||0),mode:K})},changeDocumentType:function(H,I,J){return E(J,"/private/document/changeDocumentType/request",{docid:H,quickLinkGuid:I})},changeDocumentTypeConfirm:function(H,I,J){return E(J,"/private/document/changeDocumentType/confirm",{docid:H,formGuid:I})},copyDocument:function(H,I,J){return E(J,"/private/document/copy/request",{docid:H,quickLinkGuid:I})},copyDocumentConfirm:function(H,I,J){return E(J,"/private/document/copy/confirm",{docid:H,formGuid:I})},selectPersonalAcl:function(J,I,H){return E(J,"/private/personalAcl/popup",{cbFunction:I,cbClosure:H})},editPersonalAcl:function(H){return E(null,"/private/personalAcl/popup",{acl:H})},set_new_version:function(K,H,J){var I="/ikbViewer/pls/ikb_ce_custom_editor_portlet.switch_version?p_document_id="+encodeURIComponent(K)+"&p_site_id="+encodeURIComponent(J)+"&p_version_no="+encodeURIComponent(H);var L=jQuery.ajax({url:I,async:false}).responseText;if(L!="OK"){alert(L)}else{window.location.reload()}}})})(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(window.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(window.ikbCustomEditWindowsDocument){var G=ikbCustomEditWindowsDocument("POSTOPEN-SUCCESS",K,I,C,A,F);if(!G){return }}}else{if(window.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)}}(function(A){var C=B;function E(){A.log("AddinLoader: loading is already in progress")}function B(F){var G="AddinLoader: withAddin";A.log(G);C=E;jQuery.getScript("/ressurs/iknowbase/content-services/office-addin/office-addin.js",function(){A.log(": IKB.OfficeAddin loaded ok...");F()})}function D(G){var F="AddinLoader: editDocument";A.log(F);C(function(){A.log(": IKB.OfficeAddin loaded ok");A.OfficeAddin.editDocument(G)})}A.OfficeAddin={editDocument:D}})(iKnowBase);(function(B){var H;function F(I,K){var J=(B.locations.ikbViewer+I);if(K!==H){J=(J.match(/\?/)?"&":"?")+jQuery.param(K)}return J}function E(I){return jQuery("<div class='ikbContentViewerLoading'></div>").prependTo(I)}function D(L,M,K){var J=B.config.href;var I={};if(typeof L==="string"){L=jQuery("#"+L)}if(typeof M==="string"){J=M;I=K}else{I=M}var I=jQuery.extend({ikbRender:L.attr("id")},I);var N=E(L);L.load(J,I,function(P,O){if(O!="success"){N.remove();B.errorPopup("reloadComponent error: id="+L.attr("id")+"; status="+O)}});return false}function A(I,J){B.log("_callTargetService",{url:I,data:J});jQuery.ajax({url:I,type:"POST",data:J,dataType:"json",error:function(M,L,K){B.log("_callTargetService: Error loading location info",{url:I,message:L,ex:K});window.location=I},success:function(K){B.log("_callTargetService: Target destination",K);if(K.data.windowName!=null){var L=K.data.windowFeatures;if(K.data.windowHeight){L="height="+K.data.windowHeight+",top="+(Math.max(screen.height-K.data.windowHeight,0)/2)+","+L}if(K.data.windowWidth){L="width="+K.data.windowWidth+",left="+(Math.max(screen.width-K.data.windowWidth,0)/2)+","+L}var M=window.open(K.data.URL,K.data.windowName,L)}else{window.location=K.data.URL}}})}function G(J){var I=function(K){return encodeURIComponent(K||"")};if(B.config.isPage){A(B.config.href,{ikbAction:"ikb$goTarget",ikb$goTarget:jQuery.map([J.guid].concat(J.data),I)})}else{A(B.locations.ikbViewer+"/go/target/"+J.guid,{_p:jQuery.map(J.data,I)})}return false}function C(J,I){if(I&&(I.altKey||I.ctrlKey||I.shiftKey)){return true}A((typeof J==="string")?J:J.href);return false}B.PageEngine={showLoading:E,reloadComponent:D,goTarget:G,clickTarget:C}})(iKnowBase);function ikbGoTarget(B,A){return iKnowBase.PageEngine.clickTarget(B,A)}(function(A){function C(E,F){$("*").css("cursor","progress");setTimeout(function(){iKnowBase.withExt4(function(){iKnowBase.withImagepicklist(function(){$("*").css("cursor","auto");return A.ContentStudio.doSelectImage(E,F)})})},100)}function D(F,E){iKnowBase.withExt4(function(){iKnowBase.withImagepicklist(function(){return A.ContentStudio.doSetImagePropertiesForEditor(F,E)})})}function B(E){iKnowBase.withExt4(function(){iKnowBase.withImagepicklist(function(){return A.ContentStudio.doEditImageProperties(E)})});return false}A.ContentStudio={selectImage:C,setImagePropertiesForEditor:D,editImageProperties:B}})(iKnowBase)
