// Jquery Minified Plugins: common
// easing: Copyright (c) 2007 George Smith (http://gsgd.co.uk/sandbox/jquery/easing/)
// ToolTip: Copyright (c) 2006 - 2008 Jörn Zaefferer (http://bassistance.de/jquery-plugins/jquery-plugin-tooltip/)
// popin modal window
// humanmsg
// history plugin copyright (c) 2006 Taku Sano (Mikage Sawatari)
// jamcord: jamtech accordian
// lavalamp v0.1.0 Copyright (c) 2007 Ganeshji Marwaha (gmarwaha.com)
// JSmile for jQuery - Andrea Giammarchi [webreflection.blogspot.com] - V0.3 - 0.000752

// JSmile 
$.fn.extend({smile:(function(){function smile(show){show=!arguments.length||!!show;this.each(function(i,firstChild){jQuery.each(firstChild.childNodes,function(i,firstChild){switch(firstChild.nodeType){case 1:show?jQuery(firstChild).smile(show):smile.remove(firstChild);break;case 3:if(show&&!smile.nodeName[firstChild.parentNode.nodeName.toUpperCase()])
smile.add(firstChild);break;}});});return this;};smile.add=function(firstChild){var parentNode=firstChild.parentNode,nodeValue=firstChild.nodeValue,i=0,length=0,img;nodeValue.replace(smile.RegExp,function(createTextNode,pos){if(++length<21){img=new Image();img.className=smile.className;var smileys=new Array('happy','crying','emo','really','hmmm','shout','eh?','yess...','yay!','oh dear','fuggit','smug','doh','wtf');var tmp=smile.link(createTextNode);tmp=tmp.replace(smile.src,'');tmp=tmp.replace(/58./,'');tmp=tmp.replace(/.58/,'');tmp=Number(tmp)-97;img.title=smileys[tmp];img.src=smile.link(img.alt=createTextNode);jQuery(firstChild).before(document.createTextNode(nodeValue.substring(i,pos))).before(img);i=pos+createTextNode.length;}});if(i)
jQuery(firstChild).before(document.createTextNode(nodeValue.substring(i))).remove();};smile.link=function(join){var split=join.split(""),length=split.length;while(length--)
split[length]=split[length].charCodeAt(0);return smile.src+split.join(".");};smile.remove=function(firstChild){jQuery(firstChild).find("img."+smile.className).each(function(i,firstChild){jQuery(firstChild).replaceWith(document.createTextNode(firstChild.alt||firstChild.title));});};smile.className="jsmile";smile.nodeName={"CODE":true,"NOSCRIPT":true,"PRE":true,"SCRIPT":true,"STYLE":true};smile.RegExp=/:a:|:b:|:c:|:d:|:e:|:f:|:g:|:h:|:i:|:j:|:k:|:l:|:m:|:n:/g;smile.src="gfx/smile/";return smile;})()});

