<script language="JavaScript">(function(c){jQuery.extend(jQuery.easing,{easeOutCirc:function(a,m,o,b,p){return b*Math.sqrt(1-(m=m/p-1)*m)+o}});c.fn.mhslideshow=function(a){a=c.extend({width:600,height:200,firstSlide:0,interval:3E3,effectMode:"blind",effect:"random",totalSlices:12,effectSpeed:500,sliceInterval:50,showShadow:true,showCaption:true,textCSS:".title {font-size:12px;font-weight:bold;font-family:Arial;color:#ffffff;line-height:200%;} .alt {font-size:12px;font-family:Arial;color:#ffffff;}",captionPosition:"top",captionBarColor:"#333333",
captionBarOpacity:0.8,captionBarPadding:8,captionAlign:"center",captionColor:"#ffffff",showNavArrows:"true",autoHideNavArrows:"true",showNavDots:"true",navDotsBottom:6,navDotsAlign:"right",navDotsLeftRightMargin:16,randomPlay:false,autoPlay:true,showBorder:false,borderColor:"#ffffff",borderSize:6,watermark:false},a);var m=Array("fade","blindLeft","blindRight","blindDownLeft","blindDownRight","blindUpLeft","blindUpRight","blindUpDownLeft","blindUpDownRight");this.each(function(){function o(e){var i=
b.currentSlide;switch(e){case -1:b.currentSlide=a.randomPlay?Math.floor(Math.random()*b.totalSlides):b.currentSlide>=b.totalSlides-1?0:++b.currentSlide;break;case -2:b.currentSlide=b.currentSlide<=0?b.totalSlides-1:--b.currentSlide;break;case -3:b.currentSlide=b.currentSlide>=b.totalSlides-1?0:++b.currentSlide;break;default:b.currentSlide=e>=0&&e<b.totalSlides?e:0}if(h[b.currentSlide].link!=undefined&&h[b.currentSlide].link.length>0){k.css("cursor","pointer");k.unbind("click").click(function(j){if(h[b.currentSlide].target!=
undefined&&h[b.currentSlide].target.length>0)window.open(h[b.currentSlide].link,h[b.currentSlide].target);else window.location=h[b.currentSlide].link;j.preventDefault()})}else{k.css("cursor","default");k.unbind("click")}if(a.showCaption)if(h[b.currentSlide].caption!=""){c(".caption",d).fadeOut(a.effectSpeed,function(){c(this).html(h[b.currentSlide].caption);c(this).fadeIn(a.effectSpeed)});c(".captionBar",d).fadeIn(a.effectSpeed)}else c(".captionBar",d).fadeOut(a.effectSpeed);if(a.showNavDots){c(".navDot:eq("+
i+")",d).removeClass("navDotActive");c(".navDot:eq("+b.currentSlide+")",d).addClass("navDotActive")}if(a.effectMode=="slide"){var f;f=b.currentSlide>=i?"slideRight":"slideLeft";b.switching=true;e=c(".slide",d);f=="slideRight"?e.css({left:a.width+"px",background:'url("'+h[b.currentSlide].src+'") no-repeat'}):e.css({left:"-"+a.width+"px",background:'url("'+h[b.currentSlide].src+'") no-repeat'});e.animate({left:"0px"},a.effectSpeed,"easeOutCirc",function(){d.trigger("switchFinished")})}else if(a.effectMode==
"blind"){var l=0;c(".slice",d).each(function(){var j=Math.round(a.width/a.totalSlices);c(this).css({height:"0px",opacity:"0",background:'url("'+h[b.currentSlide].src+'") no-repeat -'+l*j+"px 0%"});l++});e=jQuery.trim(a.effect);if(e=="random")f=m[Math.floor(Math.random()*m.length)];else if(e.indexOf(",")!=-1){e=e.split(",");f=jQuery.trim(e[Math.floor(Math.random()*e.length)])}else f=e;if(jQuery.inArray(f,m)==-1)f=m[0];b.switching=true;if(f=="fade"){l=0;c(".slice",d).each(function(){c(this).css("height",
"100%");l==a.totalSlices-1?c(this).animate({opacity:"1.0"},a.effectSpeed,"",function(){d.trigger("switchFinished")}):c(this).animate({opacity:"1.0"},a.effectSpeed);l++})}else if(f=="blindLeft"||f=="blindRight"||f=="blindDownLeft"||f=="blindDownRight"||f=="blindUpLeft"||f=="blindUpRight"||f=="blindUpDownLeft"||f=="blindUpDownRight"){l=0;var q=a.sliceInterval;e=c(".slice",d);if(f=="blindRight"||f=="blindDownRight"||f=="blindUpRight"||f=="blindUpDownRight")e=jQuery(jQuery.makeArray(e).reverse());e.each(function(){var j=
c(this),s=j.width();if(f=="blindLeft"||f=="blindRight"){j.css({top:"0px",width:"0px",height:"100%"});l==a.totalSlices-1?setTimeout(function(){j.animate({width:s,opacity:"1.0"},a.effectSpeed,"",function(){d.trigger("switchFinished")})},q):setTimeout(function(){j.animate({width:s,opacity:"1.0"},a.effectSpeed)},q)}else{if(f=="blindDownLeft"||f=="blindDownRight")j.css("top","0px");else if(f=="blindUpLeft"||f=="blindUpRight")j.css("bottom","0px");else if(f=="blindUpDownLeft"||f=="blindUpDownRight")l%2==
0?j.css("top","0px"):j.css("bottom","0px");l==a.totalSlices-1?setTimeout(function(){j.animate({height:"100%",opacity:"1.0"},a.effectSpeed,"",function(){d.trigger("switchFinished")})},q):setTimeout(function(){j.animate({height:"100%",opacity:"1.0"},a.effectSpeed)},q)}q+=a.sliceInterval;l++})}}}var b={currentSlide:0,totalSlides:0,paused:false,switching:false},p,d=c(this);d.addClass("mhSlideshow");d.css({height:a.height,width:a.width});var g=c("img",d),h=[];g.each(function(){var e=c(this),i={};i.src=
e.attr("src");i.title=e.attr("title");i.alt=e.attr("alt");i.caption="";if(i.title!="")i.caption+='<span class="title">'+i.title+"</span>";if(i.title!=""&&i.alt!="")i.caption+="<br />";if(i.alt!="")i.caption+='<span class="alt">'+i.alt+"</span>";e=e.parent();if(e.is("a")){i.link=e.attr("href");i.target=e.attr("target")}h.push(i)});b.totalSlides=g.length;b.currentSlide=a.randomPlay?Math.floor(Math.random()*b.totalSlides):a.firstSlide>0&&a.firstSlide<b.totalSlides?a.firstSlide:0;d.append(c('<div class="slideContainer"></div>'));
var k=c(".slideContainer",d);k.css({height:a.height,width:a.width});if(a.showShadow||a.showBorder){d.append(c('<div class="shadow"></div>'));a.showShadow&&c(".shadow",d).append(c('<div class="shadowTL"></div><div class="shadowT"></div><div class="shadowTR"></div><div class="shadowR"></div><div class="shadowBR"></div><div class="shadowB"></div><div class="shadowBL"></div><div class="shadowL"></div>'));a.showBorder?c(".shadow",d).css({position:"absolute",display:"block",background:a.borderColor,height:a.height+
2*a.borderSize,width:a.width+2*a.borderSize,left:-a.borderSize,top:-a.borderSize}):c(".shadow",d).css({height:a.height,width:a.width})}k.css("background",'url("'+h[b.currentSlide].src+'") no-repeat');if(h[b.currentSlide].link!=undefined&&h[b.currentSlide].link.length>0){k.css("cursor","pointer");k.unbind("click").click(function(e){if(h[b.currentSlide].target!=undefined&&h[b.currentSlide].target.length>0)window.open(h[b.currentSlide].link,h[b.currentSlide].target);else window.location=h[b.currentSlide].link;
e.preventDefault()})}if(a.showCaption){g=d.append(c('<div class="captionBar"><div class="caption"></div></div>'));g=c(".captionBar",d);a.captionPosition=="bottom"?g.css({bottom:"0px"}):g.css({top:"0px"});var n=c(".caption",d);g.css({display:"none",background:a.captionBarColor,opacity:a.captionBarOpacity,"text-align":a.captionAlign});n.css({padding:a.captionBarPadding+"px",color:a.captionColor});a.captionAlign=="center"&&n.css("margin","0 auto");if(h[b.currentSlide].caption!=""){d.prepend(c('<style type="text/css">'+
a.textCSS+"</style>"));g.fadeIn(a.effectSpeed);n.html(h[b.currentSlide].caption)}}if(a.showNavArrows){d.append(c('<div class="navArrows"><a class="leftArrow"></a><a class="rightArrow"></a></div>'));if(a.autoHideNavArrows){var r=c(".navArrows",d);r.hide();d.hover(function(){r.show()},function(){r.hide()})}c("a.leftArrow",d).click(function(){if(b.switching)return false;clearTimeout(p);o(-2)});c("a.rightArrow",d).click(function(){if(b.switching)return false;clearTimeout(p);o(-3)})}if(a.showNavDots){d.append(c('<div class="navBar"><div class="navControls"></div></div>'));
g=c(".navBar",d);g.css({"text-align":a.navDotsAlign,bottom:a.navDotsBottom+"px"});if(a.navDotsAlign=="left")g.css("left",a.navDotsLeftRightMargin+"px");else a.navDotsAlign=="right"&&g.css("left","-"+a.navDotsLeftRightMargin+"px");for(g=0;g<b.totalSlides;g++)c(".navControls",d).append('<div class="navDot" rel="'+g+'"></div>');g=c(".navDot",d);g.click(function(){if(b.switching)return false;clearTimeout(p);o(c(this).attr("rel"))});g.hover(function(){c(this).addClass("navDotActive")},function(){b.currentSlide!=
c(this).attr("rel")&&c(this).removeClass("navDotActive")});c(g[b.currentSlide]).addClass("navDotActive")}if(a.effectMode=="slide")k.append(c('<div class="slide"></div>').css({left:"0px",width:a.width+"px"}));else if(a.effectMode=="blind")for(g=0;g<a.totalSlices;g++){n=Math.round(a.width/a.totalSlices);g==a.totalSlices-1?k.append(c('<div class="slice"></div>').css({left:n*g+"px",width:a.width-n*g+"px"})):k.append(c('<div class="slice"></div>').css({left:n*g+"px",width:n+"px"}))}if(a.watermark){d.append(c('<div class="watermark"><a href="http://www.magichtml.com/javascriptslideshow/watermark.html">http://www.magichtml.com</a></div>'));
c("div.watermark",d).css({"font-size":"12px","font-family":"Arial","background-color":"#FFFFFF","z-index":99999,position:"absolute",left:"4px",top:"4px",padding:"2px 4px 4px"})}c("img",d).css({margin:"0px",padding:"0px"});if(b.totalSlides>0&&a.autoPlay)p=setTimeout(function(){o(-1)},a.interval);d.bind("switchFinished",function(){b.switching=false;k.css("background",'url("'+h[b.currentSlide].src+'") no-repeat');if(b.totalSlides>0&&a.autoPlay)p=setTimeout(function(){o(-1)},a.interval)})})}})(jQuery);
</script>