$(function() {	
	var current 	= 1;

	var stepsWidth	= 0;
    var widths 		= new Array();
	$('#tabContainer .tab_content').each(function(i){
        var $step 		= $(this);
		widths[i]  		= stepsWidth;
        stepsWidth	 	+= $step.width();
    });
	$('#tabContainer').width(stepsWidth);	
	
	$('#tabs').show();

    $('#tabs a').bind('click',function(e){
		var $this	= $(this);
		var prev	= current;
		$this.closest('ul').find('li').removeClass('selected');
        $this.parent().addClass('selected');

		current = $this.parent().index() + 1;

        $('#tabContainer').stop().animate({
            marginLeft: '-' + widths[current-1] + 'px'
        },500);
        e.preventDefault();
    });
});
