//LavaLamp 1.3.3 plugin for jQuery
(function(b){b.fn.lavaLamp=function(a){a=b.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},a||{});var g;if(a.homeTop||a.homeLeft){g=b('<li class="homeLava selectedLava"></li>').css({left:a.homeLeft,top:a.homeTop,width:a.homeWidth,height:a.homeHeight,position:"absolute"});b(this).prepend(g)}return this.each(function(){function h(d){d||(d=c);var k=0,l=0;if(!b.browser.msie){k=
(e.outerWidth()-e.innerWidth())/2;l=(e.outerHeight()-e.innerHeight())/2}e.stop().animate({left:d.offsetLeft-k,top:d.offsetTop-l,width:d.offsetWidth,height:d.offsetHeight},a.speed,a.fx)}var m=location.pathname+location.search+location.hash,f={},i,e,c,j=b("li[class!=noLava]",this);if(a.startItem=="no")f=b('li a[href$="'+m+'"]',this).parent("li");if(f.length==0&&a.startItem=="no")f=b('li a[href$="'+location.pathname.substring(location.pathname.lastIndexOf("/")+1)+location.search+location.hash+'"]',this).parent("li");
if(f.length==0||a.startItem!="no"){if(a.startItem=="no")a.startItem=0;f=b(j[a.startItem])}c=b("li.selectedLava",this)[0]||b(f).addClass("selectedLava")[0];j.mouseenter(function(){if(b(this).hasClass("homeLava"))c=b(this)[0];h(this)});e=b('<li class="backLava"><div class="leftLava"></div><div class="bottomLava"></div><div class="cornerLava"></div></li>').appendTo(this);b(this).mouseleave(function(){if(a.autoReturn)if(a.returnHome&&g)h(g[0]);else if(a.returnDelay){i&&clearTimeout(i);i=setTimeout(function(){h(null)},
a.returnDelay+a.speed)}else h(null)});j.click(function(d){if(a.setOnClick){b(c).removeClass("selectedLava");b(this).addClass("selectedLava");c=this}return a.click.apply(this,[d,this])});a.homeTop||a.homeLeft?e.css({left:a.homeLeft,top:a.homeTop,width:a.homeWidth,height:a.homeHeight}):e.css({left:c.offsetLeft,top:c.offsetTop,width:c.offsetWidth,height:c.offsetHeight})})}})(jQuery);

// jQuery Tools 1.2.5 Slideshow - Extend it. NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE. http://flowplayer.org/tools/tabs/slideshow.html
(function(c){function p(g,a){function m(f){var e=c(f);return e.length<2?e:g.parent().find(f)}var b=this,i=g.add(this),d=g.data("tabs"),h,j=true,n=m(a.next).click(function(){d.next()}),k=m(a.prev).click(function(){d.prev()});c.extend(b,{getTabs:function(){return d},getConf:function(){return a},play:function(){if(h)return b;var f=c.Event("onBeforePlay");i.trigger(f);if(f.isDefaultPrevented())return b;h=setInterval(d.next,a.interval);j=false;i.trigger("onPlay");return b},pause:function(){if(!h)return b;
var f=c.Event("onBeforePause");i.trigger(f);if(f.isDefaultPrevented())return b;h=clearInterval(h);i.trigger("onPause");return b},stop:function(){b.pause();j=true}});c.each("onBeforePlay,onPlay,onBeforePause,onPause".split(","),function(f,e){c.isFunction(a[e])&&c(b).bind(e,a[e]);b[e]=function(q){return c(b).bind(e,q)}});a.autopause&&d.getTabs().add(n).add(k).add(d.getPanes()).hover(b.pause,function(){j||b.play()});a.autoplay&&b.play();a.clickable&&d.getPanes().click(function(){d.next()});if(!d.getConf().rotate){var l=
a.disabledClass;d.getIndex()||k.addClass(l);d.onBeforeClick(function(f,e){k.toggleClass(l,!e);n.toggleClass(l,e==d.getTabs().length-1)})}}var o;o=c.tools.tabs.slideshow={conf:{next:".forward",prev:".backward",disabledClass:"disabled",autoplay:false,autopause:true,interval:3E3,clickable:true,api:false}};c.fn.slideshow=function(g){var a=this.data("slideshow");if(a)return a;g=c.extend({},o.conf,g);this.each(function(){a=new p(c(this),g);c(this).data("slideshow",a)});return g.api?a:this}})(jQuery);

var IE7_PNG_SUFFIX = ".png";

$(document).ready(function(){

  $("#nav").lavaLamp({fx: 'swing', speed: 333});
  
  $(".slidetabs").tabs(".slides > div", {
    // enable "cross-fading" effect
    effect: 'fade',
    fadeOutSpeed: "slow",
    // start from the beginning after the last tab
    rotate: true
    // use the slideshow plugin. It accepts its own configuration
  }).slideshow();

});


