

function showProductCategories() {
	$("#navigation .category").toggleClass("on");	
}



function displayProduct(id, asset) {
		// main image
		$("#product-image").attr("src", asset);
		// thumbnail
		$(".product-thumbnail span").removeClass("active");
		var tid = "#product-thumbnail-" + id;
		$(tid).addClass("active");
		// info
		$("#product-info div").removeClass("active");
		var iid = "#product-info-" + id;
		$(iid).addClass("active");
}

function rotateUpdates() {
	
	var current = $("#updates .update:visible");
	var next = current.next();
	
//	if (current == null || current.length == 0) {
//		next.fadeIn(750, function() {
//	    window.setTimeout(rotateUpdates, 5000);
//	  });
//	} else {
	
		if (next == null || next.length == 0) {
			next = $("#updates .update:first");
		}
		
		$("#updates .update:visible").fadeOut(750, function() {
			
		});
		
		$("#updates .update").hide();
		next.fadeIn(750, function() {
	    window.setTimeout(rotateUpdates, 5000);
	  });
		
//	}
	
	
	
}

$(document).ready(function () {
    $("span.product-thumbnail").mouseover(function(e) {
    	$(e.target).toggleClass("hover");    	
    }).mouseout(function(e) {
    	$(e.target).toggleClass("hover");
    });
    
    rotateUpdates();
    
    
});