//easing
jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(x,t,b,c,d){return jQuery.easing[jQuery.easing.def](x,t,b,c,d);},easeInQuad:function(x,t,b,c,d){return c*(t/=d)*t+b;},easeOutQuad:function(x,t,b,c,d){return-c*(t/=d)*(t-2)+b;},easeInOutQuad:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t+b;return-c/2*((--t)*(t-2)-1)+b;},easeInCubic:function(x,t,b,c,d){return c*(t/=d)*t*t+b;},easeOutCubic:function(x,t,b,c,d){return c*((t=t/d-1)*t*t+1)+b;},easeInOutCubic:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t+b;return c/2*((t-=2)*t*t+2)+b;},easeInQuart:function(x,t,b,c,d){return c*(t/=d)*t*t*t+b;},easeOutQuart:function(x,t,b,c,d){return-c*((t=t/d-1)*t*t*t-1)+b;},easeInOutQuart:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t+b;return-c/2*((t-=2)*t*t*t-2)+b;},easeInQuint:function(x,t,b,c,d){return c*(t/=d)*t*t*t*t+b;},easeOutQuint:function(x,t,b,c,d){return c*((t=t/d-1)*t*t*t*t+1)+b;},easeInOutQuint:function(x,t,b,c,d){if((t/=d/2)<1)return c/2*t*t*t*t*t+b;return c/2*((t-=2)*t*t*t*t+2)+b;},easeInSine:function(x,t,b,c,d){return-c*Math.cos(t/d*(Math.PI/2))+c+b;},easeOutSine:function(x,t,b,c,d){return c*Math.sin(t/d*(Math.PI/2))+b;},easeInOutSine:function(x,t,b,c,d){return-c/2*(Math.cos(Math.PI*t/d)-1)+b;},easeInExpo:function(x,t,b,c,d){return(t==0)?b:c*Math.pow(2,10*(t/d-1))+b;},easeOutExpo:function(x,t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b;},easeInOutExpo:function(x,t,b,c,d){if(t==0)return b;if(t==d)return b+c;if((t/=d/2)<1)return c/2*Math.pow(2,10*(t-1))+b;return c/2*(-Math.pow(2,-10*--t)+2)+b;},easeInCirc:function(x,t,b,c,d){return-c*(Math.sqrt(1-(t/=d)*t)-1)+b;},easeOutCirc:function(x,t,b,c,d){return c*Math.sqrt(1-(t=t/d-1)*t)+b;},easeInOutCirc:function(x,t,b,c,d){if((t/=d/2)<1)return-c/2*(Math.sqrt(1-t*t)-1)+b;return c/2*(Math.sqrt(1-(t-=2)*t)+1)+b;},easeInElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return-(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;},easeOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d)==1)return b+c;if(!p)p=d*.3;if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);return a*Math.pow(2,-10*t)*Math.sin((t*d-s)*(2*Math.PI)/p)+c+b;},easeInOutElastic:function(x,t,b,c,d){var s=1.70158;var p=0;var a=c;if(t==0)return b;if((t/=d/2)==2)return b+c;if(!p)p=d*(.3*1.5);if(a<Math.abs(c)){a=c;var s=p/4;}
else var s=p/(2*Math.PI)*Math.asin(c/a);if(t<1)return-.5*(a*Math.pow(2,10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p))+b;return a*Math.pow(2,-10*(t-=1))*Math.sin((t*d-s)*(2*Math.PI)/p)*.5+c+b;},easeInBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*(t/=d)*t*((s+1)*t-s)+b;},easeOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b;},easeInOutBack:function(x,t,b,c,d,s){if(s==undefined)s=1.70158;if((t/=d/2)<1)return c/2*(t*t*(((s*=(1.525))+1)*t-s))+b;return c/2*((t-=2)*t*(((s*=(1.525))+1)*t+s)+2)+b;},easeInBounce:function(x,t,b,c,d){return c-jQuery.easing.easeOutBounce(x,d-t,0,c,d)+b;},easeOutBounce:function(x,t,b,c,d){if((t/=d)<(1/2.75)){return c*(7.5625*t*t)+b;}else if(t<(2/2.75)){return c*(7.5625*(t-=(1.5/2.75))*t+.75)+b;}else if(t<(2.5/2.75)){return c*(7.5625*(t-=(2.25/2.75))*t+.9375)+b;}else{return c*(7.5625*(t-=(2.625/2.75))*t+.984375)+b;}},easeInOutBounce:function(x,t,b,c,d){if(t<d/2)return jQuery.easing.easeInBounce(x,t*2,0,c,d)*.5+b;return jQuery.easing.easeOutBounce(x,t*2-d,0,c,d)*.5+c*.5+b;}});

