var ZLei_Gallery={widgetEventPrefix:"gallery",options:null,_latestTime:0,_create:function(){this.element.html("
");this.element.addClass("ZLei-Gallery");this._on(this._elementEvents)},_init:function(){if(this.options.length==0){return}var c=$(">ul",this.element);var b="";for(var a in this.options){b+='
'}c.html(b);c.children("li:first").click();setInterval(this._timer,1000,this)},_timer:function(b){var a=b.getTimestamp();if(a-b._latestTime>5){b.next()}},next:function(){var a=this.element.find("li");var c=a.length;var b=a.index(this.element.find("li.focus"))+1;if(b>=c){b=0}a[b].click();this.retiming()},retiming:function(){this._latestTime=this.getTimestamp()},getTimestamp:function(){return(new Date()).getTime()/1000},_elementEvents:{gallerydisplay:function(b,d,c,a){this.element.children("img").remove();this.element.prepend('
')},"click >ul>li:not(.focus)":function(b){$(b.currentTarget).siblings("li.focus").removeClass("focus");$(b.currentTarget).addClass("focus");var d=$(b.currentTarget).attr("src");var c=$(b.currentTarget).attr("title");var a=$(b.currentTarget).attr("description");this._trigger("display",null,[d,c,a]);this.retiming();return false}}};$.widget("ZLei.Gallery",ZLei_Gallery);