/* sbThumbView v1.0 Copyright Sitebuilders Finland Oy */
var linkHover=new Class({Implements:Options,options:{autoPlay:"false",timeVisible:"3000",resumeDelay:"6000",fadeInSpeed:200},initialize:function(b,a){this.setOptions(a);this.Items=b;this.Length=b.length;this.counter=0;if(this.Items){this.Start()}},Start:function(){this.Shownext(this.Items);if(this.options.autoPlay=="true"){this.Autoplay()}this.Items.each(function(a){a.addEvent("mouseenter",function(b){if(a.getElement("span").hasClass("current")!=true){this.Reset();if(this.options.autoPlay=="true"){this.stopTimer()}this.Showme(a)}}.bind(this));a.addEvent("mouseleave",function(b){}.bind(this));a.addEvent("click",function(b){b=new Event(b).stop()}.bind(this))}.bind(this))},Showme:function(a){this.image=a.getElement("span");if(this.image!=null){this.image.setStyles("z-index:100;");this.image.addClass("current");this.image.set("opacity","0");this.image.set("tween",{duration:this.options.fadeInSpeed});this.image.tween("opacity","1")}},Hideme:function(){if(this.bigImage!=null){this.bigImage.tween("opacity","0")}},Reset:function(){this.Items.each(function(a){this.bigImage=a.getElement("span");if(this.bigImage.hasClass("current")==true){this.Hideme();this.bigImage.removeClass("current")}}.bind(this))},stopTimer:function(){$clear(this.timer);$clear(this.autoDelay);if(this.options.resumeDelay!="never"){this.autoDelay=this.Autoplay.delay(this.options.resumeDelay,this)}},Shownext:function(){if(this.counter<this.Length){this.Reset();this.Showme(this.Items[this.counter]);this.counter++;if(this.counter==this.Length){this.counter=0}}},Autoplay:function(){$clear(this.autoDelay);this.timer=this.Shownext.periodical(this.options.timeVisible,this)}});window.addEvent("domready",function(){var a=new linkHover($$("#gallerycontainer a"),{timeVisible:"3000"})});
