// Minified custom easing plugin (used with lavalamp and carousel
jQuery.easing['jswing']=jQuery.easing['swing'];jQuery.extend(jQuery.easing,{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;}});

// Lavalamp Menu Action Stuff (Minified plugin and activation code)
(function($){$.fn.lavaLamp=function(o){o=$.extend({fx:"easeInOutExpo",speed:500,click:function(){}},o||{});return this.each(function(){var me=$(this),noop=function(){},$back=$('<li class="back"><div class="left"></div></li>').appendTo(me),$li=$("li",this),curr=$("li.current_page_item",this)[0]||$($li[0]).addClass("current_page_item")[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(el){$back.css({"left":el.offsetLeft+"px","width":el.offsetWidth+"px"});curr=el;};function move(el){$back.each(function(){$(this).dequeue();}).animate({width:el.offsetWidth,left:el.offsetLeft},o.speed,o.fx);};});};})(jQuery);

$j(document).ready(function(){
	// To make sure the right page is selected when viewing a post
	var url_array = window.location.pathname;
	url_array = url_array.split('/');
	if (url_array[1] == 'posts') { // If looking at a single post
		$j('ul#main_nav:first-child ').removeClass('current_page_item');
		if (url_array[2] == 'featured-designs' || url_array[2] == 'projects') { // checking category
			// Making portfolio the current page
			$j('li.page-item-18').addClass('current_page_item');
		} else {
			// Making blog the current page
			$j('li.page-item-23').addClass('current_page_item');
		}
	}
	
	if (url_array[1] == 'category' && url_array[2] == 'projects') {
		// Making portfolio the current page
		$j('li.page-item-18').addClass('current_page_item');
	}
	
	// Deactivating no script styles for border underline
	$j('ul#main_nav li a:hover, ul#main_nav li a:focus, ul#main_nav li a:active').css('border-bottom','none');
	
	// activating lavalamp menu
	$j("ul#main_nav").lavaLamp({
		fx:'easeInOutExpo',
		speed: 400,
	})
});