/***************************/
//@Author: Adrian "yEnS" Mato Gondelle & Ivan Guardado Castro
//@website: www.yensdesign.com
//@email: yensamg@gmail.com
//@license: Feel free to use it, but keep this credits please!					
/***************************/

$(document).ready(function(){
	$(".tabbedMenu > li").click(function(e){
		switch(e.target.id){
			case "companionProducts":
				//change status & style menu
				$("#companionProducts").addClass("active");
				$("#review").removeClass("active");
				$("#othersAlsoBought").removeClass("active");
				$("#whatsNew").removeClass("active");
				//display selected division, hide others
				$("div.companionProducts").css("display", "block");
				$("div.review").css("display", "none");
				$("div.othersAlsoBought").css("display", "none");
				$("div.whatsNew").css("display", "none");
			break;
			case "review":
				//change status & style menu
				$("#companionProducts").removeClass("active");
				$("#review").addClass("active");
				$("#othersAlsoBought").removeClass("active");
				$("#whatsNew").removeClass("active");
				//display selected division, hide others
				$("div.review").css("display", "block");
				$("div.companionProducts").css("display", "none");
				$("div.othersAlsoBought").css("display", "none");
				$("div.whatsNew").css("display", "none");
			break;
			case "othersAlsoBought":
				//change status & style menu
				$("#companionProducts").removeClass("active");
				$("#review").removeClass("active");
				$("#othersAlsoBought").addClass("active");
				$("#whatsNew").removeClass("active");
				//display selected division, hide others
				$("div.othersAlsoBought").css("display", "block");
				$("div.companionProducts").css("display", "none");
				$("div.review").css("display", "none");
				$("div.whatsNew").css("display", "none");
			break;
			case "whatsNew":
				//change status & style menu
				$("#companionProducts").removeClass("active");
				$("#review").removeClass("active");
				$("#othersAlsoBought").removeClass("active");
				$("#whatsNew").addClass("active");
				//display selected division, hide others
				$("div.whatsNew").css("display", "block");
				$("div.companionProducts").css("display", "none");
				$("div.review").css("display", "none");
				$("div.othersAlsoBought").css("display", "none");
			break;
		}
		//alert(e.target.id);
		return false;
	});
});
