
// mouseover

$(document).ready(function () {
	$("#header li, #cart, #pagetop, .category li, .PagenavArea li").live('mouseover mouseout', function (event) {
		
		if (event.type == "mouseover") {
			$("img", this).stop().fadeTo(160, 0.6);
		} else {
			$("img", this).stop().fadeTo(160, 1);	
		}
	});
	
	$("#footer li a").live('mouseover mouseout', function (event) {
		
		if (event.type == "mouseover") {
			$(this).stop().animate({paddingLeft: "5px"}, {queue: false, duration: 100});
		} else {
			$(this).stop().animate({paddingLeft: "0"}, {queue: false, duration: 100});
		}
	});
	
	$("#footer .address li a").live('mouseover mouseout', function (event) {
		$(this).stop();
	});
	
	// sidenav
	$("#sidenav li a").each( function() {
		var url = document.URL.split("#");
		if ( this == url[0] || this + "index.html" == url[0]) {
			$(this).parent().addClass("current");
		}
	});
	
	// other style
	$("div#footernav ul:nth-child(4)").addClass("shop");
	$("ul#topicpath li:nth-child(1)").addClass("home");
	$("div#contents table tr:last-child").addClass("no");
	$("ul#sidenav li:last-child").addClass("last");
	$("div.ItemArea dl dd:nth-child(3)").addClass("price");
	$("div.PagenavArea li:nth-child(1)").addClass("active");
	$("div.DetailArea ul.photo li:nth-child(2)").addClass("second");
	$("div.CommentArea dl dd:last-child").addClass("day");
	$("div#contents table tr:nth-child(2n)").addClass("bgcolor");
	$("div.subtext table tr:first-child").addClass("head");
	$("div#contents table tr:nth-child(1) td:nth-child(1)").addClass("width");
	$("div#contents table:last-child").addClass("last");
	
	// ItemArea height
	var height = $('.ItemArea dl').autoHeight({height:'height'},{column:5});
	
	// footer height
	var height = $('#footernav ul').autoHeight({height:'height'},{column:3});

});
