$().ready(function(){
var page = 0;
var items_per_page = 5;
var total = $("#side_scroller>div").length;
var animation = false;

	$("#side_scroller>div").hide();
	
	$.each($("#side_scroller>div"),function(key,value){
		if(key>=page*items_per_page && key<page*items_per_page+items_per_page ){
			$(this).show();
		}
	});
	

	$("#arrow_left").bind("click",function(){
	this.blur();
	if (animation) return false;
	
		if (page==0) {
			page = Math.round(total/items_per_page)-1;
		} else {
			page--;
		}
		
		$("#side_scroller>div:visible").hide(200);
		animation = true;
		
		$("#arrow_left").addClass("arrow_left_disabled");

		$.each($("#side_scroller>div"),function(key,value){
			if(key>=page*items_per_page && key<page*items_per_page+items_per_page ){
				$(this).show(500,function(){
					animation = false;

				});
			}
		});
	});

	
	$("#arrow_right").bind("click",function(){
	this.blur();
	if (animation) return false;
	
		if ((page+1)*items_per_page >= total) {
			page = 0;
		} else {
			page++;
		}
		
		$("#side_scroller>div:visible").hide(200);
		animation = true;
		$("#arrow_right").addClass("arrow_right_disabled");

		$.each($("#side_scroller>div"),function(key,value){
			if(key>=page*items_per_page && key<page*items_per_page+items_per_page ){
				$(this).show(500,function(){
					animation = false;

				});
			}
		});
	});


});
