var isZoomed=false;var Library={};Library.ease=function(){this.target=0;this.position=0;this.move=function(B,A){this.position+=(B-this.position)*A}};var tv={positions:[],O:[],screen:{},grid:{size:4,borderSize:2,zoomed:false},angle:{x:new Library.ease(),y:new Library.ease()},camera:{x:new Library.ease(),y:new Library.ease(),zoom:new Library.ease(),focalLength:650},init:function(){this.screen.obj=document.getElementById("screen");var B=document.getElementById("bankImages").getElementsByTagName("img");this.screen.obj.onselectstart=function(){return false};this.screen.obj.ondrag=function(){return false};var D=0;var H=(tv.grid.size/2)-0.5;for(var G=-H;G<=H;G++){for(var A=-H;A<=H;A++){var E=document.createElement("img");var C=B[(D++)%B.length];E.className="tvout";E.src=C.src;tv.screen.obj.appendChild(E);E.point3D={x:A,y:G,z:new Library.ease()};E.point2D={};E.ratioImage=1;tv.O.push(E);E.onmouseover=function(){if(!tv.grid.zoomed){if(tv.o){tv.o.point3D.z.target=0;tv.o.className="tvout"}this.className="tvover";this.point3D.z.target=-0.5;tv.o=this}};E.onclick=function(){if(!tv.grid.zoomed){tv.camera.x.target=this.point3D.x;tv.camera.y.target=this.point3D.y;tv.camera.zoom.target=tv.screen.w*1.25;tv.grid.zoomed=this}else{if(this==tv.grid.zoomed){tv.camera.x.target=0;tv.camera.y.target=0;tv.camera.zoom.target=tv.screen.w/(tv.grid.size+0.1);tv.grid.zoomed=false;isZoomed=false}}};E.calc=function(){this.point3D.z.move(this.point3D.z.target,0.5);var J=(this.point3D.x-tv.camera.x.position)*tv.camera.zoom.position;var O=(this.point3D.y-tv.camera.y.position)*tv.camera.zoom.position;var N=this.point3D.z.position*tv.camera.zoom.position;var L=tv.angle.cx*O-tv.angle.sx*N;var K=tv.angle.sx*O+tv.angle.cx*N;var M=tv.angle.cy*K-tv.angle.sy*J;var I=tv.angle.sy*K+tv.angle.cy*J;this.point2D.scale=tv.camera.focalLength/(tv.camera.focalLength+M);this.point2D.x=I*this.point2D.scale*1.9;this.point2D.y=L*this.point2D.scale*1.9;this.point2D.w=Math.round(Math.max(0,this.point2D.scale*tv.camera.zoom.position*1.7));if(this.ratioImage>1){this.point2D.h=Math.round(this.point2D.w/this.ratioImage)}else{this.point2D.h=this.point2D.w;this.point2D.w=Math.round(this.point2D.h*this.ratioImage)}};E.draw=function(){if(this.complete){if(!this.loaded){if(!this.img){this.img=new Image();this.img.src=this.src}if(this.img.complete){this.style.visibility="visible";this.ratioImage=this.img.width/this.img.height;this.loaded=true;this.img=false}}this.style.left=Math.round(this.point2D.x*this.point2D.scale+tv.screen.w-this.point2D.w*0.5)+"px";this.style.top=Math.round(this.point2D.y*this.point2D.scale+tv.screen.h-this.point2D.h*0.5)+"px";this.style.width=this.point2D.w+"px";this.style.height=this.point2D.h+"px";this.style.borderWidth=Math.round(Math.max(this.point2D.w,this.point2D.h)*tv.grid.borderSize*0.01)+"px";this.style.zIndex=Math.floor(this.point2D.scale*100)}}}}tv.resize();var F=(Math.round((Math.random()*9)+1))%15;ax=tv.O[8].point3D.x;ay=tv.O[8].point3D.y;bx=tv.O[F].point3D.x;by=tv.O[F].point3D.y;tv.O[F].point3D.x=ax;tv.O[F].point3D.y=ay;tv.O[8].point3D.x=bx;tv.O[8].point3D.y=by;mouse.y=tv.screen.y+tv.screen.h;mouse.x=tv.screen.x+tv.screen.w;tv.run()},resize:function(){var A=tv.screen.obj;tv.screen.w=A.offsetWidth/2;tv.screen.h=A.offsetHeight/2;tv.camera.zoom.target=tv.screen.w/(tv.grid.size+0.1);for(tv.screen.x=0,tv.screen.y=0;A!=null;A=A.offsetParent){tv.screen.x+=A.offsetLeft;tv.screen.y+=A.offsetTop}},run:function(){tv.angle.x.move(-(mouse.y-tv.screen.h-tv.screen.y)*0.0025,0.1);tv.angle.y.move((mouse.x-tv.screen.w-tv.screen.x)*0.0025,0.1);tv.camera.x.move(tv.camera.x.target,tv.grid.zoomed?0.25:0.025);tv.camera.y.move(tv.camera.y.target,tv.grid.zoomed?0.25:0.025);tv.camera.zoom.move(tv.camera.zoom.target,0.1);tv.angle.cx=Math.cos(tv.angle.x.position);tv.angle.sx=Math.sin(tv.angle.x.position);tv.angle.cy=Math.cos(tv.angle.y.position);tv.angle.sy=Math.sin(tv.angle.y.position);for(var A=0,B;B=tv.O[A];A++){B.calc();B.draw()}setTimeout(tv.run,32)}};var mouse={x:0,y:0};document.onmousemove=function(A){if(window.event){A=window.event}mouse.x=A.clientX;mouse.y=A.clientY;return false};if(typeof deconcept=="undefined"){var deconcept=new Object()}if(typeof deconcept.util=="undefined"){deconcept.util=new Object()}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object()}deconcept.SWFObject=function(K,B,L,D,H,I,F,E,C,J){if(!document.getElementById){return }this.DETECT_KEY=J?J:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(K){this.setAttribute("swf",K)}if(B){this.setAttribute("id",B)}if(L){this.setAttribute("width",L)}if(D){this.setAttribute("height",D)}if(H){this.setAttribute("version",new deconcept.PlayerVersion(H.toString().split(".")))}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true}if(I){this.addParam("bgcolor",I)}var A=F?F:"high";this.addParam("quality",A);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var G=(E)?E:window.location;this.setAttribute("xiRedirectUrl",G);this.setAttribute("redirectUrl","");if(C){this.setAttribute("redirectUrl",C)}};deconcept.SWFObject.prototype={useExpressInstall:function(A){this.xiSWFPath=!A?"expressinstall.swf":A;this.setAttribute("useExpressInstall",true)},setAttribute:function(A,B){this.attributes[A]=B},getAttribute:function(A){return this.attributes[A]},addParam:function(B,A){this.params[B]=A},getParams:function(){return this.params},addVariable:function(B,A){this.variables[B]=A},getVariable:function(A){return this.variables[A]},getVariables:function(){return this.variables},getVariablePairs:function(){var C=new Array();var B;var A=this.getVariables();for(B in A){C[C.length]=B+"="+A[B]}return C},getSWFHTML:function(){var B="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath)}B='<embed type="application/x-shockwave-flash" src="'+this.getAttribute("swf")+'" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'"';B+=' id="'+this.getAttribute("id")+'" name="'+this.getAttribute("id")+'" ';var F=this.getParams();for(var E in F){B+=[E]+'="'+F[E]+'" '}var D=this.getVariablePairs().join("&");if(D.length>0){B+='flashvars="'+D+'"'}B+="/>"}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath)}B='<object id="'+this.getAttribute("id")+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+this.getAttribute("width")+'" height="'+this.getAttribute("height")+'" style="'+this.getAttribute("style")+'">';B+='<param name="movie" value="'+this.getAttribute("swf")+'" />';var C=this.getParams();for(var E in C){B+='<param name="'+E+'" value="'+C[E]+'" />'}var A=this.getVariablePairs().join("&");if(A.length>0){B+='<param name="flashvars" value="'+A+'" />'}B+="</object>"}return B},write:function(B){if(this.getAttribute("useExpressInstall")){var A=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(A)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title)}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var C=(typeof B=="string")?document.getElementById(B):B;C.innerHTML=this.getSWFHTML();return true}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"))}}return false}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var E=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var A=navigator.plugins["Shockwave Flash"];if(A&&A.description){E=new deconcept.PlayerVersion(A.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."))}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var B=1;var C=3;while(B){try{C++;B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+C);E=new deconcept.PlayerVersion([C,0,0])}catch(D){B=null}}}else{try{var B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7")}catch(D){try{var B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");E=new deconcept.PlayerVersion([6,0,21]);B.AllowScriptAccess="always"}catch(D){if(E.major==6){return E}}try{B=new ActiveXObject("ShockwaveFlash.ShockwaveFlash")}catch(D){}}if(B!=null){E=new deconcept.PlayerVersion(B.GetVariable("$version").split(" ")[1].split(","))}}}return E};deconcept.PlayerVersion=function(A){this.major=A[0]!=null?parseInt(A[0]):0;this.minor=A[1]!=null?parseInt(A[1]):0;this.rev=A[2]!=null?parseInt(A[2]):0};deconcept.PlayerVersion.prototype.versionIsValid=function(A){if(this.major<A.major){return false}if(this.major>A.major){return true}if(this.minor<A.minor){return false}if(this.minor>A.minor){return true}if(this.rev<A.rev){return false}return true};deconcept.util={getRequestParameter:function(C){var D=document.location.search||document.location.hash;if(C==null){return D}if(D){var B=D.substring(1).split("&");for(var A=0;A<B.length;A++){if(B[A].substring(0,B[A].indexOf("="))==C){return B[A].substring((B[A].indexOf("=")+1))}}}return""}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var B=document.getElementsByTagName("OBJECT");for(var C=B.length-1;C>=0;C--){B[C].style.display="none";for(var A in B[C]){if(typeof B[C][A]=="function"){B[C][A]=function(){}}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs)};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true}}if(!document.getElementById&&document.all){document.getElementById=function(A){return document.all[A]}}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;
