if(typeof GraniteClientLibraryManager=="undefined"){GraniteClientLibraryManager={debug:false,scripts:{},initialInclude:true,windowLoaded:false,contextPath:null,hook:null,channelCB:function(){return"" },setChannelCB:function(a){this.channelCB=a },isDebug:function(b){var a=document.location.href; return(typeof console!="undefined")&&(b||this.debug)&&a.indexOf("debugConsole=true")!=-1 },write:function(a,c){c=this.isDebug(c); var e=this.channelCB(); if(!e){e="default" }if(c){console.log("LibraryManager: detected channel: "+e) }for(var d=0; d0){ext=ext.substring(0,idx) }ext=ext.substring(ext.lastIndexOf(".")+1); if(this.initialInclude){this.initialInclude=false; if(typeof G_XHR_HOOK!="undefined"&&Object.prototype.toString.call(G_XHR_HOOK)==="[object Function]"){this.hook=G_XHR_HOOK }this.contextPath=this.detectContextPath(); var man=this; if(window.addEventListener){window.addEventListener("load",function(){man.windowLoaded=true },false) }else{if(window.attachEvent){window.attachEvent("onload",function(){man.windowLoaded=true }) }}}if(this.hook){var p={url:path,method:"GET"}; try{var out=this.hook(p); if(out){path=out.url }}catch(e){if(debug){console.log("LibraryManager: error during CQ_XHR_HOOK call: ",e.message) }}}if(this.contextPath){if(path.indexOf("/")==0&&path.indexOf(this.contextPath+"/")!=0){path=this.contextPath+path }}if(ext=="js"){if(debug){console.log("LibraryManager: --> writing js include: ",path) }if(this.windowLoaded){try{var request=document.all?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest(); request.open("GET",path,false); request.send(null); if(window.execScript){window.execScript(request.responseText) }else{eval.call(null,request.responseText) }}catch(err){if(debug){console.log("LibraryManager: --> evaluating js include failed: ",path) }}}else{document.writeln('