var xcira=new XCIRA();xcira.cssLoad();xcira.dojoLoad();function XCIRA(){this.src=document.getElementById("xcira").getAttribute("src");this.baseUrl=this.src.substring(0,this.src.indexOf("archway"))+"archway/";this.bgColor=document.getElementById("xcira").getAttribute("bgcolor");this.borderColor=document.getElementById("xcira").getAttribute("bordercolor");this.styleUrl=this.baseUrl+"css/xcira.css";this.dojoUrl="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js";this.lanename="";this.username="";this.password="";this.popUpUrl="";this.cssLoad=function(){var _1=document.createElement("link");_1.rel="stylesheet";_1.type="text/css";_1.href=this.styleUrl;document.getElementsByTagName("head")[0].appendChild(_1);};this.dojoLoad=function(){var _2=document.createElement("script");_2.type="text/javascript";if(_2.readyState){_2.onreadystatechange=function(){if(_2.readyState=="loaded"||_2.readyState=="complete"){_2.onreadystatechange=null;xcira.modalSetup();}};}else{_2.onload=this.modalSetup;}_2.src=this.dojoUrl;document.getElementsByTagName("head")[0].appendChild(_2);};this.modalSetup=function(){dojo.require("dojo.io.script");dojo.addOnLoad(function(){console.error=function(){};dojo.style(dojo.body(),{"margin":0,"padding":0});var _3=dojo.create("div",{id:"XCIRAmodaloverlay"},dojo.body());var _4=dojo.create("div",{id:"XCIRAmodal"},dojo.body());var _5=dojo.create("div",{id:"XCIRAstatustext"},_4);var _6=dojo.create("div",{id:"XCIRAbottompanel"},_4);var _7=dojo.create("img",{id:"XCIRAloadingimage",src:xcira.baseUrl+"images/loading.gif"},_6);var _8=dojo.create("button",{id:"XCIRAokbutton",innerHTML:"Ok"},_6);dojo.connect(_8,"onclick",xcira.hideModal);var _9=dojo.create("button",{id:"XCIRAenterbutton",innerHTML:"Click to Enter Auction"},_6);dojo.connect(_9,"onclick",xcira.popUpWindow);if(xcira.bgColor!=null){dojo.style(_3,"backgroundColor",xcira.bgColor);}if(xcira.borderColor!=null){dojo.style(_4,"borderColor",xcira.borderColor);}});};this.changeModalText=function(_a){var _b=dojo.byId("XCIRAstatustext");_b.innerHTML=_a;};this.changeBottomPanel=function(id){dojo.style("XCIRAloadingimage","display","none");dojo.style("XCIRAokbutton","display","none");dojo.style("XCIRAenterbutton","display","none");dojo.style(id,"display","block");};this.showModal=function(){dojo.style(dojo.body(),{"overflow":"hidden"});if(dojo.isIE){var _c=document.body.scrollLeft;var _d=document.body.scrollTop;var _e=document.body.offsetWidth;var _f=document.body.offsetHeight;}else{var _c=window.pageXOffset;var _d=window.pageYOffset;var _e=window.innerWidth;var _f=window.innerHeight;}dojo.style(dojo.byId("XCIRAmodaloverlay"),"left",(_c+"px"));dojo.style(dojo.byId("XCIRAmodaloverlay"),"top",(_d+"px"));dojo.style(dojo.byId("XCIRAmodal"),"left",((_e/2)+_c)-(dojo.byId("XCIRAmodal").clientWidth/2)+"px");dojo.style(dojo.byId("XCIRAmodal"),"top",((_f/2)+_d)-(dojo.byId("XCIRAmodal").clientHeight/2)+"px");dojo.fadeIn({beforeBegin:function(){dojo.style("XCIRAmodaloverlay","display","block");dojo.style("XCIRAmodal","display","block");},node:"XCIRAmodal",duration:500,onEnd:this.authenticateDelay}).play();};this.hideModal=function(){dojo.style(dojo.body(),{"overflow":"auto"});dojo.fadeOut({node:"XCIRAmodal",duration:500,onEnd:function(){dojo.style("XCIRAmodaloverlay","display","none");dojo.style("XCIRAmodal","left","-1000px");dojo.style("XCIRAmodal","top","-1000px");}}).play();};this.launchClient=function(_10,_11,_12){this.lanename=_10;this.username=_11;this.password=_12;this.changeModalText("Authenticating Access...<br />Please Wait");this.changeBottomPanel("XCIRAloadingimage");this.showModal();};this.launchViewer=function(_13){this.launchClient(_13,"viewer","viewer");};this.authenticateDelay=function(){setTimeout("xcira.authenticate();",2000);};this.authenticate=function(){dojo.io.script.get({url:xcira.baseUrl+"ajax/login.php",content:{lanename:xcira.lanename,username:xcira.username,password:xcira.password},callbackParamName:"callback",preventCache:true,timeout:10000,load:function(_14){if(_14.authenticated){xcira.popUpUrl=_14.url;xcira.changeModalText(_14.statusText);xcira.changeBottomPanel("XCIRAenterbutton");}else{xcira.changeModalText(_14.statusText);xcira.changeBottomPanel("XCIRAokbutton");}},error:function(err,_15){xcira.changeModalText("Sorry an error occurred while connecting to the auction. Please contact your auction house.");xcira.changeBottomPanel("XCIRAokbutton");}});};this.popUpWindow=function(){var _16=navigator.userAgent;if(_16.toLowerCase().indexOf("android")!=-1){window.open(xcira.popUpUrl,"_blank");}else{window.open(xcira.popUpUrl,"_blank","status=0, toolbar=0, menubar=0, resizable=1, width=1000, height=640");}xcira.hideModal();};};
