var BizExplorer={ACTIVEX_STARTUP_COOKIE_NAME:"BizActiveXStartup",ACTIVEX_VERSIONUP_COOKIE_NAME:"BizActiveXVersionup",ACTIVEX_INSTALL:{INSTALL:"1",NOTYET:"0"},ACTIVEX_INFO:null,LAUNCH_INFO:null,_loginInfo:null,_sessionKey:null,_authIP:null,_authPort:null,_viewMode:null,_language:null,_installCheck:null,_loadingLayerURL:location.protocol+"//"+location.hostname+"/webfolder/layer/loadingactivex.aspx",initilize:function(i,f,b,c,e,g){this._loginInfo=i;this._sessionKey=f;this._authIP=b;this._authPort=c;this._viewMode=e;this._language=g;var h;var a=new Hash();var d=new Hash();new Ajax.Request(location.protocol+"//"+location.hostname+"/static/xml/bizexplorer.xml",{method:"GET",asynchronous:false,onSuccess:function(m){h=m.responseXML;var l=h.documentElement.getElementsByTagName("activex")[0].childNodes;for(var j=0;j<l.length;j++){if(l[j].nodeType==1){a.set(l[j].nodeName,l[j].firstChild.nodeValue)}}var k=h.documentElement.getElementsByTagName("launchitem")[0].getElementsByTagName("item");for(var j=0;j<k.length;j++){d.set(k[j].getAttribute("id"),new Array(k[j].getElementsByTagName("urlupdate")[0].firstChild.nodeValue,k[j].getElementsByTagName("urlsetup")[0].firstChild.nodeValue))}}});this.ACTIVEX_INFO=a;this.LAUNCH_INFO=d;if(CookieManager.getCookie(this.ACTIVEX_STARTUP_COOKIE_NAME)==this.ACTIVEX_INSTALL.INSTALL){document.getElementById(this.ACTIVEX_INFO.get("containerid")).innerHTML=this.getActiveXScript();CookieManager.setCookie(this.ACTIVEX_STARTUP_COOKIE_NAME,this.ACTIVEX_INSTALL.NOTYET,"/");if(CookieManager.getCookie(this.ACTIVEX_VERSIONUP_COOKIE_NAME)!=this.ACTIVEX_INSTALL.INSTALL){layerOn(352,198,this._loadingLayerURL+"?type=2",false,false,false,"loading");this._installCheck=setInterval("BizExplorer.checkInstall()",500)}else{CookieManager.setCookie(this.ACTIVEX_VERSIONUP_COOKIE_NAME,this.ACTIVEX_INSTALL.NOTYET,"/")}}},getActiveXScript:function(){return String.format('<object id="{0}" codebase="{1}#Version={2}" classid="CLSID:{3}" style="width:0px;height:0px;" width="0" height="0"></object>',this.ACTIVEX_INFO.get("objectid"),this.ACTIVEX_INFO.get("codebase"),this.ACTIVEX_INFO.get("version"),this.ACTIVEX_INFO.get("clsid"))},getActiveXObj:function(){return document.getElementById(this.ACTIVEX_INFO.get("objectid"))},startUpActiveX:function(){if(!this.detectActiveXControl()){if(this.checkSecurityMode()){CookieManager.setCookie(this.ACTIVEX_STARTUP_COOKIE_NAME,this.ACTIVEX_INSTALL.INSTALL,"/");layerOn(352,260,this._loadingLayerURL+"?type=1",false,false,false,"loading")}else{layerOn(352,198,this._loadingLayerURL+"?type=2",false,false,false,"loading");this._installCheck=setInterval("BizExplorer.checkInstall()",500)}document.getElementById(this.ACTIVEX_INFO.get("containerid")).innerHTML=this.getActiveXScript()}},detectActiveXControl:function(){var a;try{var c=new ActiveXObject(this.ACTIVEX_INFO.get("controlid"));if(c){a=true}else{a=false}}catch(b){a=false}return a},cancelInstall:function(){CookieManager.setCookie(this.ACTIVEX_STARTUP_COOKIE_NAME,this.ACTIVEX_INSTALL.NOTYET,"/");document.getElementById(this.ACTIVEX_INFO.get("containerid")).innerHTML=""},checkInstall:function(){if(this.detectActiveXControl()){clearInterval(this._installCheck);layerOff("loading")}},checkValidPlatform:function(launchType){var result=true;try{var strUserAgent=navigator.userAgent;var i=strUserAgent.search(/windows [a-zA-Z0-9][a-zA-Z0-9]/i);if(i==-1){throw"platform"}var tokenIdx=strUserAgent.indexOf(";",i)!=-1?strUserAgent.indexOf(";",i):strUserAgent.indexOf(")",i);var strWinVersion=strUserAgent.substring(i+8,tokenIdx);var j=strWinVersion.indexOf("NT ");if(j==-1){throw"platform"}var strWinNTVersion=strWinVersion.substring(j+3,strWinVersion.length);var strValidNTVersion=launchType=="WID"?5.1:5;if(strWinNTVersion<strValidNTVersion){throw"platform"}if(!Prototype.Browser.IE){throw"browser"}}catch(e){var strMsgLaunchType=eval("MSG_BIZEX_"+launchType.toUpperCase());if(e=="platform"){alert(String.format(MSG_UNABLEPLATFORM,strMsgLaunchType,launchType=="WID"?MSG_PLATFORM_XP:MSG_PLATFORM_2000))}else{if(confirm(String.format(MSG_MANUALINSTALL,strMsgLaunchType))){this.launchSetup(launchType)}}result=false}return result},checkSecurityMode:function(){if(navigator.userAgent.indexOf("Windows NT 5.0")!=-1){return false}if(navigator.userAgent.indexOf("Windows NT 5.1")!=-1){if(navigator.userAgent.indexOf("MSIE 6.0")!=-1){if(navigator.userAgent.indexOf("SV1")==-1){return false}}}return true},launchExplorer:function(b,f){if(!(this._authIP&&this._authPort&&this._viewMode&&this._language)){alert(MSG_AUTHFAIL);return}if(!this.checkValidPlatform(b)){return}if(this.detectActiveXControl()){document.getElementById(this.ACTIVEX_INFO.get("containerid")).innerHTML=this.getActiveXScript();CookieManager.setCookie(this.ACTIVEX_STARTUP_COOKIE_NAME,this.ACTIVEX_INSTALL.NOTYET,"/")}var a=this.getActiveXObj();if(a){a.LoginInfo=this._loginInfo;a.SessionKey=this._sessionKey;a.AuthIP=this._authIP;a.AuthPort=this._authPort;a.ViewMode=this._viewMode;a.Language=this._language;a.ExecuteMode=b;a.UpdateURL=this.LAUNCH_INFO.get(b)[0];if(f){for(var d in f){a[d]=f[d]}}try{confirmResult=a.LaunchingApp();if(confirmResult!="0"){alert(String.format(MSG_LAUNCHFAIL,confirmResult))}}catch(c){CookieManager.setCookie(this.ACTIVEX_STARTUP_COOKIE_NAME,this.ACTIVEX_INSTALL.INSTALL,"/");CookieManager.setCookie(this.ACTIVEX_VERSIONUP_COOKIE_NAME,this.ACTIVEX_INSTALL.INSTALL,"/");location.href=location.href}}else{try{this.startUpActiveX()}catch(c){}}},launchSetup:function(a){location.href=this.LAUNCH_INFO.get(a)[1]}};