var x = 0;var curPage = 0;  var thumbWidth = 	162;  var thumbsVis = 3;$(document).ready(function() {    $(".sub").hide();  $("#main-mask").addClass("js");  //Get OS  var os = navigator.platform;  if(os.toLowerCase().search("mac") > -1) {    $("body").addClass("mac");  }		var numThumbs = $("#products-scroll img").length;		$("#next").click(function() { 		updateOffset(1,numThumbs);		$("#products-scroll").animate({ left: x }, 1000, "expoinout");			return false;	});	$("#prev").click(function() { 		updateOffset(0,numThumbs);		$("#products-scroll").animate({ left: x }, 1000, "expoinout");		return false;	});		});function updateOffset(next,thumbs) {	if(next == 1) {		if (x == (0 - ((thumbs - thumbsVis) * thumbWidth))) {			x = 0;		} else {			x = x - (thumbWidth*thumbsVis);		}	}	if(x <= 0 && next != 1) {		if (x == 0) {			x = (0 - ((thumbs - thumbsVis) * thumbWidth));		} else {			x = x + (thumbWidth*thumbsVis);		}	}	}