// http://wowslider.com/
// JavaScript Wow Slider is a free software that helps you easily generate delicious 
// slideshows with gorgeous transition effects, in a few clicks without writing a single line of code.
// Last updated: 2011-06-16
function ws_stack(a,b){var c=jQuery;var d=0;b.each(function(a){c(this).css({"z-index":0});if(!a){c(this).show()}else{c(this).hide()}});this.init=function(){};this.go=function(e){b.each(function(b){if(b==d){c(this).css({"z-index":1})}else if(b==e){c(this).stop(1,1).css({"z-index":2,left:"auto",right:-a.width+"px"}).show().animate({right:0},a.duration,"easeInOutExpo")}else{c(this).css({"z-index":0})}});d=e;return true}}jQuery.fn.wowSlider=function(a){function D(a,b){var c=jQuery;a.stop(true,true);var d={};var e=["position","top","bottom","left","right"];for(var f=0;f<e.length;f++){d[e[f]]=a[0].style[e[f]]}a.show();var g={width:a.outerWidth(true),height:a.outerHeight(true),"float":a.css("float"),overflow:"hidden",opacity:0},h=c("<div></div>").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0});a.wrap(h);h=a.parent();if(a.css("position")=="static"){h.css({position:"relative"});a.css({position:"relative"})}else{c.extend(g,{position:a.css("position"),zIndex:a.css("z-index")});c.each(["top","left","bottom","right"],function(b,c){g[c]=a.css(c);if(isNaN(parseInt(g[c],10))){g[c]="auto"}});a.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})}h.css(g).show();var i=b.direction||"left";var j=i=="up"||i=="down"?"top":"left";var k=i=="up"||i=="left"?"pos":"neg";var l=b.distance||(j=="top"?a.outerHeight({margin:true}):a.outerWidth({margin:true}));a.css(j,k=="pos"?isNaN(l)?"-"+l:-l:l);var m={};m[j]=(k=="pos"?"+=":"-=")+l;h.animate({opacity:1},{duration:b.duration,easing:b.easing});a.animate(m,{queue:false,duration:b.duration,easing:b.easing,complete:function(){for(var c in d){a[0].style[c]=d[c]}a.parent().replaceWith(a);if(b.complete){b.complete()}}})}function C(a){var c=d("img",a).attr("title");var e=d(a).data("descr");var f=d(".ws-title",b);f.hide();if(c||e){f.html((c?"<span>"+c+"</span>":"")+(e?"<div>"+e+"</div>":""));D(f,{direction:"left",easing:"easeInOutExpo",complete:function(){if(d.browser.msie){f.get(0).style.removeAttribute("filter")}},duration:1e3})}}function B(a){d(".ws_bullets A",b).each(function(b){if(b==a){d(this).addClass("ws_selbull")}else{d(this).removeClass("ws_selbull")}})}function A(){var a=b.find(".ws_bullets>div");var c=d("a",a);c.click(function(a){s(a,d(a.target).index())});var e=c.find("IMG");if(e.length){var f=d('<div class="ws_bulframe"/>').appendTo(a);var g=d("<div/>").css({width:e.length+1+"00%"}).appendTo(d("<div/>").appendTo(f));e.appendTo(g);d("<span/>").appendTo(f);var h=-1;function i(a){if(a<0){a=0}d(c.get(h)).removeClass("ws_overbull");d(c.get(a)).addClass("ws_overbull");f.show();var b={left:c.get(a).offsetLeft-f.width()/2};var i={left:-e.get(a).offsetLeft};if(h<0){f.css(b);g.css(i)}else{if(!document.all){b.opacity=1}f.stop().animate(b,"fast");g.stop().animate(i,"fast")}h=a}c.hover(function(){i(d(this).index())});var j;a.hover(function(){if(j){clearTimeout(j);j=0}i(h)},function(){c.removeClass("ws_overbull");if(document.all){if(!j){j=setTimeout(function(){f.hide();j=0},400)}}else{f.stop().animate({opacity:0},{duration:"fast",complete:function(){f.hide()}})}});a.click(function(a){s(a,d(a.target).index())})}}function s(a,b){r();a.preventDefault();j(b);q()}function r(){if(p){clearTimeout(p)}p=null}function q(){r();if(a.autoPlay){p=setTimeout(function(){j(i<g-1?i+1:0);if(!i&&!--a.loop){a.autoPlay=0}q()},a.delay+a.duration)}}function o(b){if(a.bullets){B(b)}if(h){h.setAttribute("href",e.get(b).href);h.setAttribute("target",e.get(b).target)}}function j(b){b=(b%g+g)%g;if(i==b){return}var c=t.go(b,i);if(!c){return}if(typeof c!="object"){c=e[b]}i=b;o(b);if(a.caption){C(c)}a.onStep(i)}var b=this;var d=jQuery;a=d.extend({effect:function(a){var b;this.init=function(a){b=a.find("img");b.each(function(a){if(!a){d(this).show()}else{d(this).hide()}})};this.go=function(c,e){d(b.get(c)).fadeIn(a.duration);d(b.get(e)).fadeOut(a.duration);return true}},prev:"",next:"",duration:1e3,delay:2e3,outWidth:960,outHeight:360,width:960,height:360,caption:true,controls:true,autoPlay:true,bullets:true,onStep:function(){},stopOnHover:0},a);a.loop=a.loop||Number.MAX_VALUE;var e=b.find(".ws_images A");var f=e.find("IMG");e.each(function(a){var b=d(this).html()||"";var c=b.indexOf(">",b);if(c>=0){d(this).data("descr",b.substr(c+1));if(c<b.length-1){d(this).html(b.substr(0,c+1))}}d(this).css({"font-size":0})});var g=e.length;var h=d("A.ws_frame",b).get(0);var i=0;var k,l,m=0;var n=b.get(0);if(n.addEventListener){n.addEventListener("touchmove",function(a){if(m){var b=k-a.touches[0].pageX;var c=l-a.touches[0].pageY;if(Math.abs(b)>20||Math.abs(c)>20){k=l=m=0;s(a,i+(b+c>0?-1:1))}}},false);n.addEventListener("touchstart",function(a){if(a.touches.length==1){k=a.touches[0].pageX;l=a.touches[0].pageY;m=1}else{m=0}},false);n.addEventListener("touchend",function(a){m=0},false)}var p;e.find("IMG").css("position","absolute");if(typeof a.effect=="string"){a.effect=window["ws_"+a.effect]}var t=new a.effect(a,f);t.init(d(".ws_images",b));e.find("IMG").css("visibility","visible");var u=c=d(".ws_images",b);var v="";c=v?d("<div></div>"):0;if(c){c.css({position:"absolute",right:"2px",bottom:"2px",padding:"0 0 0 0"});u.append(c)}if(c&&document.all){var w=d('<iframe src="javascript:false"></iframe>');w.css({position:"absolute",left:0,top:0,width:"100%",height:"100%",filter:"alpha(opacity=0)"});w.attr({scrolling:"no",framespacing:0,border:0,frameBorder:"no"});c.append(w)}var x=c?d(document.createElement("A")):c;if(x){x.css({position:"relative",display:"block","background-color":"#E4EFEB",color:"#837F80","font-family":"Lucida Grande,sans-serif","font-size":"11px","font-weight":"normal","font-style":"normal","-moz-border-radius":"5px","border-radius":"5px",padding:"1px 5px",width:"auto",height:"auto",margin:"0 0 0 0",outline:"none"});x.attr({href:"ht"+"tp://"+v.toLowerCase()});x.html(v);x.bind("contextmenu",function(a){return false});c.append(x)}if(a.controls){var y=d('<a href="#" class="ws_next">'+a.next+"</a>");var z=d('<a href="#" class="ws_prev">'+a.prev+"</a>");b.append(y);b.append(z);y.bind("click",function(a){s(a,i+1)});z.bind("click",function(a){s(a,i-1)})}if(a.caption){$caption=d("<div class='ws-title' style='display:none'></div>");b.append($caption);$caption.bind("mouseover",function(a){r()});$caption.bind("mouseout",function(a){q()})}if(a.bullets){A()}o(0);if(a.caption){C(e[0])}if(a.stopOnHover){this.bind("mouseover",function(a){r()});this.bind("mouseout",function(a){q()})}q();return this};jQuery.extend(jQuery.easing,{easeInOutExpo:function(a,b,c,d,e){if(b==0){return c}if(b==e){return c+d}if((b/=e/2)<1){return d/2*Math.pow(2,10*(b-1))+c}return d/2*(-Math.pow(2,-10*--b)+2)+c}});jQuery("#wowslider-container").wowSlider({effect:"stack",prev:"",next:"",duration:10*100,delay:50*100,outWidth:686,outHeight:298,width:686,height:298,autoPlay:true,stopOnHover:false,loop:false,bullets:true,caption:false,controls:true})
