$(document).ready(function(){

	//footer置底
	if($(document).height() < $(window).height()){
		x = $(window).height() - $(document).height();
		y = $("#content").height();
		$("#content").height(y + x);
	}
	
	//選單換圖效果
	//參考來源：Mika Tuupola - http://www.appelsiini.net/2007/6/sequentially-preloading-images
    $("img.current").each(function() {
		s = $(this).attr("src").replace(/\.(gif)$/i, "_c.$1");
        $(this).attr("src", s);
	});
    $("img.hover").hover(function() {
        s = $(this).attr("src").replace(/\.(gif)$/i, "_h.$1");
        $(this).attr("src", s);
    }, function() {
        s = $(this).attr("src").replace(/_h\.(gif)$/i, ".$1");
        $(this).attr("src", s);
    });
		
	//news列表滑鼠移過效果
	$("#nlist div").hover(
		function () {
			$(this).addClass("hover");
		},
		function () {
			$(this).removeClass("hover");
		}
	);
});