function scroll_left(numPages, action) {
	if(typeof numPages == 'undefined') {
		numPages = 1;
	}
	if(typeof action == 'undefined') {
		action = "view";
	}
	if(typeof scroller_page == 'undefined') {
		scroller_page = parseInt(jQuery('#curSliderPage').html());
	}
	if(typeof category_id == 'undefined') {
		category_id = parseInt(jQuery('#curSliderCategory').html());
	}
	if(scroller_page > 1) {
		scroller_page = scroller_page - numPages;
	}
	
	var content = jQuery(".products_scroller_content");
	content.toggle("slide", { direction: "right" }, 1000, function() {
			content.html('<div style="padding:0px 0px 0px 267px;height:109px;"><div style="position: relative; top: 40%;"><img src="/skin/frontend/clickmix/default/images/opc-ajax-loader.gif" />&nbsp;Loading...</div></div>');
		content.show(1, function() {
			jQuery.get('/scrollers/products/'+action+'/category_id/' + category_id + '/p/' + scroller_page +'/', function(data) {
				jQuery(".products_scroller_content").hide(1, function() {
					jQuery(".products_scroller_content").html(data);
					content.toggle("slide", { direction: "left" }, 1000);
				});
			});		
		});
	});
}

function scroll_right(numPages, action) {
	if(typeof numPages == 'undefined') {
		numPages = 1;
	}
	if(typeof action == 'undefined') {
		action = "view";
	}
	if(typeof scroller_page == 'undefined') {
		scroller_page = parseInt(jQuery('#curSliderPage').html());
	}
	if(typeof category_id == 'undefined') {
		category_id = parseInt(jQuery('#curSliderCategory').html());
	}
	scroller_page = scroller_page + numPages;
	var content = jQuery(".products_scroller_content");
	content.toggle("slide", { direction: "left" }, 1000, function() {
		content.html('<div style="padding:00px 0px 0px 267px;height:109px; vertical-align: middle;"><div style="position: relative; top: 40%;"><img src="/skin/frontend/clickmix/default/images/opc-ajax-loader.gif" />&nbsp;Loading...</div></div>');
		content.show(1, function() {
			jQuery.get('/scrollers/products/'+action+'/category_id/' + category_id + '/p/' + scroller_page + '/', function(data) {
				jQuery(".products_scroller_content").hide(1, function() {
					jQuery(".products_scroller_content").html(data);
					content.toggle("slide", { direction: "right" }, 1000);
				});
			});
		});
	});
}

function setCategory(val, ref)
{
	category_id = val;
	scroller_page = 0;
	scroll_right();
	jQuery('.selected_tab').removeClass('selected_tab');
	jQuery(ref).parent().addClass('selected_tab');
	
	return false;
}