//jqpopin -modal window
jQuery.fn.popin=function(o){var settings=jQuery.extend({loaderImg:"",opacity:.5},o);jQuery(this).each(function(){jQuery(this).click(function(){PPNopen($(this).attr("href"));return false;});});var Loader=new Image();Loader.src=settings.loaderImg;ie6=($.browser.msie&&($.browser.version=="6.0"))?true:false
function PPNopen(url){$("body").prepend('<div class="popin-veil"></div>');if(ie6==true){PPNhtmlScroll=document.getElementsByTagName("html")[0].scrollTop;var PPNbodyMargin=new Object();PPNbodyMargin.top=parseInt($("body").css("margin-top"));PPNbodyMargin.right=parseInt($("body").css("margin-right"));PPNbodyMargin.bottom=parseInt($("body").css("margin-bottom"));PPNbodyMargin.left=parseInt($("body").css("margin-left"));$("html, body").css("height","100%");$("html, body").css("overflow","hidden");PPNbodyHeight=parseInt($("body").height());$("html, body").css("overflow","visible");$("html, body").css("overflow-x","visible");PPNbodyTop=((PPNbodyMargin.top+PPNbodyMargin.bottom)<PPNhtmlScroll)?(PPNbodyMargin.top+PPNbodyMargin.bottom-PPNhtmlScroll):0;$("body").css("top",PPNbodyTop);$(".popin-veil").css("top",-(PPNbodyMargin.top+PPNbodyMargin.bottom-PPNhtmlScroll));$(".popin-veil").css("left",(-PPNbodyMargin.left));$(".popin-veil").css("width",$("html").width());}else{$("html, body").css("overflow","hidden");}
$(".popin-veil").animate({opacity:settings.opacity,height:((ie6==true)?(PPNbodyHeight+PPNbodyMargin.top+PPNbodyMargin.bottom):"100%")},function(){$(".popin-veil").css("background-image","url('"+settings.loaderImg+"')");$(".popin").css("height",$("body").height());$.ajax({type:"GET",url:url,dataType:"html",success:function(m){$("body").prepend('<div class="popin"><div class="popin-content"></div></div>');$(".popin-content").html(m);},complete:function(){$(".popin-veil").css("background-image","");if(ie6==true){$(".popin").css("top",parseInt($(".popin").css("top"))-PPNbodyTop);}
$(".popin").fadeIn("slow");$(".popin-close").click(function(){PPNclose();return false;});}});});$("html").keydown(function(e){if(e.keyCode=='27'){PPNclose();}});}
function PPNclose(){$("html").unbind("keydown");$(".popin").fadeOut("slow",function(){$(".popin-veil").animate({opacity:0,height:0},function(){if(ie6==true){$("html, body").css("height","auto");$("html, body").css("overflow","auto");$("html, body").css("overflow-x","hidden");$("body").css("top",0);window.scrollTo(0,(PPNhtmlScroll));}else{$("html, body").css("overflow","visible");}
$(".popin, .popin-veil").remove();});});}};

//humanmsg
var humanMsg={setup:function(appendTo,logName,msgOpacity){humanMsg.msgID='humanMsg';humanMsg.logID='humanMsgLog';if(appendTo==undefined)appendTo='body';if(logName==undefined)logName='Message Log';humanMsg.msgOpacity=.8;if(msgOpacity!=undefined)humanMsg.msgOpacity=parseFloat(msgOpacity);jQuery(appendTo).append('<div id="'+humanMsg.msgID+'" class="humanMsg"><div class="round"></div><p></p><div class="round"></div></div> <div id="'+humanMsg.logID+'"><p>'+logName+'</p><ul></ul></div>')
jQuery('#'+humanMsg.logID+' p').click(function(){jQuery(this).siblings('ul').slideToggle()})},displayMsg:function(msg){if(msg=='')return;clearTimeout(humanMsg.t2);jQuery('#'+humanMsg.msgID+' p').html(msg)
jQuery('#'+humanMsg.msgID+'').show().animate({opacity:humanMsg.msgOpacity},200,function(){jQuery('#'+humanMsg.logID).show().children('ul').prepend('<li>'+msg+'</li>').children('li:first').slideDown(200)
if(jQuery('#'+humanMsg.logID+' ul').css('display')=='none'){jQuery('#'+humanMsg.logID+' p').animate({bottom:40},200,'linear',function(){jQuery(this).animate({bottom:0},300,'easeOutBounce',function(){jQuery(this).css({bottom:0})})})}})
humanMsg.t1=setTimeout("humanMsg.bindEvents()",700)
humanMsg.t2=setTimeout("humanMsg.removeMsg()",5000)},bindEvents:function(){jQuery(window).mousemove(humanMsg.removeMsg).click(humanMsg.removeMsg).keypress(humanMsg.removeMsg)},removeMsg:function(){jQuery(window).unbind('mousemove',humanMsg.removeMsg).unbind('click',humanMsg.removeMsg).unbind('keypress',humanMsg.removeMsg)
if(jQuery('#'+humanMsg.msgID).css('opacity')==humanMsg.msgOpacity)jQuery('#'+humanMsg.msgID).animate({opacity:0},500,function(){jQuery(this).hide()})}};

