// Easing equation, borrowed from jQuery easing plugin
// http://gsgd.co.uk/sandbox/jquery/easing/
jQuery.easing.easeOutQuart = function (x, t, b, c, d) {
	return -c * ((t=t/d-1)*t*t*t - 1) + b;
};

jQuery(function( $ ){
	$('#portfolio_cont').serialScroll({
		target:'#portfolio_main',
		items:'li',
		axis:'x',
		navigation:'#portfolio_top li a',
		duration:700,
		force:true,
		constant:false, // constant speed
		
		onBefore:function( e, elem, $pane, $items, pos ){
			e.preventDefault();
			if( this.blur )
				this.blur();
		},
		onAfter:function( elem ){
		}
	});
	$('#portfolio_nav').serialScroll({
		target:'#portfolio_top',
		items:'li',
		prev:'img.prev',
		next:'img.next',
		axis:'x',
		duration:1000,
		force:true,
		step:5,
		
		onBefore:function( e, elem, $pane, $items, pos ){
			e.preventDefault();
			if( this.blur )
				this.blur();
		},
		onAfter:function( elem ){
		}
	});
});


// Portfolio Thumb Hovers
//
function porthover() {
	$("li.portp").hover(
      function () {
		$(this).css({'background-position':'0px 0px','border':'3px solid #555'});
        $(this).animate({marginTop:"16px"},500);
	}, 
      function () {
		$(this).css({'background-position':'0px -48px','border':'3px solid #888'});
        $(this).animate({marginTop:"5px"},200);
      }
    );
}

function portclick() {
	$("li.portp").click(
      function () {
        $("li.portp").css("border","3px solid #888").removeClass("selected");
		$(this).animate( { marginTop:"5px" }, 200);
		$(this).css({'background-position':'0px 0px','border':'3px solid #ddd'});
		$(this).addClass("selected");
      }
    );
}

function setfirstport() {
	$("#p_pga").addClass("selected");
}
