coinEarns=[];function setCoinEarns(a){coinEarns=a;if($chk(myCoinEarns)){myCoinEarns.earns=coinEarns}}var CoinEarnAddin=new Class({initialize:function(){this.earns=coinEarns;this.firstBound=true;this.enterFx=[];this.leaveFx=[]},cancelEFX:function(){$each(this.enterFx,function(b,a){b.cancel()})},bindme:function(){if($chk($("coinECoin"))){var a=new Element("div").setStyles({width:252,display:"none",opacity:0}),e,d=$("coinECoin"),f=new Element("div",{"class":"cHeader"}).set("text","Hier kannst Du Coins verdienen mit:");a.adopt(f);e=new Element("div",{id:"coinOptHolder"});a.adopt(e);d.adopt(a);var c=10*this.earns.length+15;d.oldHeight=e.getSize()["y"];d.setStyle("opacity",0.5);this.enterFx[0]=new Fx.Tween(d,{property:"opacity",duration:150,wait:false,onCancel:function(b){}});this.enterFx[1]=new Fx.Tween(e,{property:"min-height",duration:250,wait:false});this.enterFx[2]=new Fx.Tween($("maincontent"),{property:"margin-top",duration:250,wait:false});this.enterFx[3]=new Fx.Tween(d,{property:"width",duration:250,wait:false,onComplete:function(g){var b=new Chain();b.chain(function(){this.enterFx[4]=new Fx.Tween(a,{property:"opacity",duration:60,wait:false}).start(1);f.setStyle("display","block");b.callChain()}.bind(this));if(this.firstBound){$each(this.earns,function(j,i){var h=new Element("div",{"class":"cText"}).set("text",j[1]);h.adopt(new Element("text").set("html","&nbsp;"),new Element("span",{"class":"grayText"}).set("text","("+j[2]+")"));h.setStyles({opacity:0});e.adopt(h);b.chain(function(){new Fx.Tween(h,{property:"opacity",duration:150,onComplete:function(){b.callChain()}}).start(1)})});this.firstBound=false}else{$each(e.getChildren(),function(i,h){b.chain(function(){i.setStyle("display","block");new Fx.Tween(i,{property:"opacity",duration:150,onComplete:function(){b.callChain()}}).start(1)})})}b.callChain()}.bind(this),onCancel:function(){d.mout()}});d.addEvent("mouseenter",function(b){a.setStyle("display","block");this.enterFx[0].start(1).chain(function(){this.enterFx[1].start(d.oldHeight+c);this.enterFx[2].start(d.oldHeight+c+20);this.enterFx[3].start(260)}.bind(this))}.bind(this));d.mout=function(b){this.leaveFx[0]=new Fx.Tween(d,{property:"width",duration:150,wait:false,onCancel:function(){d.setStyle("width",36)}}).start(36);a.setStyles({width:252,display:"none",opacity:0});e.setStyle("min-height",d.oldHeight);f.setStyle("display","none");$("maincontent").setStyle("margin-top",0);d.setStyle("opacity",0.5);$each(e.getChildren(),function(h,g){h.setStyles({display:"none",opacity:0})}.bind(this))}.bind(this);d.addEvent("mouseleave",function(b){this.cancelEFX();d.mout(b)}.bind(this))}}});var myCoinEarns=new CoinEarnAddin();window.addEvent(load_method,function(){myCoinEarns.bindme()});