//tooltip
//(function($){var helper={},current,title,tID,IE=$.browser.msie&&/MSIE\s(5\.5|6\.)/.test(navigator.userAgent),track=false;$.tooltip={blocked:false,defaults:{delay:200,fade:false,showURL:true,extraClass:"",top:15,left:15,id:"tooltip"},block:function(){$.tooltip.blocked=!$.tooltip.blocked;}};$.fn.extend({tooltip:function(settings){settings=$.extend({},$.tooltip.defaults,settings);createHelper(settings);return this.each(function(){$.data(this,"tooltip",settings);this.tOpacity=helper.parent.css("opacity");this.tooltipText=this.title;$(this).removeAttr("title");this.alt="";}).mouseover(save).mouseout(hide).click(hide);},fixPNG:IE?function(){return this.each(function(){var image=$(this).css('backgroundImage');if(image.match(/^url\(["']?(.*\.png)["']?\)$/i)){image=RegExp.$1;$(this).css({'backgroundImage':'none','filter':"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='"+image+"')"}).each(function(){var position=$(this).css('position');if(position!='absolute'&&position!='relative')$(this).css('position','relative');});}});}:function(){return this;},unfixPNG:IE?function(){return this.each(function(){$(this).css({'filter':'',backgroundImage:''});});}:function(){return this;},hideWhenEmpty:function(){return this.each(function(){$(this)[$(this).html()?"show":"hide"]();});},url:function(){return this.attr('href')||this.attr('src');}});function createHelper(settings){if(helper.parent)return;helper.parent=$('<div id="'+settings.id+'"><h3></h3><div class="body"></div><div class="url"></div></div>').appendTo(document.body).hide();if($.fn.bgiframe)helper.parent.bgiframe();helper.title=$('h3',helper.parent);helper.body=$('div.body',helper.parent);helper.url=$('div.url',helper.parent);}function settings(element){return $.data(element,"tooltip");}function handle(event){if(settings(this).delay)tID=setTimeout(show,settings(this).delay);else
//show();track=!!settings(this).track;$(document.body).bind('mousemove',update);update(event);}function save(){if($.tooltip.blocked||this==current||(!this.tooltipText&&!settings(this).bodyHandler))return;current=this;title=this.tooltipText;if(settings(this).bodyHandler){helper.title.hide();var bodyContent=settings(this).bodyHandler.call(this);if(bodyContent.nodeType||bodyContent.jquery){helper.body.empty().append(bodyContent)}else{helper.body.html(bodyContent);}helper.body.show();}else if(settings(this).showBody){var parts=title.split(settings(this).showBody);helper.title.html(parts.shift()).show();helper.body.empty();for(var i=0,part;(part=parts[i]);i++){if(i>0)helper.body.append("<br/>");helper.body.append(part);}helper.body.hideWhenEmpty();}else{helper.title.html(title).show();helper.body.hide();}if(settings(this).showURL&&$(this).url())helper.url.html($(this).url().replace('http://','')).show();else
//helper.url.hide();helper.parent.addClass(settings(this).extraClass);if(settings(this).fixPNG)helper.parent.fixPNG();handle.apply(this,arguments);}function show(){tID=null;if((!IE||!$.fn.bgiframe)&&settings(current).fade){if(helper.parent.is(":animated"))helper.parent.stop().show().fadeTo(settings(current).fade,current.tOpacity);else
//helper.parent.is(':visible')?helper.parent.fadeTo(settings(current).fade,current.tOpacity):helper.parent.fadeIn(settings(current).fade);}else{helper.parent.show();}update();}function update(event){if($.tooltip.blocked)return;if(event&&event.target.tagName=="OPTION"){return;}if(!track&&helper.parent.is(":visible")){$(document.body).unbind('mousemove',update)}if(current==null){$(document.body).unbind('mousemove',update);return;}helper.parent.removeClass("viewport-right").removeClass("viewport-bottom");var left=helper.parent[0].offsetLeft;var top=helper.parent[0].offsetTop;if(event){left=event.pageX+settings(current).left;top=event.pageY+settings(current).top;var right='auto';if(settings(current).positionLeft){right=$(window).width()-left;left='auto';}helper.parent.css({left:left,right:right,top:top});}var v=viewport(),h=helper.parent[0];if(v.x+v.cx<h.offsetLeft+h.offsetWidth){left-=h.offsetWidth+20+settings(current).left;helper.parent.css({left:left+'px'}).addClass("viewport-right");}if(v.y+v.cy<h.offsetTop+h.offsetHeight){top-=h.offsetHeight+20+settings(current).top;helper.parent.css({top:top+'px'}).addClass("viewport-bottom");}}function viewport(){return{x:$(window).scrollLeft(),y:$(window).scrollTop(),cx:$(window).width(),cy:$(window).height()};}function hide(event){if($.tooltip.blocked)return;if(tID)clearTimeout(tID);current=null;var tsettings=settings(this);function complete(){helper.parent.removeClass(tsettings.extraClass).hide().css("opacity","");}if((!IE||!$.fn.bgiframe)&&tsettings.fade){if(helper.parent.is(':animated'))helper.parent.stop().fadeTo(tsettings.fade,0,complete);else
//helper.parent.stop().fadeOut(tsettings.fade,complete);}else
//complete();if(settings(this).fixPNG)helper.parent.unfixPNG();}})(jQuery);
//
//simple tooltip2
jQuery.fn.tooltip=function(element,offX,offY){if(element==null){var element='#tooltip';}if(offX==null){var offX=5;}if(offY==null){var offY=5;}$(this).each(function(){var title=$(this).attr('title');var tipa=$(this).attr('tip');if(title){$(this).removeAttr('title').attr('tip',title);$(this).mousemove(function(e){var tip=$(this).attr('tip');$(element).css({display:'block',top:e.pageY+offY,left:e.pageX+offX}).text(tip);});$(this).mouseout(function(){$(element).css('display','none');});}else if(tipa){$(this).mousemove(function(e){$(element).css({display:'block',top:e.pageY+offY,left:e.pageX+offX}).text(tipa);});$(this).mouseout(function(){$(element).css('display','none');});}});return this;};

