jQuery(function($) {

	/* intro */
	var objImg = $("#fresh-revolution");
	var objFlash = $("div.choose-side ul li.flash a.flash");
	var objHtml = $("div.choose-side ul li.html a.html");
	
	objFlash
		.mouseover(function() {
			objImg.hide().fadeIn("fast").attr("src","/images/fresh_revolution_flash.jpg");
		})
		.mouseout(function(){
			objImg.hide().fadeIn("fast").attr("src","/images/fresh_revolution.jpg");
		});
	objHtml
		.mouseover(function() {
			objImg.hide().fadeIn("fast").attr("src","/images/fresh_revolution_html.jpg");
		})
		.mouseout(function(){
			objImg.hide().fadeIn("fast").attr("src","/images/fresh_revolution.jpg");
		});
	
	/* collection */
	var productList = $("div.collection ul.product li a");
	var btnClose = $("span.close");
	var productDetail = $("div.product-detail");
	var layerId = "";
	
	productList.click(function() {
		$(this).parent().find("div.product-detail").show();
		layerId = $(this).attr("href").replace("#","");
		return false;
    });
	btnClose.click(function() {
		$(this).parent("div.product-detail").hide();
    });

	var detailTab = $("div.detail-image ul li span img");
	var detailImg = $("div.detail-image p img");
	var currentImg = "";
	detailTab
		.click(function() {
			currentImg = $(this).parent().parent().parent().parent().find("p img");
			currentImg.attr({ 
				src: "/images/product/b_" + layerId + "_0" + $(this).attr('alt') + ".jpg"
			});
			$(this).parent().parent().parent().find("li span img").each(function() {
				$(this).attr("src",$(this).attr("src").replace("_on.gif", "_off.gif"));
			});
			$(this).attr("src",$(this).attr("src").replace("_off.gif", "_on.gif"));
		});

	$("div.about h4:odd").css("color", "#ae60a9");
	$("div.operation h4:odd").css("color", "#ae60a9");

	/* navigation sub */
	//$("#head ul li:first-child ul.sub-menu").css("left","14px");
	
});
