$(function(){
	/*add .last-child*/
	$("li:last-child,#footer-nav ul:last-child").addClass("lastchild");
	
	/*add .even*/
	$('table tr:even').addClass('even');
	
	//ボタンのホバーアニメーション
	$(".btn").hover(
		function(){
			$(this).animate({opacity:0.5},"fast",function(){
				$(this).animate({opacity:1},"fast");	
			});
		},
		function(){}
	);
	
	//要素の高さをそろえる
	changeHeight("#footer-nav>ul");
	
	//スムーズスクロール(#,#flow)
	jQuery.easing.quart = function (x, t, b, c, d) {
		return -c * ((t=t/d-1)*t*t*t - 1) + b;
	}; 
	$("a").click(function() {
		if($(this).attr('href').indexOf('#') != -1){
			var $target = jQuery(this.hash);
			$target = $target.length && $target || jQuery("[name=" + this.hash.slice(1) +"]");
			if($(this).attr("href")=="#"){
				var targetOff = 0;	
			}else{
				var targetOff = $($(this).attr("href")).offset().top;
			}
			$("html,body").animate({scrollTop:targetOff},300,"quart");
			return false;
		}
	});
	
	//footerのロゴ縦位置
	$('#footer-logo').css('marginTop',Math.floor(($('#footer-nav').height()-$('#footer-logo').height())/2));
	
});

function changeHeight(targetArray){
	var objHeight = 0;
	$(targetArray).each(function(){
		if($(this).height() >= objHeight){
			objHeight = $(this).height();
		}
	});
	$(targetArray).css("height",objHeight);
}