//ajax nav
jQuery.fn.jNav=function(e){$(this).click(function(){var url=$(this).attr('href');url=st(url);$("#nav li a.Nv1").removeClass("active");$(this).addClass("active");if(url)loadContent(url);});return this;};

//history
//jQuery.extend({historyCurrentHash:undefined,historyCallback:function(url){if(!url)url=1;},historyInit:function(callback){jQuery.historyCallback=callback;var current_hash=location.hash;jQuery.historyCurrentHash=current_hash;if(jQuery.browser.msie){if(jQuery.historyCurrentHash==''){jQuery.historyCurrentHash='#';}
//$("body").prepend('<iframe id="jQuery_history" style="display: none;"></iframe>');var ihistory=$("#jQuery_history")[0];var iframe=ihistory.contentWindow.document;iframe.open();iframe.close();iframe.location.hash=current_hash;}
//else if($.browser.safari){jQuery.historyBackStack=[];jQuery.historyBackStack.length=history.length;jQuery.historyForwardStack=[];jQuery.isFirst=true;}
//jQuery.historyCallback(current_hash.replace(/^#/,''));setInterval(jQuery.historyCheck,100);},historyAddHistory:function(hash){jQuery.historyBackStack.push(hash);jQuery.historyForwardStack.length=0;this.isFirst=true;},historyCheck:function(){if(jQuery.browser.msie){var ihistory=$("#jQuery_history")[0];var iframe=ihistory.contentDocument||ihistory.contentWindow.document;var current_hash=iframe.location.hash;if(current_hash!=jQuery.historyCurrentHash){location.hash=current_hash;jQuery.historyCurrentHash=current_hash;jQuery.historyCallback(current_hash.replace(/^#/,''));}}else if($.browser.safari){if(!jQuery.dontCheck){var historyDelta=history.length-jQuery.historyBackStack.length;if(historyDelta){jQuery.isFirst=false;if(historyDelta<0){for(var i=0;i<Math.abs(historyDelta);i++)jQuery.historyForwardStack.unshift(jQuery.historyBackStack.pop());}else{for(var i=0;i<historyDelta;i++)jQuery.historyBackStack.push(jQuery.historyForwardStack.shift());}
//var cachedHash=jQuery.historyBackStack[jQuery.historyBackStack.length-1];if(cachedHash!=undefined){jQuery.historyCurrentHash=location.hash;jQuery.historyCallback(cachedHash);}}else if(jQuery.historyBackStack[jQuery.historyBackStack.length-1]==undefined&&!jQuery.isFirst){if(document.URL.indexOf('#')>=0){jQuery.historyCallback(document.URL.split('#')[1]);}else{var current_hash=location.hash;jQuery.historyCallback('');}
//jQuery.isFirst=true;}}}else{var current_hash=location.hash;if(current_hash!=jQuery.historyCurrentHash){jQuery.historyCurrentHash=current_hash;jQuery.historyCallback(current_hash.replace(/^#/,''));}}},historyLoad:function(hash){var newhash;if(jQuery.browser.safari){newhash=hash;}
//else{newhash='#'+hash;location.hash=newhash;}
//jQuery.historyCurrentHash=newhash;if(jQuery.browser.msie){var ihistory=$("#jQuery_history")[0];var iframe=ihistory.contentWindow.document;iframe.open();iframe.close();iframe.location.hash=newhash;jQuery.historyCallback(hash);}
//else if(jQuery.browser.safari){jQuery.dontCheck=true;this.historyAddHistory(hash);var fn=function(){jQuery.dontCheck=false;};window.setTimeout(fn,200);jQuery.historyCallback(hash);location.hash=newhash;}
//else{jQuery.historyCallback(hash);}}});

