/* * slides, a slideshow plugin for jquery * intructions: http://slidesjs.com * by: nathan searles, http://nathansearles.com * version: 1.1.9 * updated: september 5th, 2011 * * licensed under the apache license, version 2.0 (the "license"); * you may not use this file except in compliance with the license. * you may obtain a copy of the license at * * http://www.apache.org/licenses/license-2.0 * * unless required by applicable law or agreed to in writing, software * distributed under the license is distributed on an "as is" basis, * without warranties or conditions of any kind, either express or implied. * see the license for the specific language governing permissions and * limitations under the license. */ (function(a){a.fn.slides=function(b){return b=a.extend({},a.fn.slides.option,b),this.each(function(){function w(g,h,i){if(!p&&o){p=!0,b.animationstart(n+1);switch(g){case"next":l=n,k=n+1,k=e===k?0:k,r=f*2,g=-f*2,n=k;break;case"prev":l=n,k=n-1,k=k===-1?e-1:k,r=0,g=0,n=k;break;case"pagination":k=parseint(i,10),l=a("."+b.paginationclass+" li."+b.currentclass+" a",c).attr("href").match("[^#/]+$"),k>l?(r=f*2,g=-f*2):(r=0,g=0),n=k}h==="fade"?b.crossfade?d.children(":eq("+k+")",c).css({zindex:10}).fadein(b.fadespeed,b.fadeeasing,function(){b.autoheight?d.animate({height:d.children(":eq("+k+")",c).outerheight()},b.autoheightspeed,function(){d.children(":eq("+l+")",c).css({display:"none",zindex:0}),d.children(":eq("+k+")",c).css({zindex:0}),b.animationcomplete(k+1),p=!1}):(d.children(":eq("+l+")",c).css({display:"none",zindex:0}),d.children(":eq("+k+")",c).css({zindex:0}),b.animationcomplete(k+1),p=!1)}):d.children(":eq("+l+")",c).fadeout(b.fadespeed,b.fadeeasing,function(){b.autoheight?d.animate({height:d.children(":eq("+k+")",c).outerheight()},b.autoheightspeed,function(){d.children(":eq("+k+")",c).fadein(b.fadespeed,b.fadeeasing)}):d.children(":eq("+k+")",c).fadein(b.fadespeed,b.fadeeasing,function(){a.browser.msie&&a(this).get(0).style.removeattribute("filter")}),b.animationcomplete(k+1),p=!1}):(d.children(":eq("+k+")").css({left:r,display:"block"}),b.autoheight?d.animate({left:g,height:d.children(":eq("+k+")").outerheight()},b.slidespeed,b.slideeasing,function(){d.css({left:-f}),d.children(":eq("+k+")").css({left:f,zindex:5}),d.children(":eq("+l+")").css({left:f,display:"none",zindex:0}),b.animationcomplete(k+1),p=!1}):d.animate({left:g},b.slidespeed,b.slideeasing,function(){d.css({left:-f}),d.children(":eq("+k+")").css({left:f,zindex:5}),d.children(":eq("+l+")").css({left:f,display:"none",zindex:0}),b.animationcomplete(k+1),p=!1})),b.pagination&&(a("."+b.paginationclass+" li."+b.currentclass,c).removeclass(b.currentclass),a("."+b.paginationclass+" li:eq("+k+")",c).addclass(b.currentclass))}}function x(){clearinterval(c.data("interval"))}function y(){b.pause?(cleartimeout(c.data("pause")),clearinterval(c.data("interval")),u=settimeout(function(){cleartimeout(c.data("pause")),v=setinterval(function(){w("next",i)},b.play),c.data("interval",v)},b.pause),c.data("pause",u)):x()}a("."+b.container,a(this)).children().wrapall('
');var c=a(this),d=a(".slides_control",c),e=d.children().size(),f=d.children().outerwidth(),g=d.children().outerheight(),h=b.start-1,i=b.effect.indexof(",")<0?b.effect:b.effect.replace(" ","").split(",")[0],j=b.effect.indexof(",")<0?i:b.effect.replace(" ","").split(",")[1],k=0,l=0,m=0,n=0,o,p,q,r,s,t,u,v;if(e<2)return a("."+b.container,a(this)).fadein(b.fadespeed,b.fadeeasing,function(){o=!0,b.slidesloaded()}),a("."+b.next+", ."+b.prev).fadeout(0),!1;if(e<2)return;h<0&&(h=0),h>e&&(h=e-1),b.start&&(n=h),b.randomize&&d.randomize(),a("."+b.container,c).css({overflow:"hidden",position:"relative"}),d.children().css({position:"absolute",top:0,left:d.children().outerwidth(),zindex:0,display:"none"}),d.css({position:"relative",width:f*3,height:g,left:-f}),a("."+b.container,c).css({display:"block"}),b.autoheight&&(d.children().css({height:"auto"}),d.animate({height:d.children(":eq("+h+")").outerheight()},b.autoheightspeed));if(b.preload&&d.find("img:eq("+h+")").length){a("."+b.container,c).css({background:"url("+b.preloadimage+") no-repeat 50% 50%"});var z=d.find("img:eq("+h+")").attr("src")+"?"+(new date).gettime();a("img",c).parent().attr("class")!="slides_control"?t=d.children(":eq(0)")[0].tagname.tolowercase():t=d.find("img:eq("+h+")"),d.find("img:eq("+h+")").attr("src",z).load(function(){d.find(t+":eq("+h+")").fadein(b.fadespeed,b.fadeeasing,function(){a(this).css({zindex:5}),a("."+b.container,c).css({background:""}),o=!0,b.slidesloaded()})})}else d.children(":eq("+h+")").fadein(b.fadespeed,b.fadeeasing,function(){o=!0,b.slidesloaded()});b.bigtarget&&(d.children().css({cursor:"pointer"}),d.children().click(function(){return w("next",i),!1})),b.hoverpause&&b.play&&(d.bind("mouseover",function(){x()}),d.bind("mouseleave",function(){y()})),b.generatenextprev&&(a("."+b.container,c).after('prev'),a("."+b.prev,c).after('next')),a("."+b.next,c).click(function(a){a.preventdefault(),b.play&&y(),w("next",i)}),a("."+b.prev,c).click(function(a){a.preventdefault(),b.play&&y(),w("prev",i)}),b.generatepagination?(b.prependpagination?c.prepend(""):c.append(""),d.children().each(function(){a("."+b.paginationclass,c).append('
  • '+(m+1)+"
  • "),m++})):a("."+b.paginationclass+" li a",c).each(function(){a(this).attr("href","#"+m),m++}),a("."+b.paginationclass+" li:eq("+h+")",c).addclass(b.currentclass),a("."+b.paginationclass+" li a",c).click(function(){return b.play&&y(),q=a(this).attr("href").match("[^#/]+$"),n!=q&&w("pagination",j,q),!1}),a("a.link",c).click(function(){return b.play&&y(),q=a(this).attr("href").match("[^#/]+$")-1,n!=q&&w("pagination",j,q),!1}),b.play&&(v=setinterval(function(){w("next",i)},b.play),c.data("interval",v))})},a.fn.slides.option={preload:!1,preloadimage:"/img/loading.gif",container:"slides_container",generatenextprev:!1,next:"next",prev:"prev",pagination:!0,generatepagination:!0,prependpagination:!1,paginationclass:"pagination",currentclass:"current",fadespeed:350,fadeeasing:"",slidespeed:350,slideeasing:"",start:1,effect:"slide",crossfade:!1,randomize:!1,play:0,pause:0,hoverpause:!1,autoheight:!1,autoheightspeed:350,bigtarget:!1,animationstart:function(){},animationcomplete:function(){},slidesloaded:function(){}},a.fn.randomize=function(b){function c(){return math.round(math.random())-.5}return a(this).each(function(){var d=a(this),e=d.children(),f=e.length;if(f>1){e.hide();var g=[];for(i=0;i