jQuery(function( $ ){
	/**
	 * Most jQuery.localScroll's settings, actually belong to jQuery.ScrollTo, check it's demo for an example of each option.
	 * @see http://flesler.demos.com/jquery/scrollTo/
	 * You can use EVERY single setting of jQuery.ScrollTo, in the settings hash you send to jQuery.LocalScroll.
	 */
	
	/**
	 * Restart the scroll position to ( 0, 0 ) (Firefox doesn't reset it)
	 * could use $(target).scrollTo( 0, {axis:'xy'));
	 * but this needs to be quick(synchronous), to reset before $.localScroll.hash() begins
	 */
//	$('#tabbed_area').attr({scrollTop:0,scrollLeft:0});
	$('#tabbed_area').attr({scrollTop:0});
	
	// Scroll initially if there's a hash (#something) in the url 
//	$.localScroll.hash({
//		target: '#content', //could be a selector or a jQuery object too.
//		axis:'xy',//the default is 'y'
//		queue:false,
//		duration:1500
//	});
	
	var $last = $([]);//save the last link
	
	/**
	 * NOTE: I use $.localScroll instead of $('#navigation').localScroll() so I
	 * also affect the >> and << links. I want every link in the page to scroll.
	 */
	$.localScroll({
		target: '#tabbed_area', //could be a selector or a jQuery object too.
		axis:'xy', //the default is 'y'
		queue:false,
		duration:550,
		hash:false,
		onBefore:function( e, anchor, $target ){//'this' is the clicked link
			$last.removeClass('scrolling');
			$last = $(this).addClass('scrolling');
			if( this.blur )
				this.blur();//remove the awful outline
		},
		onAfter:function( anchor ){
			$last.removeClass('scrolling');
		}
	});
});

$( document ).ready(
		function()
		{
			// When a link is clicked
			$("a.side-tab").click(
					function () 
					{
						// switch all tabs off
						$("a.side-tab.active").removeClass("active");
						$("li.side-tab.active").removeClass("active");

						// switch this tab on
						$('#li_' + this.id.replace('link_side_', '' ) ).addClass('active');
						$('#link_side_' + this.id.replace('link_side_', '' ) ).addClass('active');						
					});

			$(".content-edit-area").mouseover(
				function()
				{
					$(this).css('border','2px dashed #ff0000');
					$(this).css('width','672px');
					$(this).css('height','411px');
					//$(this).css({opacity: .5 });								
				}
			);

			$(".content-edit-area").mouseout(
				function()
				{
					$(this).css('border','none');
					$(this).css('width','678px');
					$(this).css('height','415px');
					//$(this).css({opacity: 1 });								
				}
			);
			
		}
);