/**
 * jquery.LavaLamp v1.3.4 - light up your menus with fluid, jQuery powered animations.
 * Requires jQuery v1.2.3 or better from http://jquery.com
 * Tested on jQuery 1.4.4, 1.3.2 and 1.2.6
 * http://nixbox.com/projects/jquery-lavalamp/
 * Source code Copyright (c) 2008, 2009, 2010 Jolyon Terwilliger, jolyon@nixbox.com
 * Dual licensed under the MIT and GPL licenses:
 * http://www.opensource.org/licenses/mit-license.php
 * http://www.gnu.org/licenses/gpl.html
 */
(function(c){jQuery.fn.lavaLamp=function(a){function f(g){g=parseInt(g);return isNaN(g)?0:g}a=c.extend({target:"li",fx:"swing",speed:500,click:function(){return true},startItem:"",autoReturn:true,returnDelay:0,setOnClick:true,homeTop:0,homeLeft:0,homeWidth:0,homeHeight:0,returnHome:false,autoResize:false},a||{});a.autoResize&&c(window).resize(function(){c(a.target+".selectedLava").trigger("mouseenter")});return this.each(function(){function g(d){d||(d=b);e.stop().animate({left:d.position().left,top:d.position().top,
width:d.outerWidth()-j,height:d.outerHeight()-k},a.speed,a.fx)}c(this).css("position")=="static"&&c(this).css("position","relative");if(a.homeTop||a.homeLeft){var l=c("<"+a.target+' class="homeLava"></'+a.target+">").css({left:a.homeLeft,top:a.homeTop,width:a.homeWidth,height:a.homeHeight,position:"absolute",display:"block"});c(this).prepend(l)}var o=location.pathname+location.search+location.hash,b,e,i=c(a.target+"[class!=noLava]",this),h,j=0,k=0;b=c(a.target+".selectedLava",this);if(a.startItem!=
"")b=i.eq(a.startItem);if((a.homeTop||a.homeLeft)&&b.length<1)b=l;if(b.length<1){var m=0,n;i.each(function(){var d=c("a:first",this).attr("href");if(o.indexOf(d)>-1&&d.length>m){n=c(this);m=d.length}});if(m>0)b=n}if(b.length<1)b=i.eq(0);b=c(b.eq(0).addClass("selectedLava"));i.bind("mouseenter",function(){if(h){clearTimeout(h);h=null}g(c(this))}).click(function(d){if(a.setOnClick){b.removeClass("selectedLava");b=c(this).addClass("selectedLava")}return a.click.apply(this,[d,this])});e=c("<"+a.target+
' class="backLava"><div class="leftLava"></div><div class="bottomLava"></div><div class="cornerLava"></div></'+a.target+">").css({position:"absolute",display:"block"}).prependTo(this);j=f(e.css("borderLeftWidth"))+f(e.css("borderRightWidth"))+f(e.css("paddingLeft"))+f(e.css("paddingRight"));k=f(e.css("borderTopWidth"))+f(e.css("borderBottomWidth"))+f(e.css("paddingTop"))+f(e.css("paddingBottom"));a.homeTop||a.homeLeft?e.css({left:a.homeLeft,top:a.homeTop,width:a.homeWidth,height:a.homeHeight}):e.css({left:b.position().left,
top:b.position().top,width:b.outerWidth()-j,height:b.outerHeight()-k});c(this).bind("mouseleave",function(){var d=null;if(a.returnHome)d=l;else if(!a.autoReturn)return true;if(a.returnDelay){h&&clearTimeout(h);h=setTimeout(function(){g(d)},a.returnDelay)}else g(d);return true})})}})(jQuery);

