(function(a){a.fn.nivoSlider=function(c){var d=a.extend({},a.fn.nivoSlider.defaults,c);return this.each(function(){var l={currentSlide:0,currentImage:"",totalSlides:0,randAnim:"",running:false,paused:false,stop:false};var f=a(this);f.data("nivo:vars",l);f.css("position","relative");f.addClass("nivoSlider");var g=f.children();g.each(function(){var q=a(this);var p="";if(!q.is("img")){if(q.is("a")){q.addClass("nivo-imageLink");p=q}q=q.find("img:first")}var o=q.width();if(o==0){o=q.attr("width")}var i=q.height();if(i==0){i=q.attr("height")}if(o>f.width()){f.width(o)}if(i>f.height()){f.height(i)}if(p!=""){p.css("display","none")}q.css("display","none");l.totalSlides++});if(d.startSlide>0){if(d.startSlide>=l.totalSlides){d.startSlide=l.totalSlides-1}l.currentSlide=d.startSlide}if(a(g[l.currentSlide]).is("img")){l.currentImage=a(g[l.currentSlide])}else{l.currentImage=a(g[l.currentSlide]).find("img:first")}if(a(g[l.currentSlide]).is("a")){a(g[l.currentSlide]).css("display","block")}f.css("background","url("+l.currentImage.attr("src")+") no-repeat");for(var j=0;j<d.slices;j++){var n=Math.round(f.width()/d.slices);if(j==d.slices-1){f.append(a('<div class="nivo-slice"></div>').css({left:(n*j)+"px",width:(f.width()-(n*j))+"px"}))}else{f.append(a('<div class="nivo-slice"></div>').css({left:(n*j)+"px",width:n+"px"}))}}f.append(a('<div class="nivo-caption"><p></p></div>').css({display:"none",opacity:d.captionOpacity}));if(l.currentImage.attr("title")!=""){var m=l.currentImage.attr("title");if(m.substr(0,1)=="#"){m=a(m).html()}a(".nivo-caption p",f).html(m);a(".nivo-caption",f).fadeIn(d.animSpeed)}var e=0;if(!d.manualAdvance&&g.length>1){e=setInterval(function(){b(f,g,d,false)},d.pauseTime)}if(d.directionNav){f.append('<div class="nivo-directionNav"><a class="nivo-prevNav">Prev</a><a class="nivo-nextNav">Next</a></div>');if(d.directionNavHide){a(".nivo-directionNav",f).hide();f.hover(function(){a(".nivo-directionNav",f).show()},function(){a(".nivo-directionNav",f).hide()})}a("a.nivo-prevNav",f).live("click",function(){if(l.running){return false}clearInterval(e);e="";l.currentSlide-=2;b(f,g,d,"prev")});a("a.nivo-nextNav",f).live("click",function(){if(l.running){return false}clearInterval(e);e="";b(f,g,d,"next")})}if(d.controlNav){var k=a('<div class="nivo-controlNav"></div>');f.append(k);for(var j=0;j<g.length;j++){if(d.controlNavThumbs){var h=g.eq(j);if(!h.is("img")){h=h.find("img:first")}if(d.controlNavThumbsFromRel){k.append('<a class="nivo-control" rel="'+j+'"><img src="'+h.attr("rel")+'" alt="" /></a>')}else{k.append('<a class="nivo-control" rel="'+j+'"><img src="'+h.attr("src").replace(d.controlNavThumbsSearch,d.controlNavThumbsReplace)+'" alt="" /></a>')}}else{k.append('<a class="nivo-control" rel="'+j+'">'+(j+1)+"</a>")}}a(".nivo-controlNav a:eq("+l.currentSlide+")",f).addClass("active");a(".nivo-controlNav a",f).live("click",function(){if(l.running){return false}if(a(this).hasClass("active")){return false}clearInterval(e);e="";f.css("background","url("+l.currentImage.attr("src")+") no-repeat");l.currentSlide=a(this).attr("rel")-1;b(f,g,d,"control")})}if(d.keyboardNav){a(window).keypress(function(i){if(i.keyCode=="37"){if(l.running){return false}clearInterval(e);e="";l.currentSlide-=2;b(f,g,d,"prev")}if(i.keyCode=="39"){if(l.running){return false}clearInterval(e);e="";b(f,g,d,"next")}})}if(d.pauseOnHover){f.hover(function(){l.paused=true;clearInterval(e);e=""},function(){l.paused=false;if(e==""&&!d.manualAdvance){e=setInterval(function(){b(f,g,d,false)},d.pauseTime)}})}f.bind("nivo:animFinished",function(){l.running=false;a(g).each(function(){if(a(this).is("a")){a(this).css("display","none")}});if(a(g[l.currentSlide]).is("a")){a(g[l.currentSlide]).css("display","block")}if(e==""&&!l.paused&&!d.manualAdvance){e=setInterval(function(){b(f,g,d,false)},d.pauseTime)}d.afterChange.call(this)})});function b(e,f,h,k){var l=e.data("nivo:vars");if((!l||l.stop)&&!k){return false}h.beforeChange.call(this);if(!k){e.css("background","url("+l.currentImage.attr("src")+") no-repeat")}else{if(k=="prev"){e.css("background","url("+l.currentImage.attr("src")+") no-repeat")}if(k=="next"){e.css("background","url("+l.currentImage.attr("src")+") no-repeat")}}l.currentSlide++;if(l.currentSlide==l.totalSlides){l.currentSlide=0;h.slideshowEnd.call(this)}if(l.currentSlide<0){l.currentSlide=(l.totalSlides-1)}if(a(f[l.currentSlide]).is("img")){l.currentImage=a(f[l.currentSlide])}else{l.currentImage=a(f[l.currentSlide]).find("img:first")}if(h.controlNav){a(".nivo-controlNav a",e).removeClass("active");a(".nivo-controlNav a:eq("+l.currentSlide+")",e).addClass("active")}if(l.currentImage.attr("title")!=""){var m=l.currentImage.attr("title");if(m.substr(0,1)=="#"){m=a(m).html()}if(a(".nivo-caption",e).css("display")=="block"){a(".nivo-caption p",e).fadeOut(h.animSpeed,function(){a(this).html(m);a(this).fadeIn(h.animSpeed)})}else{a(".nivo-caption p",e).html(m)}a(".nivo-caption",e).fadeIn(h.animSpeed)}else{a(".nivo-caption",e).fadeOut(h.animSpeed)}var j=0;a(".nivo-slice",e).each(function(){var i=Math.round(e.width()/h.slices);a(this).css({height:"0px",opacity:"0",background:"url("+l.currentImage.attr("src")+") no-repeat -"+((i+(j*i))-i)+"px 0%"});j++});if(h.effect=="random"){var n=new Array("sliceDownRight","sliceDownLeft","sliceUpRight","sliceUpLeft","sliceUpDown","sliceUpDownLeft","fold","fade");l.randAnim=n[Math.floor(Math.random()*(n.length+1))];if(l.randAnim==undefined){l.randAnim="fade"}}if(h.effect.indexOf(",")!=-1){var n=h.effect.split(",");l.randAnim=a.trim(n[Math.floor(Math.random()*n.length)])}l.running=true;if(h.effect=="sliceDown"||h.effect=="sliceDownRight"||l.randAnim=="sliceDownRight"||h.effect=="sliceDownLeft"||l.randAnim=="sliceDownLeft"){var g=0;var j=0;var p=a(".nivo-slice",e);if(h.effect=="sliceDownLeft"||l.randAnim=="sliceDownLeft"){p=a(".nivo-slice",e)._reverse()}p.each(function(){var i=a(this);i.css("top","0px");if(j==h.slices-1){setTimeout(function(){i.animate({height:"100%",opacity:"1.0"},h.animSpeed,"",function(){e.trigger("nivo:animFinished")})},(100+g))}else{setTimeout(function(){i.animate({height:"100%",opacity:"1.0"},h.animSpeed)},(100+g))}g+=50;j++})}else{if(h.effect=="sliceUp"||h.effect=="sliceUpRight"||l.randAnim=="sliceUpRight"||h.effect=="sliceUpLeft"||l.randAnim=="sliceUpLeft"){var g=0;var j=0;var p=a(".nivo-slice",e);if(h.effect=="sliceUpLeft"||l.randAnim=="sliceUpLeft"){p=a(".nivo-slice",e)._reverse()}p.each(function(){var i=a(this);i.css("bottom","0px");if(j==h.slices-1){setTimeout(function(){i.animate({height:"100%",opacity:"1.0"},h.animSpeed,"",function(){e.trigger("nivo:animFinished")})},(100+g))}else{setTimeout(function(){i.animate({height:"100%",opacity:"1.0"},h.animSpeed)},(100+g))}g+=50;j++})}else{if(h.effect=="sliceUpDown"||h.effect=="sliceUpDownRight"||l.randAnim=="sliceUpDown"||h.effect=="sliceUpDownLeft"||l.randAnim=="sliceUpDownLeft"){var g=0;var j=0;var o=0;var p=a(".nivo-slice",e);if(h.effect=="sliceUpDownLeft"||l.randAnim=="sliceUpDownLeft"){p=a(".nivo-slice",e)._reverse()}p.each(function(){var i=a(this);if(j==0){i.css("top","0px");j++}else{i.css("bottom","0px");j=0}if(o==h.slices-1){setTimeout(function(){i.animate({height:"100%",opacity:"1.0"},h.animSpeed,"",function(){e.trigger("nivo:animFinished")})},(100+g))}else{setTimeout(function(){i.animate({height:"100%",opacity:"1.0"},h.animSpeed)},(100+g))}g+=50;o++})}else{if(h.effect=="fold"||l.randAnim=="fold"){var g=0;var j=0;a(".nivo-slice",e).each(function(){var i=a(this);var q=i.width();i.css({top:"0px",height:"100%",width:"0px"});if(j==h.slices-1){setTimeout(function(){i.animate({width:q,opacity:"1.0"},h.animSpeed,"",function(){e.trigger("nivo:animFinished")})},(100+g))}else{setTimeout(function(){i.animate({width:q,opacity:"1.0"},h.animSpeed)},(100+g))}g+=50;j++})}else{if(h.effect=="fade"||l.randAnim=="fade"){var j=0;a(".nivo-slice",e).each(function(){a(this).css("height","100%");if(j==h.slices-1){a(this).animate({opacity:"1.0"},(h.animSpeed*2),"",function(){e.trigger("nivo:animFinished")})}else{a(this).animate({opacity:"1.0"},(h.animSpeed*2))}j++})}}}}}}};a.fn.nivoSlider.defaults={effect:"random",slices:15,animSpeed:500,pauseTime:3000,startSlide:0,directionNav:true,directionNavHide:true,controlNav:true,controlNavThumbs:false,controlNavThumbsFromRel:false,controlNavThumbsSearch:".jpg",controlNavThumbsReplace:"_thumb.jpg",keyboardNav:true,pauseOnHover:true,manualAdvance:false,captionOpacity:0.8,beforeChange:function(){},afterChange:function(){},slideshowEnd:function(){}};a.fn._reverse=[].reverse})(jQuery);jQuery.easing.jswing=jQuery.easing.swing;jQuery.extend(jQuery.easing,{def:"easeOutQuad",swing:function(e,f,a,h,g){return jQuery.easing[jQuery.easing.def](e,f,a,h,g)},easeInQuad:function(e,f,a,h,g){return h*(f/=g)*f+a},easeOutQuad:function(e,f,a,h,g){return -h*(f/=g)*(f-2)+a},easeInOutQuad:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f+a}return -h/2*((--f)*(f-2)-1)+a},easeInCubic:function(e,f,a,h,g){return h*(f/=g)*f*f+a},easeOutCubic:function(e,f,a,h,g){return h*((f=f/g-1)*f*f+1)+a},easeInOutCubic:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f+a}return h/2*((f-=2)*f*f+2)+a},easeInQuart:function(e,f,a,h,g){return h*(f/=g)*f*f*f+a},easeOutQuart:function(e,f,a,h,g){return -h*((f=f/g-1)*f*f*f-1)+a},easeInOutQuart:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f+a}return -h/2*((f-=2)*f*f*f-2)+a},easeInQuint:function(e,f,a,h,g){return h*(f/=g)*f*f*f*f+a},easeOutQuint:function(e,f,a,h,g){return h*((f=f/g-1)*f*f*f*f+1)+a},easeInOutQuint:function(e,f,a,h,g){if((f/=g/2)<1){return h/2*f*f*f*f*f+a}return h/2*((f-=2)*f*f*f*f+2)+a},easeInSine:function(e,f,a,h,g){return -h*Math.cos(f/g*(Math.PI/2))+h+a},easeOutSine:function(e,f,a,h,g){return h*Math.sin(f/g*(Math.PI/2))+a},easeInOutSine:function(e,f,a,h,g){return -h/2*(Math.cos(Math.PI*f/g)-1)+a},easeInExpo:function(e,f,a,h,g){return(f==0)?a:h*Math.pow(2,10*(f/g-1))+a},easeOutExpo:function(e,f,a,h,g){return(f==g)?a+h:h*(-Math.pow(2,-10*f/g)+1)+a},easeInOutExpo:function(e,f,a,h,g){if(f==0){return a}if(f==g){return a+h}if((f/=g/2)<1){return h/2*Math.pow(2,10*(f-1))+a}return h/2*(-Math.pow(2,-10*--f)+2)+a},easeInCirc:function(e,f,a,h,g){return -h*(Math.sqrt(1-(f/=g)*f)-1)+a},easeOutCirc:function(e,f,a,h,g){return h*Math.sqrt(1-(f=f/g-1)*f)+a},easeInOutCirc:function(e,f,a,h,g){if((f/=g/2)<1){return -h/2*(Math.sqrt(1-f*f)-1)+a}return h/2*(Math.sqrt(1-(f-=2)*f)+1)+a},easeInElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return -(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e},easeOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k)==1){return e+l}if(!j){j=k*0.3}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}return g*Math.pow(2,-10*h)*Math.sin((h*k-i)*(2*Math.PI)/j)+l+e},easeInOutElastic:function(f,h,e,l,k){var i=1.70158;var j=0;var g=l;if(h==0){return e}if((h/=k/2)==2){return e+l}if(!j){j=k*(0.3*1.5)}if(g<Math.abs(l)){g=l;var i=j/4}else{var i=j/(2*Math.PI)*Math.asin(l/g)}if(h<1){return -0.5*(g*Math.pow(2,10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j))+e}return g*Math.pow(2,-10*(h-=1))*Math.sin((h*k-i)*(2*Math.PI)/j)*0.5+l+e},easeInBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*(f/=h)*f*((g+1)*f-g)+a},easeOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}return i*((f=f/h-1)*f*((g+1)*f+g)+1)+a},easeInOutBack:function(e,f,a,i,h,g){if(g==undefined){g=1.70158}if((f/=h/2)<1){return i/2*(f*f*(((g*=(1.525))+1)*f-g))+a}return i/2*((f-=2)*f*(((g*=(1.525))+1)*f+g)+2)+a},easeInBounce:function(e,f,a,h,g){return h-jQuery.easing.easeOutBounce(e,g-f,0,h,g)+a},easeOutBounce:function(e,f,a,h,g){if((f/=g)<(1/2.75)){return h*(7.5625*f*f)+a}else{if(f<(2/2.75)){return h*(7.5625*(f-=(1.5/2.75))*f+0.75)+a}else{if(f<(2.5/2.75)){return h*(7.5625*(f-=(2.25/2.75))*f+0.9375)+a}else{return h*(7.5625*(f-=(2.625/2.75))*f+0.984375)+a}}}},easeInOutBounce:function(e,f,a,h,g){if(f<g/2){return jQuery.easing.easeInBounce(e,f*2,0,h,g)*0.5+a}return jQuery.easing.easeOutBounce(e,f*2-g,0,h,g)*0.5+h*0.5+a}});(function(a){a.fn.lavaLamp=function(b){b=a.extend({fx:"swing",speed:500,click:function(){return true},startItem:"no",autoReturn:true,returnDelay:0,setOnClick:true,homeTop:0,homeLeft:0,homeWidth:0,homeHeight:0,returnHome:false},b||{});var c;if(b.homeTop||b.homeLeft){c=a('<li class="homeLava selectedLava"></li>').css({left:b.homeLeft,top:b.homeTop,width:b.homeWidth,height:b.homeHeight,position:"absolute"});a(this).prepend(c)}return this.each(function(){function l(h){h||(h=p);var f=0,e=0;if(!a.browser.msie){f=(o.outerWidth()-o.innerWidth())/2;e=(o.outerHeight()-o.innerHeight())/2}o.stop().animate({left:h.offsetLeft-f,top:h.offsetTop-e,width:h.offsetWidth,height:h.offsetHeight},b.speed,b.fx)}var d=location.pathname+location.search+location.hash,n={},k,o,p,g=a("li[class!=noLava]",this);if(b.startItem=="no"){n=a('li a[href$="'+d+'"]',this).parent("li")}if(n.length==0&&b.startItem=="no"){n=a('li a[href$="'+location.pathname.substring(location.pathname.lastIndexOf("/")+1)+location.search+location.hash+'"]',this).parent("li")}if(n.length==0||b.startItem!="no"){if(b.startItem=="no"){b.startItem=0}n=a(g[b.startItem])}p=a("li.selectedLava",this)[0]||a(n).addClass("selectedLava")[0];g.mouseenter(function(){if(a(this).hasClass("homeLava")){p=a(this)[0]}l(this)});o=a('<li class="backLava"><div class="leftLava"></div><div class="bottomLava"></div><div class="cornerLava"></div></li>').appendTo(this);a(this).mouseleave(function(){if(b.autoReturn){if(b.returnHome&&c){l(c[0])}else{if(b.returnDelay){k&&clearTimeout(k);k=setTimeout(function(){l(null)},b.returnDelay+b.speed)}else{l(null)}}}});g.click(function(e){if(b.setOnClick){a(p).removeClass("selectedLava");a(this).addClass("selectedLava");p=this}return b.click.apply(this,[e,this])});b.homeTop||b.homeLeft?o.css({left:b.homeLeft,top:b.homeTop,width:b.homeWidth,height:b.homeHeight}):o.css({left:p.offsetLeft,top:p.offsetTop,width:p.offsetWidth,height:p.offsetHeight})})}})(jQuery);
