/*
 * Copyright CADMAI Software GmbH.
 * All rights reserved.
 *
 * Redistribution (includes making available on a web location) is permitted 
 * provided that the following conditions are met:
 *
 * The redistributor must hold one of these licenses:
 * a valid CADMAI WebGl-Publisher license (SingleWebGlPubLic)
 * a valid CADMAI WebGl-Publisher Revit export license (SingleWebGlRevitExportLic)
 * a valid CADMAI WebGl-Publisher Inventor export license (SingleWebGlInventorExportLic)
 * or a written permission of CADMAI Software GmbH 
 *
 * The redistributor / user does not have the right to change, translate,
 * back-develop, decompile or disassemble the software.
 * 
 * Redistributions must retain the above copyright notice, 
 * this list of conditions and the following disclaimer.
 *   
 * Neither the name of CADMAI Software GmbH nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 "\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74";var CmiWebAccessAdmin=function(){var o8=false;var F7=null;var _f="";var sc="\x2e\x2f\x43\x6d\x69\x41\x63\x63\x65\x73\x73\x2f";var QM=new zU("","","");var Mk=false;var s8=false;var Xz=1;this.getLastError=function(){return QM;};this.setAdminPassword=function(j5){_f=j5;};this.setWebAccessLocation=function(x7){sc=x7;};this.getResponseErrorCode=function(){if(F7!=null)return(F7.errorCode);else return("\x45\x72\x72\x6f\x72\x20\x72\x65\x61\x64\x69\x6e\x67\x20\x72\x65\x73\x70\x6f\x6e\x73\x65");};this.getResponseValue=function(){if(F7!=null)return(F7.responseValue);else return("\x45\x72\x72\x6f\x72\x20\x72\x65\x61\x64\x69\x6e\x67\x20\x72\x65\x73\x70\x6f\x6e\x73\x65");};this.getResponseData=function(){if(F7!=null)return(F7.cmiData);else return("\x45\x72\x72\x6f\x72\x20\x72\x65\x61\x64\x69\x6e\x67\x20\x72\x65\x73\x70\x6f\x6e\x73\x65");};this.getResponseContext=function(){if(F7!=null)return(F7.cmiWebAccessContext);else return("\x45\x72\x72\x6f\x72\x20\x72\x65\x61\x64\x69\x6e\x67\x20\x72\x65\x73\x70\x6f\x6e\x73\x65");};this.getIsReconnected=function(){return Mk;};this.setIsReconnected=function(O0){Mk=O0;};this.s=function(zf,BZ,dc){QM.name=zf;QM.message=BZ;QM.context=dc;if(s8){var k="\x43\x4d\x49\x5f\x45\x52\x52\x4f\x52\x7c"+zf+"\x7c"+BZ;this.sendCmiNotification(k);}};this.iv=function(){QM.name="";QM.message="";QM.context="";};this.eg=function(tv){F7=CmiHelpers.KK(tv,this);if(F7.errorCode!="\x53\x55\x43\x43\x45\x53\x53"){this.s(F7.errorCode,F7.responseValue,"\x41\x4a\x41\x58\x5f\x45\x52\x52\x4f\x52");}};this.setNotificationHandler=function(w5){if(document.addEventListener)window.addEventListener("\x6d\x65\x73\x73\x61\x67\x65",w5,false);else if(document.attachEvent)window.attachEvent("\x6f\x6e\x6d\x65\x73\x73\x61\x67\x65",w5);s8=true;return 0;};this.sendCmiNotification=function(k){if(s8==false)return-1;var DX=CmiHelpers.FT(k,Xz);if(DX==null){s8=false;this.s("\x43\x6d\x69\x57\x69\x6e\x64\x6f\x77\x2e\x73\x65\x6e\x64\x43\x6d\x69\x4e\x6f\x74\x69\x66\x69\x63\x61\x74\x69\x6f\x6e","\x59\x6f\x75\x72\x20\x62\x72\x6f\x77\x73\x65\x72\x20\x64\x6f\x65\x73\x20\x6e\x6f\x74\x20\x73\x75\x70\x70\x6f\x72\x74\x20\x6d\x65\x73\x73\x61\x67\x65\x20\x65\x76\x65\x6e\x74\x73","\x53\x43\x52\x49\x50\x54\x5f\x45\x52\x52\x4f\x52");return-1;}else{window.dispatchEvent(DX);Xz++;}return 0;};this.r8=function(){try{return new XMLHttpRequest();}catch(e){}try{return new ActiveXObject("\x4d\x69\x63\x72\x6f\x73\x6f\x66\x74\x2e\x58\x4d\x4c\x48\x54\x54\x50");}catch(e){}try{return new ActiveXObject("\x4d\x73\x78\x6d\x6c\x32\x2e\x58\x4d\x4c\x48\x54\x54\x50");}catch(e){}return null;};this.uR=function(s5){if(o8)this.wb(s5);else this.n7(s5);};this.wb=function(s5){var p;var NU=sc+"\x43\x6d\x69\x57\x65\x62\x41\x63\x63\x65\x73\x73\x2e\x64\x6c\x6c\x3f"+s5;var p=this.r8();if(p!=null){try{p.open("\x67\x65\x74",NU,false);p.send(null);}catch(N){this.s(N.name,N.message+"\x20\x28\x70\x6f\x73\x73\x69\x62\x6c\x65\x20\x63\x61\x6c\x6c\x20\x66\x72\x6f\x6d\x20\x66\x69\x6c\x65\x3a\x2f\x2f\x20\x55\x52\x4c\x29","\x53\x54\x44\x5f\x45\x52\x52\x52\x4f\x52");return-1;}if(p.status!=200){this.s("\x43\x6d\x69\x57\x65\x62\x41\x63\x63\x65\x73\x73\x2e\x63\x6d\x69\x53\x65\x6e\x64\x53\x79\x6e\x63\x41\x6a\x61\x78\x52\x65\x71\x75\x65\x73\x74","\x45\x72\x72\x6f\x72\x20\x73\x65\x6e\x64\x69\x6e\x67\x20\x58\x4d\x4c\x48\x74\x74\x70\x52\x65\x71\x75\x65\x73\x74\x73","\x53\x43\x52\x49\x50\x54\x5f\x45\x52\x52\x4f\x52");return-1;}if(p.responseText!=undefined){this.eg(p.responseText);return 0;}else{this.s("\x43\x6d\x69\x57\x65\x62\x41\x63\x63\x65\x73\x73\x2e\x63\x6d\x69\x53\x65\x6e\x64\x53\x79\x6e\x63\x41\x6a\x61\x78\x52\x65\x71\x75\x65\x73\x74","\x4e\x6f\x20\x72\x65\x73\x70\x6f\x6e\x73\x65\x20\x72\x65\x63\x65\x69\x76\x65\x64","\x53\x54\x44\x5f\x45\x52\x52\x52\x4f\x52");return-1;};}else{this.s("\x43\x6d\x69\x57\x65\x62\x41\x63\x63\x65\x73\x73\x2e\x63\x6d\x69\x53\x65\x6e\x64\x53\x79\x6e\x63\x41\x6a\x61\x78\x52\x65\x71\x75\x65\x73\x74","\x59\x6f\x75\x72\x20\x62\x72\x6f\x77\x73\x65\x72\x20\x64\x6f\x65\x73\x20\x6e\x6f\x74\x20\x73\x75\x70\x70\x6f\x72\x74\x20\x58\x4d\x4c\x48\x74\x74\x70\x52\x65\x71\x75\x65\x73\x74\x73","\x53\x43\x52\x49\x50\x54\x5f\x45\x52\x52\x4f\x52");return-1;}return-1;};this.n7=function(s5){var p;var NU=sc+"\x43\x6d\x69\x57\x65\x62\x41\x63\x63\x65\x73\x73\x2e\x64\x6c\x6c\x3f"+s5;var p=this.r8();if(p!=null){CmiHelpers.addEventListener(p,"\x6c\x6f\x61\x64",this.ge,this);CmiHelpers.addEventListener(p,"\x65\x72\x72\x6f\x72",this.S4,this);try{p.open("\x67\x65\x74",NU,true);p.send(null);return 0;}catch(N){this.s(N.name,N.message+"\x20\x28\x70\x6f\x73\x73\x69\x62\x6c\x65\x20\x63\x61\x6c\x6c\x20\x66\x72\x6f\x6d\x20\x66\x69\x6c\x65\x3a\x2f\x2f\x20\x55\x52\x4c\x29","\x53\x54\x44\x5f\x45\x52\x52\x52\x4f\x52");return-1;};}else{this.s("\x43\x6d\x69\x57\x65\x62\x41\x63\x63\x65\x73\x73\x2e\x63\x6d\x69\x53\x65\x6e\x64\x53\x74\x64\x41\x6a\x61\x78\x52\x65\x71\x75\x65\x73\x74","\x59\x6f\x75\x72\x20\x62\x72\x6f\x77\x73\x65\x72\x20\x64\x6f\x65\x73\x20\x6e\x6f\x74\x20\x73\x75\x70\x70\x6f\x72\x74\x20\x58\x4d\x4c\x48\x74\x74\x70\x52\x65\x71\x75\x65\x73\x74\x73","\x53\x43\x52\x49\x50\x54\x5f\x45\x52\x52\x4f\x52");return-1;}return 0;};this.ge=function(j){var p=j.target;switch(p.readyState){case 4:if(p.status!=200){this.s("\x43\x6d\x69\x57\x65\x62\x41\x63\x63\x65\x73\x73\x2e\x63\x6d\x69\x53\x65\x6e\x64\x53\x74\x64\x41\x6a\x61\x78\x52\x65\x71\x75\x65\x73\x74","\x45\x72\x72\x6f\x72\x20\x73\x65\x6e\x64\x69\x6e\x67\x20\x58\x4d\x4c\x48\x74\x74\x70\x52\x65\x71\x75\x65\x73\x74\x73","\x53\x43\x52\x49\x50\x54\x5f\x45\x52\x52\x4f\x52");return-1;}if((p.responseText!=undefined)&&(p.responseText.indexOf("\x63\x6d\x69\x41\x6a\x61\x78\x52\x65\x73\x70\x6f\x6e\x73\x65")!=-1)){this.eg(p.responseText);if(this.getResponseErrorCode()=="\x53\x55\x43\x43\x45\x53\x53"){this.iv();if(this.getResponseContext()=="\x43\x72\x65\x61\x74\x65\x43\x61\x64\x6d\x61\x69\x53\x65\x73\x73\x69\x6f\x6e"){this.setIsReconnected(false);}else if(this.getResponseContext()=="\x43\x6f\x6e\x6e\x65\x63\x74\x32\x43\x61\x64\x6d\x61\x69\x53\x65\x73\x73\x69\x6f\x6e"){this.setIsReconnected(true);}var k="\x43\x4d\x49\x5f\x49\x4e\x46\x4f\x7c\x52\x65\x71\x75\x65\x73\x74\x52\x65\x73\x75\x6c\x74\x52\x65\x63\x65\x69\x76\x65\x64";this.sendCmiNotification(k);};}else{this.s("\x43\x6d\x69\x57\x65\x62\x41\x63\x63\x65\x73\x73\x2e\x63\x6d\x69\x53\x65\x6e\x64\x53\x74\x64\x41\x6a\x61\x78\x52\x65\x71\x75\x65\x73\x74","\x4e\x6f\x20\x72\x65\x73\x70\x6f\x6e\x73\x65\x20\x72\x65\x63\x65\x69\x76\x65\x64\x20\x73\x74\x61\x74\x75\x73\x20\x74\x65\x78\x74\x20\x3d"+p.statusText+"\x20\x73\x74\x61\x74\x75\x73\x20\x3d"+p.status,"\x53\x43\x52\x49\x50\x54\x5f\x45\x52\x52\x4f\x52");}break;};};this.S4=function(j){var p=j.target;;this.s("\x43\x6d\x69\x57\x65\x62\x41\x63\x63\x65\x73\x73\x2e\x72\x65\x71\x75\x65\x73\x74\x45\x72\x72\x6f\x72","\x43\x6f\x75\x6c\x64\x20\x6e\x6f\x74\x20\x6c\x6f\x61\x64\x20\x6d\x6f\x64\x65\x6c\x2c\x20\x73\x74\x61\x74\x75\x73\x20\x74\x65\x78\x74\x20\x3d"+p.statusText+"\x20\x73\x74\x61\x74\x75\x73\x20\x3d"+p.status,"\x53\x43\x52\x49\x50\x54\x5f\x45\x52\x52\x4f\x52");};this.checkServerConnection=function(){var N=this.uR("\x57\x65\x62\x41\x63\x63\x65\x73\x73\x43\x6f\x6e\x6e\x65\x63\x74\x69\x6f\x6e\x54\x65\x73\x74");return N;};this.getWebAccessSettings=function(){var N=this.uR("\x47\x65\x74\x57\x65\x62\x41\x63\x63\x65\x73\x73\x53\x65\x74\x74\x69\x6e\x67\x73");return N;};this.setServerLogging=function(Fi){var s5;if(Fi)s5="\x45\x6e\x61\x62\x6c\x65\x4c\x6f\x67\x67\x69\x6e\x67\x3d\x74\x72\x75\x65\x26\x41\x64\x6d\x50\x77\x64\x3d"+_f;else s5="\x45\x6e\x61\x62\x6c\x65\x4c\x6f\x67\x67\x69\x6e\x67\x3d\x66\x61\x6c\x73\x65\x26\x41\x64\x6d\x50\x77\x64\x3d"+_f;return(this.uR(s5));};this.setSessionAutoCleanup=function(Ff){var s5;if(Ff)s5="\x45\x6e\x61\x62\x6c\x65\x43\x6c\x65\x61\x6e\x75\x70\x3d\x74\x72\x75\x65\x26\x41\x64\x6d\x50\x77\x64\x3d"+_f;else s5="\x45\x6e\x61\x62\x6c\x65\x43\x6c\x65\x61\x6e\x75\x70\x3d\x66\x61\x6c\x73\x65\x26\x41\x64\x6d\x50\x77\x64\x3d"+_f;return(this.uR(s5));};this.setSessionTimeout=function(timeout){var s5="\x43\x6f\x6e\x6e\x65\x63\x74\x69\x6f\x6e\x54\x69\x6d\x65\x6f\x75\x74\x3d"+timeout+"\x26\x41\x64\x6d\x50\x77\x64\x3d"+_f;return(this.uR(s5));};this.cleanupServerSessions=function(){var s5="\x43\x6c\x65\x61\x6e\x75\x70\x43\x61\x64\x6d\x61\x69\x53\x65\x73\x73\x69\x6f\x6e\x73\x26\x41\x64\x6d\x50\x77\x64\x3d"+_f;return(this.uR(s5));};this.destroyAllServerSessions=function(){var s5="\x44\x65\x73\x74\x72\x6f\x79\x43\x61\x64\x6d\x61\x69\x53\x65\x73\x73\x69\x6f\x6e\x73\x26\x41\x64\x6d\x50\x77\x64\x3d"+_f;return(this.uR(s5));};this.getServerList=function(){var s5="\x47\x65\x74\x53\x65\x72\x76\x65\x72\x4c\x69\x73\x74\x26\x41\x64\x6d\x50\x77\x64\x3d"+_f;return(this.uR(s5));};this.getSessionList=function(){var s5="\x47\x65\x74\x53\x65\x73\x73\x69\x6f\x6e\x4c\x69\x73\x74\x26\x41\x64\x6d\x50\x77\x64\x3d"+_f;return(this.uR(s5));};this.removeCadmaiServer=function(w7){var s5="\x52\x65\x6d\x6f\x76\x65\x43\x61\x64\x6d\x61\x69\x53\x65\x72\x76\x65\x72\x26\x53\x65\x72\x76\x65\x72\x4e\x61\x6d\x65\x3d"+w7+"\x26\x41\x64\x6d\x50\x77\x64\x3d"+_f;return(this.uR(s5));};this.addCadmaiServer=function(w7,ot,_M){var s5="\x41\x64\x64\x43\x61\x64\x6d\x61\x69\x53\x65\x72\x76\x65\x72\x26\x53\x65\x72\x76\x65\x72\x4e\x61\x6d\x65\x3d"+w7+"\x26\x4c\x6f\x67\x69\x6e\x4e\x61\x6d\x65\x3d"+ot+"\x26\x4c\x6f\x67\x69\x6e\x50\x77\x64\x3d"+_M+"\x26\x41\x64\x6d\x50\x77\x64\x3d"+_f;return(this.uR(s5));};this.createServerSession=function(){var s5="\x43\x72\x65\x61\x74\x65\x43\x61\x64\x6d\x61\x69\x53\x65\x73\x73\x69\x6f\x6e\x26\x41\x64\x6d\x50\x77\x64\x3d"+_f;return(this.uR(s5));};this.checkSessionConnection=function(sessionId){var s5="\x43\x61\x64\x6d\x61\x69\x53\x65\x73\x73\x69\x6f\x6e\x43\x6f\x6e\x6e\x65\x63\x74\x69\x6f\x6e\x54\x65\x73\x74\x26\x43\x6d\x69\x53\x65\x73\x73\x69\x6f\x6e\x49\x44\x3d"+sessionId;return(this.uR(s5));};this.keepCurrentSessionAlive=function(sessionId,f3){var s5;if(f3)s5="\x4b\x65\x65\x70\x53\x65\x73\x73\x69\x6f\x6e\x41\x6c\x69\x76\x65\x3d\x74\x72\x75\x65\x26\x43\x6d\x69\x53\x65\x73\x73\x69\x6f\x6e\x49\x44\x3d"+sessionId;else s5="\x4b\x65\x65\x70\x53\x65\x73\x73\x69\x6f\x6e\x41\x6c\x69\x76\x65\x3d\x66\x61\x6c\x73\x65\x26\x43\x6d\x69\x53\x65\x73\x73\x69\x6f\x6e\x49\x44\x3d"+sessionId;var N=this.uR(s5);return N;};this.killCmiSession=function(sessionId){var s5="\x4b\x69\x6c\x6c\x43\x6d\x69\x53\x65\x73\x73\x69\x6f\x6e\x26\x43\x6d\x69\x53\x65\x73\x73\x69\x6f\x6e\x49\x44\x3d"+sessionId;return(this.uR(s5));};};
