function ImageTween(){var m=$("tween");var r=m.getSize();var f=new Fx.Tween(m,{fps:30,transition:Fx.Transitions.linear});var z=m.getParent().getParent();var k=m.getParent().getSize();var y=m.getChildren("li").getFirst("a").getFirst("img");var h=null;var d=5;var u=22;var j=200;var c=true;var w=false;var v=false;var o=false;this.run=function(){g()};this.halt=function(){q();v=false};var A=function(){return m.getStyle("left").toInt()};var p=function(){if(c){return k.x-r.x+d}else{return 0}};var B=function(){if(c){return -((p()-A())*u)}else{return -(A()*u)}};var g=function(){v=true;o=false;w=true;f.cancel();f.options.transition=Fx.Transitions.linear;f.options.duration=B();f.start("left",A(),p())};var q=function(){if(v==false){return}w=false;f.cancel()};var i=function(){if(v==false){return}w=false;f.pause()};var e=function(){if(v==false){return}w=true;f.resume()};var t=function(){v=true;w=true;o=true;f.cancel();f.options.transition=Fx.Transitions.linear;f.options.duration=B()/8;f.start("left",A(),p())};var b=function(){if(o==true){g()}else{t()}};var s=function(C){if(h==C){return}n();h=C;h.addClass("hover");$("description").getChildren().dispose();var D=h.getParent().getParent().getFirst("div");if(D){$("description").grab(D.clone())}};var n=function(){if(h){h.removeClass("hover");$("description").getChildren().dispose();h=null}};var x=function(){if(w==false){return}for(var D=0;D<y.length;D++){var C=y[D].getPosition(z);if(C.x>0){s(y[D]);return}}};var l=function(){$("content-default").addClass("hidden")};var a=function(){$("content-default").removeClass("hidden")};$("button-next").addEvent("mouseover",function(){c=true;g()}).addEvent("mouseout",function(){c=true;g()}).addEvent("mousedown",function(){c=true;b();return false}).addEvent("click",function(){this.blur();return false});$("button-prev").addEvent("mouseover",function(){c=false;g()}).addEvent("mouseout",function(){c=false;g()}).addEvent("mousedown",function(){c=false;b();return false}).addEvent("click",function(){this.blur();return false});m.addEvent("mouseover",function(){i();l()}).addEvent("mouseout",function(){e();a()});Array.each(m.getChildren("li"),function(D,C){D.getFirst("a").addEvent("click",function(){this.blur();q();v=false}).getFirst("img").addEvent("mouseover",function(){s(this)}).addEvent("mouseout",function(){n()})})}window.addEvent("domready",function(){myTween=new ImageTween()});
