function tcImageLoader(){this.isLoading=0;this.currasset=this.loadingdisplayimg=this.loadingdisplay=this.onloadusercallback=this.theimage=this.theimagearea=this.imagebuffer=null}tcImageLoader.prototype.init=function(){this.theimagearea&&this.theimagearea.fade([1]);this.showimagearea();this.imagebuffer.empty();this.isLoading=false};tcImageLoader.prototype.loadImage=function(a){this.endCurrentImage();filename=a;this.currasset=new Asset.image(filename,{onload:this.onloadcallback.create({bind:this})})};
tcImageLoader.prototype.onloadcallback=function(a){this.onloadusercallback&&this.onloadusercallback(a);this.hideLoading();this.imagebuffer.empty();this.imagebuffer.setOpacity(0);a.inject(this.imagebuffer);(new Fx.Tween(this.imagebuffer,{duration:1500})).start("opacity",0,1);(new Fx.Tween(this.theimage,{duration:1500})).start("opacity",1,0)};tcImageLoader.prototype.hideimagearea=function(){this.theimagearea&&this.theimagearea.setStyle("display","none")};
tcImageLoader.prototype.showimagearea=function(){this.theimagearea&&this.theimagearea.setStyle("display","inline")};tcImageLoader.prototype.endCurrentImage=function(){this.theimage.setOpacity(0);var a=this.imagebuffer.clone();a.setProperty("id",this.theimage.id);a.replaces(this.theimage);this.theimage=a};
tcImageLoader.prototype.showLoading=function(){if(this.loadingdisplay){this.loadingdisplay.setStyle("display","inline");this.loadingdisplay.fade([0.7]);var a=this.getCurrentImageCoords(),b=a.width/2-16,c=a.height/2-16;this.loadingdisplay.setStyle("height",a.height);this.loadingdisplay.setStyle("background","url("+this.loadingdisplayimg+") no-repeat");this.loadingdisplay.setStyle("background-position",b+"px "+c+"px")}this.isLoading=true};
tcImageLoader.prototype.hideLoading=function(){if(this.loadingdisplay){this.loadingdisplay.setStyle("background","none");this.loadingdisplay.setStyle("display","none")}this.isLoading=false};tcImageLoader.prototype.getCurrentImageCoords=function(){return this.currasset?this.currasset.getCoordinates():this.loadingdisplay.getCoordinates()};tcImageLoader.prototype.setOnLoadCallback=function(a){this.onloadusercallback=a};tcImageLoader.prototype.setImage=function(a){this.theimage=$(a)};
tcImageLoader.prototype.setImageArea=function(a){this.theimagearea=$(a)};tcImageLoader.prototype.setImageBuffer=function(a){this.imagebuffer=$(a)};tcImageLoader.prototype.setLoadingDisplay=function(a,b){this.loadingdisplay=$(a);this.loadingdisplayimg=b};
