/*LavaLamp 1.3.1 plugin for jQuery 1.2.x or higher Copyright (c) 2008, 2009 Jolyon Terwilliger, jolyon@nixbox.com http://nixbox.com/lavalamp.php*/
(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||{});return this.each(function(){var H=location.pathname+location.search+location.hash;var E=new Object;var D;var I;var F;var G;if(B.homeTop||B.homeLeft){F=A('<li class="homeLava selectedLava"></li>').css({left:B.homeLeft,top:B.homeTop,width:B.homeWidth,height:B.homeHeight,position:"absolute"});$(this).prepend(F)}var J=A("li",this);if(B.startItem=="no"){E=A('li a[href$="'+H+'"]',this).parent("li")}if(E.length==0&&B.startItem=="no"&&location.hash){E=A('li a[href$="'+location.hash+'"]',this).parent("li")}if(E.length==0||B.startItem!="no"){if(B.startItem=="no"){B.startItem=0}E=A(J[B.startItem])}G=A("li.selectedLava",this)[0]||A(E).addClass("selectedLava")[0];J.mouseover(function(){if($(this).hasClass("homeLava")){G=$(this)[0]}C(this)});I=A('<li class="backLava"><div class="leftLava"></div><div class="bottomLava"></div><div class="cornerLava"></div></li>').appendTo(this);A(this).mouseout(function(){if(B.autoReturn){if(B.returnHome&&F){C(F[0])}else{if(B.returnDelay){if(D){clearTimeout(D)}D=setTimeout(C,B.returnDelay+B.speed)}else{C()}}}});J.click(function(K){if(B.setOnClick){$(G).removeClass("selectedLava");$(this).addClass("selectedLava");G=this}return B.click.apply(this,[K,this])});if(B.homeTop||B.homeLeft){I.css({left:B.homeLeft,top:B.homeTop,width:B.homeWidth,height:B.homeHeight})}else{I.css({left:G.offsetLeft,top:G.offsetTop,width:G.offsetWidth,height:G.offsetHeight})}function C(K){if(!K){K=G}var M=0,L=0;if(!$.browser.msie){M=(I.outerWidth()-I.innerWidth())/2;L=(I.outerHeight()-I.innerHeight())/2}I.stop().animate({left:K.offsetLeft-M,top:K.offsetTop-L,width:K.offsetWidth,height:K.offsetHeight},B.speed,B.fx)}})}})(jQuery);