//jamcord
function jamCord(){$('ul.jamCord ul').hide();$.each($('ul.menu'),function(){$('#'+this.id+'.firstCord ul:first').show();});$('ul.jamCord li a').click(function(){var Next=$(this).next();var parent=this.parentNode.parentNode.id;if($('#'+parent).hasClass('noCord')){if((String(parent).length>0)&&(String(this.className).length>0)){$(this).next().slideToggle('normal');}}
if((Next.is('ul'))&&(Next.is(':visible'))){if($('#'+parent).hasClass('collapsible')){$('#'+parent+' ul:visible').slideUp('normal');}
return false;}
if((Next.is('ul'))&&(!Next.is(':visible'))){$('#'+parent+' ul:visible').slideUp('normal');Next.slideDown('normal');return false;}});}

//lavalamp
(function(jQuery){jQuery.fn.lavaLamp=function(o){o=jQuery.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},o||{});return this.each(function(){var path=location.pathname+location.search+location.hash;var $selected=new Object;var delayTimer;var $back;var $home;var ce;if(o.homeTop||o.homeLeft){$home=jQuery('<li class="homeLava selectedLava"></li>').css({left:o.homeLeft,top:o.homeTop,width:o.homeWidth,height:o.homeHeight,position:'absolute'});jQuery(this).prepend($home);}
var $li=jQuery('li',this);if(o.startItem=='no')
$selected=jQuery('li a[href$="'+path+'"]',this).parent('li');if($selected.length==0&&o.startItem=='no'&&location.hash)
$selected=jQuery('li a[href$="'+location.hash+'"]',this).parent('li');if($selected.length==0||o.startItem!='no'){if(o.startItem=='no')o.startItem=0;$selected=jQuery($li[o.startItem]);}
ce=jQuery('li.selectedLava',this)[0]||jQuery($selected).addClass('selectedLava')[0];$li.mouseover(function(){if(jQuery(this).hasClass('homeLava')){ce=jQuery(this)[0];}
move(this);});$back=jQuery('<li class="backLava"><div class="leftLava"></div></li>').appendTo(this);jQuery(this).mouseout(function(){if(o.autoReturn){if(o.returnHome&&$home){move($home[0]);}
else if(o.returnDelay){if(delayTimer)clearTimeout(delayTimer);delayTimer=setTimeout(move,o.returnDelay+o.speed);}
else{move();}}});$li.click(function(e){if(o.setOnClick){jQuery(ce).removeClass('selectedLava');jQuery(this).addClass('selectedLava');ce=this;}
return o.click.apply(this,[e,this]);});if(o.homeTop||o.homeLeft)
$back.css({left:o.homeLeft,top:o.homeTop,width:o.homeWidth,height:o.homeHeight});else
$back.css({left:ce.offsetLeft,top:ce.offsetTop,width:ce.offsetWidth,height:ce.offsetHeight});function move(el){if(!el)el=ce;var bx=0,by=0;if(!jQuery.browser.msie){bx=($back.outerWidth()-$back.innerWidth())/2;by=($back.outerHeight()-$back.innerHeight())/2;}
$back.stop().animate({left:el.offsetLeft-bx,top:el.offsetTop-by,width:el.offsetWidth,height:el.offsetHeight},o.speed,o.fx);};});};})(jQuery);(function($){$.fn.lavaLamp2=function(o){o=$.extend({fx:"linear",speed:500,click:function(){}},o||{});return this.each(function(){var b=$(this),noop=function(){},$back=$('<li class="back2"><div class="left2"></div></li>').appendTo(b),$li=$("li",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(){$(this).dequeue()}).animate({width:a.offsetWidth,left:a.offsetLeft},o.speed,o.fx)}})}})(jQuery);

//wait
jQuery.fn.wait = function(time,func){this.each(function(){setTimeout(func,time);});return this;};

// jquery animate background image
(function($){$.extend($.fx.step,{backgroundPosition:function(fx){if(fx.state===0&&typeof fx.end=='string'){var start=$.curCSS(fx.elem,'backgroundPosition');start=toArray(start);fx.start=[start[0],start[2]];var end=toArray(fx.end);fx.end=[end[0],end[2]];fx.unit=[end[1],end[3]];}
var nowPosX=[];nowPosX[0]=((fx.end[0]-fx.start[0])*fx.pos)+fx.start[0]+fx.unit[0];nowPosX[1]=((fx.end[1]-fx.start[1])*fx.pos)+fx.start[1]+fx.unit[1];fx.elem.style.backgroundPosition=nowPosX[0]+' '+nowPosX[1];function toArray(strg){strg=strg.replace(/left|top/g,'0px');strg=strg.replace(/right|bottom/g,'100%');strg=strg.replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");var res=strg.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/);return[parseFloat(res[1],10),res[2],parseFloat(res[3],10),res[4]];}}});})(jQuery);