(function(c){c.fn.slidy=function(w){var J=c.extend({},c.fn.slidy.defaults,w);if(this.length==0){d("Invalid selector!");return}else{if(this.length>1){return this.each(function(){c.fn.slidy.apply(c(this),[w])})}}$global=c(this);$global.css({cursor:J.cursor,height:J.height+"px",overflow:"hidden",position:"relative",width:J.width+"px"});var A=$global.children(J.children),G=$global,D=0,I=false;A.each(function(e){c(this).css({position:"absolute","z-index":A.length-e}).attr("id",$global.attr("id")+"-"+(e+1)).hide()});$global.find("img").attr({height:J.height,width:J.width});if(J.children=="a"&&J.target!=""){A.attr("target",J.target)}A.first().show().end().find("img").css("border","0");x(A,J,0);var y=function(){var e=c(this),g,f;clearTimeout(D);if(e.is("li")){g=e.index();f=e.parent().children(".slidy-link-selected").index()}else{g=G.next("ul").children(".slidy-link-selected").index();f=g}if(g!=f){e.addClass("slidy-link-selected").parent().children().eq(f).removeClass("slidy-link-selected");E(A,J,g,f)}},H=function(){var f=G.next("ul").children(".slidy-link-selected").index(),e;if(!c(this).is("li")){e=true}x(A,J,f,e)};if(J.menu){var z=A.find("img"),L="",b=(J.target!="")?'target="'+J.target+'"':"",F,a;z.each(function(){a=c(this);F=a.parent(J.children);L+='<li><a href="'+F.attr(F.is("a")?"href":"title")+'" '+b+">"+a.attr("title")+"</a></li>"});$global.after('<ul class="slidy-menu">'+L+"</ul>");var v=parseInt((J.width/z.length)+(z.length-1)),B=J.width-(v*z.length),K=c("ul.slidy-menu").children("li");K.css("width",v).hover(y,H).mousemove(y).first().addClass("slidy-link-selected").end().last().css({"border-right":"0",width:(v+B)-(z.length-1)})}if(J.pause){$global.hover(y,H)}function x(e,f,g,h){E(e,f,g,g-1);if(h==undefined){C(g)}g=(g<e.length-1)?g+1:0;D=setTimeout(function(){x(e,f,g)},f.time)}function E(h,f,g,e){if(!I){I=true;if(f.animation=="fade"){h.eq(e).fadeOut(f.speed);h.eq(g).fadeIn(f.speed,function(){C(g);I=false})}else{if(f.animation=="slide"){h.css("z-index",0).eq(g).css("z-index",h.length).slideDown(f.speed,function(){h.eq(e).hide();C(g);I=false})}else{h.eq(e).hide();h.eq(g).show();I=false}}}}function C(e){G.next("ul").children().removeClass("slidy-link-selected").eq(e).addClass("slidy-link-selected")}return $global};function d(a){if(window.console&&window.console.log){window.console.log(a)}}c.fn.slidy.defaults={children:"img",cursor:"default",height:200,menu:false,pause:false,speed:600,target:"",time:3600,animation:"normal",width:500}})(jQuery);