// JavaScript Document
$(function(){
	
	//Common
	//--------------------------------
	//snavスタイル調整
	$("ul#snav > li").css("width","260px")
					.css("border-bottom","1px solid #E4E2F0")
					.css("padding","2px 0");

	$("ul#snav li.current").each(function(){
		$(this).has("dl").css("border-bottom","none")
				.css("padding-bottom","0");
		$(this).has("ul").css("border-bottom","none")
				.css("padding-bottom","0");
	});
	$("ul#snav li > a").css("padding","0 0 0 10px");
	$("ul#snav li.current > a").css("background-color","#EDEAFD")
							.css("background-position","-260px center")
							.css("color","#4E3A88")
							.css("font-weight","bold");
							
	$("ul#snav li dl dt").css("padding","2px 0 2px 28px");
	$("ul#snav li dl dt").has("a").css("padding","2px 0");
	
	/* sub navigation */
	$("ul#snav .tree>a").click(function(){
		if($(this).next().hasClass("open")){
			$(this).next().removeClass("open");
			
			$(this).parent().css("border-bottom","1px solid #E4E2F0").css("padding-bottom","2px");
		}else{
			$(this).next().addClass("open");
			$(this).parent().css("border-bottom","none").css("padding-bottom","0");
		}
	});
//	function showList(target){
//		$(target).next().hide();
//		$(target).parent().css("border-bottom","1px solid #E4E2F0").css("padding-bottom","2px");
//	}
//	function hideList(target){
//		$(target).next().show();
//		$(target).parent().css("border-bottom","none").css("padding-bottom","0");
//	}
	$(".insection h4:first-child").css("margin-top","0");
	$(".insection .voiceArea:first-child").css("padding","0 0 10px 0");
	
	
	/* sitemap */
	$("ul.snav > li").css("width","190px")
					.css("border-bottom","1px solid #E4E2F0")
					.css("padding","2px 0");

	$("ul.snav li > a").css("padding","0 0 0 5px");
	$("ul.snav .tree > a").css("background","none");
							
	$("ul.snav li dl dt").css("padding","2px 0 2px 20px");
	$("ul.snav li dl dt").has("a").css("padding","2px 0");
	
	
	
	//Guidance
	//--------------------------------
	$("ul#facilitieslist li:odd").css("float","right");
	
	$("ul#profilelist li:last-child").css("border","none");
	$("dl#aboutlist dd:last-child").css("border","none");
	
	$("ul.dormpht1 li:odd").css("float","right");
	$("ul.dormpht2 li:nth-child(3n)").css("padding","20px 0 0 0");
	
	
	$("ul.phtlist1 li:odd").css("padding","0");
	
	//Business
	//--------------------------------
	//Business:businessIndex
	$("ul#businessIndex li:odd").css("float","right");
	$(".sabetsu:last").css("border","none")
						.css("margin","0")
						.css("padding","0");
	$("ul.phtlist li:odd").css("float","right");
	
	$(".voiceArea .voicebox:nth-child(2n)").css("float","right");
	
	//学科一覧：○○の声プロフィール高さ調整
	//if($(".voicebox .profile1")){$('.voicebox .profile1').flatHeights()};
	//if($(".voicebox .profile2")){$('.voicebox .profile2').flatHeights()};
	//if($(".voicebox .profile3")){$('.voicebox .profile3').flatHeights()};
	//if($(".voicebox .profile4")){$('.voicebox .profile4').flatHeights()};
	
	$(".ttl").show()
	//$("ul#businessIndex li").not(".imglink").find("a").fadeTo("fast",0);
	$("ul#businessIndex li a").each(function(){
		if($(this).parent().hasClass("imglink")){
			var opec = 1;
		}else{
			var opec = 0;
		}
		$(this).fadeTo("fast",opec).hover(function(){
			$(this).fadeTo("fast",0.5)
		},function(){
			$(this).fadeTo("fast",opec);
		});
	});
	
	//Business:links
	$("ul#links li:nth-child(3n)").css("width","190px");
	$("ul#links li:nth-child(3n) .linkbox").css("margin","0");
	
	$("ul#links li a").fadeTo("fast",0)
	$("ul#links li a").hover(
	function(){
        $(this).fadeTo("fast",0.5);
    },
    function(){
        $(this).fadeTo("fast",0);
    });
	
	$(".month .img ul li:odd").css("width","198px");
	
	
	//Career
	//--------------------------------
	//Career:careerIndex
	$("ul#careerIndex li:odd").css("float","right");
	
	$("ul#careerIndex li a").fadeTo("fast",0);
	$(".ttl").show()
	$("ul#careerIndex li a").hover(
	function(){
        $(this).fadeTo("fast",0.5)
    },
    function(){
        $(this).fadeTo("fast",0);
    });
	
	
	//Career:Voice
	$(".secVoice .insection:last-child").removeClass("line");
	
	
	//Career:courseDescription
	$('dl.courseDescription dt:first-child').css('border','none');
	$('dl.courseDescription dt:first-child').css('padding-top','0');
	$('dl.courseDescription dt:first-child+dd').css('border','none');
	$('dl.courseDescription dt:first-child+dd').css('padding-top','0');
	
	
	//Jpn
	//--------------------------------
	//Jpn:jpnIndex	
	$("ul#jpnIndex li a").fadeTo("fast",0);
	$(".ttl").show()
	$("ul#jpnIndex li a").hover(
	function(){
        $(this).fadeTo("fast",0.5)
    },
    function(){
        $(this).fadeTo("fast",0);
    });
	
	
	//TOPICS
	//--------------------------------
	$("ul.topicslist li:nth-child(4n)").css("padding","0 0 13px 0");
	
	
	
	//TOPICS
	//--------------------------------
	$("#sitemap .sitebox:nth-child(3)").css("margin","0");
});

