// from http://css-tricks.com/filtering-blocks/
$(function(){

	var VISITOR_TYPE_NM = "VISITOR_TYPE_NM";
	var options = { path: "/", expires: 200 };
	
	var visitor_type =($.cookie(VISITOR_TYPE_NM));
	
	if (visitor_type == "pro") {
		
		$("#tabs a").removeClass("active");
		$("#pro").addClass("active");
		$(".couple").hide();
		$(".pro").show();
		
	} else if (visitor_type == "couple") {
		
		$("#tabs a").removeClass("active");
		$("#couple").addClass("active");
		$(".pro").hide();
		$(".couple").show();
		
	};

	$("#tabs a").click(function(){
		
		var thisId = $(this).attr("id");
		
		if (thisId == "all") {
		
			$(".product").slideDown(2000);
		
		} else {
			
			$(".product").slideUp(1000);
			$("."+ thisId).slideDown(2000);
		
		}

		$("#tabs a").removeClass("active");
		$(this).addClass("active");
		
		$.cookie(VISITOR_TYPE_NM, thisId, options);
		
	});

});