
$(function(){
	///// List Box
	$(".stayNv li:nth-child(2)").css("margin-right", "0");
	$(".stayNv li:nth-child(4)").css("margin-right", "0");
	$(".stayNv li:nth-child(8)").css("margin-right", "0");
	$(".stayNv li:nth-child(5)").css("margin-right", "9px");
	$(".stayNv li:nth-child(7)").css("margin-right", "9px");
	$(".thmbPhoto li:nth-child(6n)").css("margin-right", "0");

	var styLocalH = $('.styLocal dd').height();
	$(".styLocal dt").css("height", (styLocalH) + "px");
	
	var sdnvHeight = $('.sdnvBgBottom').height();
	var sideY = sdnvHeight + 20;
	var sideH = $('.sidePosY').height();
	var mainH = $('.mainColumn').height();
	var sideContentsH = sideY + sideH;
	
	var sideNaviH = $('.sdnvBgBottom').height();
	
	var debagTxt;
	
	if (sideNaviH != 0)
	{
		$('.sidePosY').css("top", (sideY) + "px");
	}
		
	if (sideContentsH >= mainH)
	{
		$('.mainColumn').css("height", (sideContentsH) + "px");
		//debagTxt = "Base to side";
	}
	else
	{
		//debagTxt = "main:" + mainH + " / side:" + sideH;
		//debagTxt = sideNaviH;
	}
	//$("#debag").text(debagTxt);
	
	///// Gallery
	function hidePhoto()
	{
		$(".mainPhoto #ph01").css("display", "none");
		$(".mainPhoto #ph02").css("display", "none");
		$(".mainPhoto #ph03").css("display", "none");
		$(".mainPhoto #ph04").css("display", "none");
		$(".mainPhoto #ph05").css("display", "none");
		$(".mainPhoto #ph06").css("display", "none");
		$(".mainPhoto #ph07").css("display", "none");
		$(".mainPhoto #ph08").css("display", "none");
		$(".mainPhoto #ph09").css("display", "none");
		$(".mainPhoto #ph10").css("display", "none");
		$(".mainPhoto #ph11").css("display", "none");
		$(".mainPhoto #ph12").css("display", "none");
	}
	
	$(".thmbPhoto #ph01").hover(gllHover, gllOut);
	$(".thmbPhoto #ph02").hover(gllHover, gllOut);
	$(".thmbPhoto #ph03").hover(gllHover, gllOut);
	$(".thmbPhoto #ph04").hover(gllHover, gllOut);
	$(".thmbPhoto #ph05").hover(gllHover, gllOut);
	$(".thmbPhoto #ph06").hover(gllHover, gllOut);
	$(".thmbPhoto #ph07").hover(gllHover, gllOut);
	$(".thmbPhoto #ph08").hover(gllHover, gllOut);
	$(".thmbPhoto #ph09").hover(gllHover, gllOut);
	$(".thmbPhoto #ph10").hover(gllHover, gllOut);
	$(".thmbPhoto #ph11").hover(gllHover, gllOut);
	$(".thmbPhoto #ph12").hover(gllHover, gllOut);
	function gllHover()
	{
		$(this).fadeTo(500,0.3);
	}
	function gllOut()
	{
		$(this).fadeTo(500,1);
	}
	
	$(".thmbPhoto #ph01 a").click(function(){
		hidePhoto();
		$(".mainPhoto #ph01").fadeIn("slow");
	});
	$(".thmbPhoto #ph02 a").click(function(){
		hidePhoto();
		$(".mainPhoto #ph02").fadeIn("slow");
	});
	$(".thmbPhoto #ph03 a").click(function(){
		hidePhoto();
		$(".mainPhoto #ph03").fadeIn("slow");
	});
	$(".thmbPhoto #ph04 a").click(function(){
		hidePhoto();
		$(".mainPhoto #ph04").fadeIn("slow");
	});
	$(".thmbPhoto #ph05 a").click(function(){
		hidePhoto();
		$(".mainPhoto #ph05").fadeIn("slow");
	});
	$(".thmbPhoto #ph06 a").click(function(){
		hidePhoto();
		$(".mainPhoto #ph06").fadeIn("slow");
	});
	$(".thmbPhoto #ph07 a").click(function(){
		hidePhoto();
		$(".mainPhoto #ph07").fadeIn("slow");
	});
	$(".thmbPhoto #ph08 a").click(function(){
		hidePhoto();
		$(".mainPhoto #ph08").fadeIn("slow");
	});
	$(".thmbPhoto #ph09 a").click(function(){
		hidePhoto();
		$(".mainPhoto #ph09").fadeIn("slow");
	});
	$(".thmbPhoto #ph10 a").click(function(){
		hidePhoto();
		$(".mainPhoto #ph10").fadeIn("slow");
	});
	$(".thmbPhoto #ph11 a").click(function(){
		hidePhoto();
		$(".mainPhoto #ph11").fadeIn("slow");
	});
	$(".thmbPhoto #ph12 a").click(function(){
		hidePhoto();
		$(".mainPhoto #ph12").fadeIn("slow");
	});
	
	///// Topics Scroller
	//$("ul#ticker01").liScroll({travelocity: 0.04});
	
	///// Top Contents
	$("#top01").hover(hoverClass, outClass);
	$("#top02").hover(hoverClass, outClass);
	$("#top03").hover(hoverClass, outClass);
	$("#top04").hover(hoverClass, outClass);
	//$("#gll01").hover(hoverClass, outClass);
	//$("#gll02").hover(hoverClass, outClass);
	//$("#gll03").hover(hoverClass, outClass);
	//$("#gll04").hover(hoverClass, outClass);
	function hoverClass()
	{
		$(this).css("background-color", "#E8E3D7");
	}
	function outClass()
	{
		$(this).css("background", "none");
	}
});

