(function($){$.fn.lavaLamp=function(o){o=$.extend({fx:"linear",speed:500,click:function(){}},o||{});return this.each(function(){var b=$(this),noop=function(){},$back=$('<li class="back"><div class="left"></div></li>').appendTo(b),$li=$("li:visible",this),curr=$("li.current",this)[0]||$($li[0]).addClass("current")[0];$li.not(".back").hover(function(){move(this)},noop);$(this).hover(noop,function(){move(curr)});$li.click(function(e){setCurr(this);return o.click.apply(this,[e,this])});setCurr(curr);function setCurr(a){$back.css({"left":a.offsetLeft+"px","width":a.offsetWidth+"px"});curr=a};function move(a){$back.each(function(){$.dequeue(this,"fx")}).animate({width:a.offsetWidth,left:a.offsetLeft},o.speed,o.fx)}})}})(jQuery);

								(function($) {
									$.fn.submenu = function(options) {
										var opts = $.extend({}, $.fn.submenu.defaults, options);
									
										var ddmenuitem = 0;
										var closetimer = 0;
										var currentid = '';
									
										var open = function() {
											canceltimer();
											if (currentid != this.id) {
												close();
												ddmenuitem = $(this).find('ul').show("fast");
												currentid = this.id;
											}
										}
									
										var close = function() {
											if (ddmenuitem) {
												ddmenuitem.hide();
											}
											currentid = '';
										}
									
										var timer = function() {
											closetimer = window.setTimeout(close, opts.timeout);
										}
									
										var canceltimer = function() {
											if (closetimer) {
												window.clearTimeout(closetimer);
												closetimer = null;
											}
										}
									
										$(document).click(close);
									
										return this.hover(open, timer);
									};									
									$.fn.submenu.defaults = {
										timeout: 500
									};
								})(jQuery);

