Ext.namespace("THSite.other");THSite.other.SlidesPanel=Ext.extend(Ext.Panel,{constructor:function(a){if(!a){a={}}this.navRegions=a.navRegions||[];this.navFunctions=a.navFunctions||[];this.onClick=function(b){var c={x:b.evt.getXY()[0],y:b.evt.getXY()[1]};c.x=c.x-this.getEl().getXY()[0];c.y=c.y-this.getEl().getXY()[1];c.toString=function(){return"x: "+this.x+" y: "+this.y};this.fireEvent("clickImage",c,this);this.clickRegion(c)};this.onMouseMove=function(b,c){var f={x:b.evt.getXY()[0],y:b.evt.getXY()[1]};f.x=f.x-this.getEl().getXY()[0];f.y=f.y-this.getEl().getXY()[1];f.toString=function(){return"x: "+this.x+" y: "+this.y};for(var d=0;d<this.navRegions.length;d++){var e=this.navRegions[d];if(f.x>e.x&&f.y>e.y&&f.x<e.x+e.width&&f.y<e.y+e.height){c.el.dom.style.cursor="pointer";return}}c.el.dom.style.cursor=""};this.clickRegion=function(d){for(var b=0;b<this.navRegions.length;b++){var c=this.navRegions[b];if(d.x>c.x&&d.y>c.y&&d.x<c.x+c.width&&d.y<c.y+c.height){this.fireEvent("clickRegion",{num:b},this);if(this.navFunctions[b] instanceof Function){this.navFunctions[b].apply(this,arguments)}}}};THSite.other.SlidesPanel.superclass.constructor.call(this,{renderTo:a.renderTo,border:false,items:[this.image=new Ext.Component({autoEl:{tag:"img",src:a.src,border:false,style:"width: 100%;"},onRender:function(){Ext.Component.prototype.onRender.apply(this,arguments);this.el.on("click",this.onClick,this);this.el.on("mousemove",this.onMouseMove,this)},onClick:function(b,c){this.fireEvent("click",{evt:b,source:c},this)},onMouseMove:function(b,c){this.fireEvent("mousemove",{evt:b,source:c},this)},setSrc:function(b){this.el.dom.src=b},listeners:{click:this.onClick,mousemove:this.onMouseMove,scope:this}}),this.textComponent=new Ext.Component({border:false,autoEl:{html:a.text},setText:function(b){this.el.dom.innerHTML=b}})]})},setSrc:function(b){this.image.getEl().fadeOut({endOpacity:0,duration:1});var a=this;window.setTimeout(function(){a.image.setSrc(b)},1000);this.image.getEl().fadeIn({duration:1,endOpacity:1})},setText:function(a){this.textComponent.setText(a)},setNavFunctions:function(a){this.navFunctions=a},setNavRegions:function(a){this.navRegions=a}});