﻿//Navi Effect
$.fn.Effect = function(moveHeight){
		
		$(this).each(function(){
				var setHeight = $(this).height();
				$(this).hover(function(){
						$(this).stop(true, true).animate({height: setHeight+moveHeight} , 500 , "swing");
					},function(){
						$(this).stop(true, true).animate({height: setHeight} , 500 , "swing");
					});
			});
return this;
}

//Sey Height
$.fn.setHeight = function(minHeight){
		var height = $(this).height();
		var childHeight = $(this).find("p").height();
	//親要素のminheightを指定
		if(height < minHeight){
			set = minHeight;
		}else{
			set = height;
		}
		$(this).css("height",set);
		
	//子要素を真ん中に表示
		if(childHeight < set){
			setchild = (set-childHeight)/2;
			
			$(this).find("p").css("position","relative").css("top",setchild);
		}
return this;
}

$(function(){
	//背景フェード
	$("#bkphoto img:first").fadeIn(1000,
		function() {
			$('#bkphoto').cycle({
			// FADE INI
				fx: "fade",
				speedIn: 3000,
				speedOut: 2000,
				timeout: 1000,
				autostop:true
			});
		}
	);
	//メニューエフェクト、その他CSS設定
	$("#glmenu a").Effect(64);
	$("#glmenu a").css("opacity","0.8")
	$("#boxupdate ul").css("opacity","0.8")
	$("#boxupdate div").setHeight("48");
	
});
