
$(document).ready(function(){
	window.onresize = posiAdjust;
	
	posiAdjust();

	var works=$("header #works");
	var worksSub=$("header #works .subnavi");
	/*workSubHeight=worksSub.height();*/
	var workSubHeight=60;
	var workSubInitHeight=0;
	worksSub.height(workSubInitHeight);
	worksSub.stop().slideUp(0);
	var bodyClassArray=$("body").attr("class").split(" ");
	if($.inArray("work",bodyClassArray)>=0){
		workSubInitHeight=23;
		worksSub.height(workSubInitHeight);
		worksSub.css("display","block");
	}
	

	works.mouseenter(function(){
		if(worksSub.css('display')=="none"){
			worksSub.height(0);
			worksSub.css("display","block");
		}
		worksSub.stop().animate({height:workSubHeight},500,"easeOutQuint");
	});
	works.mouseleave(function(){
		worksSub.stop().animate({height:workSubInitHeight},500,"easeOutQuint");
	});
	works.mousedown(function(){
		worksSub.stop().animate({height:workSubHeight},500,"easeOutQuint");
	});
	
	
	$("#information #container #contents").delay(100).fadeIn(1000);
	$("#map #container #contents").delay(100).fadeIn(1000);
	
});


function posiAdjust(){
	var windowHeight=$(window).height();
	var adjustMargin=Math.floor((windowHeight-600)/2);
	if(adjustMargin<5){
		adjustMargin=5;
	}
	$("#container").css("margin-top",adjustMargin+"px");
}
