////////////////////////////////////////////////
// Obfuscated by Javascript Obfuscator v.2.53 //
//        http://javascript-source.com        //
////////////////////////////////////////////////
var Panorama=new Class({options:{left:'0',top:'0',markers:'markers',fx:{},onStart:Class.empty,onComplete:Class.empty,onReady:Class.empty},initialize:function(images,el,options){this.setOptions(options);this.limit={};this.chains=[];this.zoomprops={};this.fx=[];this.orig=new Array();this.windowDims=$(el).getStyles('width','height');this.el=el;this.i=0;var temp='';this.buildings=[];this.zoomed=0;this.images=images;this.enableScroll(el);this.image=new Asset.image(images[0],{onload:function(){this.image.setStyles({left:(-this.options.left.toInt()),top:(-this.options.top.toInt())}).injectInside(el);this.image.setProperty('id',el+"_image");this.limit.x=this.windowDims.width.toInt()-this.image.width;this.limit.y=this.windowDims.height.toInt()-this.image.height;this.orig[0]={w:this.image.width,h:this.image.height};this.orig[1]={w:(this.image.width/2),h:(this.image.height/2)};this.orig[2]={w:this.windowDims.width.toInt(),h:((this.windowDims.width.toInt()/this.image.width)*this.image.height).toInt()};this.draggable();this.zoomProperties();this.moveFx=new Fx.Styles(this.image,this.options.fx).addEvent('onComplete',function(){this.callChain();this.fireEvent('onComplete',10);}.bind(this)).addEvent('onStart',function(){this.fireEvent('onStart',10);}.bind(this));this.fireEvent('onReady',10);}.bind(this)});},loadBuildings:function(){if(!this.orig[0]||this.buildings.length==0)return;var x,y,s,left,top;left=this.image.getStyle('left').toInt();top=this.image.getStyle('top').toInt();if(left=="auto"||(left==""&&left!=0)){left=(this.orig[0].w/2).toInt();}this.buildings.each(function(building,i){x=((building.xpercent/100)*this.image.width).toInt();y=((building.ypercent/100)*this.image.height).toInt();y-=8;$('building-tip_'+building.id).setStyles({'top':y+'px','left':x+'px'});},this);this.moveBuildings(left,top);},showBuildings:function(){$$('.building-tip').setStyles({'visibility':'visible'});this.hideTips();},hideBuildings:function(){$$('.building-tip').setStyles({'visibility':'hidden'});this.hideTips();},hideTips:function(){$$('.tool-tip').setStyles({'visibility':'hidden'});$$('.htmlContent').setStyles({'visibility':'hidden'});},moveBuildings:function(x,y){$(this.options.markers).setStyles({'left':x,'top':y});},setImage:function(i){this.image.src=this.images[i];this.i=i;},move:function(dX,dY){if(this.moveFx.timer){this.addToChain(this.move,[dX,dY]);}var current=[this.image.getStyle('left').toInt(),this.image.getStyle('top').toInt()];var newX=dX?(current[0]-dX).limit(this.limit.x,0):current[0];var newY=dY?(current[1]-dY).limit(this.limit.y,0):current[1];this.moveFx.start({left:newX,top:newY});this.moveBuildings(newX,newY);return this;},jump:function(x,y,id){if(this.moveFx.timer){this.addToChain(this.jump,[x,y,id]);}this.hideTips();x=x.limit(this.limit.x,0);y=y.limit(this.limit.y,0);this.moveFx.start({left:x,top:y}).addEvent('onComplete',function(event){if(id>0){this.buildings.each(function(building,i){if(building.id==id){var pos=$(this.el).getPosition();var el=$('building-tip_'+id);var xx=pos.x+(this.windowDims.width.toInt()/2).toInt();var yy=pos.y+(this.windowDims.height.toInt()/2).toInt()-30;el.fireEvent('view',[xx,yy]);}},this);}}.bind(this));this.moveBuildings(x,y);return this;},updateDimensions:function(width,height){if(width=="")width=this.windowDims.width.toInt();else this.windowDims.width=width+'px';if(height=="")height=this.windowDims.height.toInt();else this.windowDims.height=height+'px';this.limit.x=width-this.image.width;this.limit.y=height-this.image.height;return this;},draggable:function(){if(!this.image)return;this.imagegable=this.image.makeDraggable({limit:{x:[this.limit.x,0],y:[this.limit.y,0]},onStart:function(){this.moveFx.stop();this.clearChain();this.hideTips();this.fireEvent('onStart',10);}.bind(this),onDrag:function(){}.bind(this),onComplete:function(){this.fireEvent('onComplete',10);}.bind(this)});if(this.image.getProperty('id')==null)this.image.setProperty('id',this.el+"_image");var drag=new Drag.Multi({handle:$(this.image.getProperty('id'))});drag.add('markers',{'x':{limit:[this.limit.x,0],style:'left'},'y':{limit:[this.limit.y,0],style:'top'}});return this;},zoomProperties:function(){this.zoomprops.minw=this.windowDims.width.toInt();this.zoomprops.scale=(this.zoomprops.minw/this.orig[this.i].w);this.zoomprops.minh=this.zoomprops.scale*this.orig[this.i].h;this.zoomprops.dx=(this.orig[this.i].w-this.zoomprops.minw)/10;this.zoomprops.dy=(this.orig[this.i].h-this.zoomprops.minh)/10;},resizeImage:function(percent){w=this.orig[this.i].w-(this.zoomprops.dx*(percent/10));h=this.orig[this.i].h-(this.zoomprops.dy*(percent/10));return[w.toInt(),h.toInt()];},zoom:function(z,zoomFrom){var sx,sy,x,y,sh,sw,path,zoomdims,ew,eh,imageNum=0;if(this.zoomed==z)return;this.zoomed=z;sx=this.image.getStyle('left');if(sx=="auto"||sx=="")return;sx=sx.toInt();if(isNaN(sx))return;sy=this.image.getStyle('top').toInt();sh=this.image.height;sw=this.image.width;imageNum=((z>=50&&z<=90)?1:(z==100?2:0));z=(z==50||z==100)?0:z;path=this.images[imageNum];if(path!=this.image.src){this.setImage(imageNum);}this.zoomProperties();zoomdims=this.resizeImage(z);ew=zoomdims[0];eh=zoomdims[1];this.image.setStyles({'width':ew+"px",'height':eh+"px"});$(this.options.markers).setStyles({'width':ew+"px",'height':eh+"px"});this.updateDimensions("","");this.draggable();temp1=((sx/sw)*ew).toInt();temp2=((sy/sh)*eh).toInt();x=(temp1).limit(this.limit.x,0);y=(temp2).limit(this.limit.y,0);this.image.setStyles({'top':y+"px",'left':x+"px"});this.loadBuildings();},message:function(varnames){var s="";for(i=0;i<varnames.length;i++)s+=varnames[i][0]+": "+varnames[i][1]+", ";$('temp').setHTML(s);},addToChain:function(fn,args){this.chains.push(fn.pass(args,this));},enableScroll:function(el){this.addToChain(this.enableScroll,el);var zoomto;$(el).addEvents({'wheelup':function(e){e=new Event(e).stop();if(this.moveFx.timer)this.moveFx.stop();zoomto=(this.zoomed-10)>0?(this.zoomed-10):0;this.addToChain(this.zoom,[zoomto,this.zoomed]);this.zoom(zoomto,this.zoomed);}.bind(this),'wheeldown':function(e){e=new Event(e).stop();zoomto=(this.zoomed+10)<100?(this.zoomed+10):100;this.addToChain(this.zoom,[zoomto,this.zoomed]);this.zoom(zoomto,this.zoomed);}.bind(this)});}});Panorama.implement(new Options,new Chain,new Events);Element.Events.extend({'wheelup':{type:Element.Events.mousewheel.type,map:function(event){event=new Event(event);if(event.wheel>=0)this.fireEvent('wheelup',event)}},'wheeldown':{type:Element.Events.mousewheel.type,map:function(event){event=new Event(event);if(event.wheel<=0)this.fireEvent('wheeldown',event)}}});
