$(document).ready(function(){ 
	//var pos = $('#scroll').css('left').substr(1,($('#scroll').css('left').length-3));
	var pos = 535;
	
	var scroll = $("#pf_index_holder .work").width() + 10;
	var work_num = 	$("#scroll .work").length;
	var scrolled = $('#scroll');
	
	var total_width = work_num * scroll;
	//scrolled.css({'width':total_width});
	//$("#pf_index").css({'width':'auto'});

	
		$('#pf_rarr a').click(function() {
			if ($('#scroll:animated').length == 0)
			{
				$('#scroll div:eq(0)').appendTo('#scroll');
				$('#scroll div:eq(0)').appendTo('#scroll');
				scrolled.css({'left':'0px'}).animate({'left':'-'+ pos +'px'}, 500);
			}
			return false;
		});

		$('#pf_larr a').click(function() {
			if ($('#scroll:animated').length == 0)
			{
				$('#scroll div:eq('+(work_num-1)+')').prependTo('#scroll');
				$('#scroll div:eq('+(work_num-1)+')').prependTo('#scroll');
				scrolled.css({'left':- (pos + 2*scroll - 25)+'px'}).animate({'left':'-'+pos +'px'},500);
			}
			return false;
		});

	/*	
	function pf_resize() {
		var root=$("#root").width()-62;
		$("#pf_index_holder").css({'width':root});
	}
	
	$(window).resize(function() {
		pf_resize();
	});	

	$(window).load(function(){
		pf_resize();
	});
		*/
}); 


	
	
	


