/*文字サイズ
-----------------------------------------------------------------------------*/
$(document).ready(function(){
	$("#textsizer a").textresizer({
	target : "#wrap",
	type : "fontSize",
	sizes : [ "83%", "100%", "117%" ],
	selectedIndex : 1
	});
});
/*サイドバー・縦カルーセル
-----------------------------------------------------------------------------*/
$(document).ready(function(){
//	$(".sideSlideItem:even").css("background-color","#eff7f4");
	$(".sideSlide").carouFredSel({
		prev : ".sideSlidePrev",
		next : ".sideSlideNext",
		scroll : 1,//動かす数
		items : 8,//表示数
		direction : "up",
		auto : {
		pauseOnHover: true
		}
	});
});
/*言語選択
-----------------------------------------------------------------------------*/
$(document).ready(function(){
	$("#language").change(function(){
		location.href = "http://www.takushoku-u.ac.jp/" + $(this).val() + "/"
	});
});
/*Googleカスタム検索
-----------------------------------------------------------------------------*/
$(document).ready(function(){
	var str = "サイト内検索";
	$("#searchGoogle01")
		.addClass("wate rmark")
		.val(str)
		.focus(function(){
			$(this).removeClass("watermark");
			if($(this).val() === str){
				$(this).val("");
			}
		})
		.blur(function(){
			if($(this).val() === ""){
				$(this).val(str);
				$(this).addClass("watermark");
			}
		})
		.submit(function(){
			if($(this).val() === str){
				$(this).val("");
			}
		});
});
/*年取得
-----------------------------------------------------------------------------*/
$(document).ready(function(){
	var data = new Date();
	var now_year = data.getFullYear();
	$("#year").append(" " + now_year);
});
/*開閉メニュー
-----------------------------------------------------------------------------*/
$(document).ready(function(){
	$(".navPWrap .navP").hide();
	$(".navPWrap .navPArrow").click(function (e){
		var tit = $(this).closest("h2");
		var nav = $("+ul",tit);
		if ( nav.css("display") === "block") {
			nav.slideUp();
			$(this).css("background-image", "url(/common/images/icon_plus.png)");
		} else {
			nav.slideDown();
			$(this).css("background-image", "url(/common/images/icon_minus.png)");
		}
	});
});
/*ニュースタブ
-----------------------------------------------------------------------------*/
$(document).ready(function(){
	$("#newsTab li:first a").addClass("selected");
	$("#boxNews div:not(:first)").hide();
	$("#newsTab a").click(function(){
		if(!$(this).hasClass("selected")){
			$("#newsTab a.selected").removeClass("selected");
			$(this).addClass("selected");
			$("#boxNews div").hide().filter($(this).attr("href")).show();
		}
		return false;
	});
});
/*カルーセル（トップページメイン画像）
-----------------------------------------------------------------------------*/
$(document).ready(function(){
	$("#mainImage").carouFredSel({
		items : 1,
		direction : "left",
		scroll : {
			items : 1,
			//fx : "uncover",
			fx : "crossfade",
			duration : 750,
			pauseOnHover : true
		}
	});
});
/*カルーセル（ニュースヘッドライン画像）
-----------------------------------------------------------------------------*/
$(document).ready(function(){
	$('#newsCarousel').carouFredSel({
		scroll:{
			items:1
		},
		prev:'#newsCarouselPrev',
		next:'#newsCarouselNext',
		auto:true
	});
});
/*navL（'.navL .current:has(ul) a:first'の場合は濃いグレーにする）
-----------------------------------------------------------------------------*/
$(document).ready(function(){
	$('.navL .current:has(ul) a:first')
	.css('background-color', '#d9d9d9');
});
/*navL（'.navL .current:has(li.current) a:first'の場合は薄いグレーにする）
-----------------------------------------------------------------------------*/
$(document).ready(function(){
	$('.navL .current:has(li.current) a:first')
	.css('background-color', '#eaeaea')
	.hover(
		function() {
			$(this).css('background-color', '#d9d9d9');
		},
		function() {
			$(this).css('background-color', '#eaeaea');
		}
	);
});
/*p-navL（'.p-navL .current:has(ul) a:first'の場合は濃いグレーにする）
-----------------------------------------------------------------------------*/
$(document).ready(function(){
	$('.p-navL .current:has(ul) a:first')
	.css('background-color', '#d9d9d9');
});
/*p-navL（'.p-navL .current:has(li.current) a:first'の場合は薄いグレーにする）
-----------------------------------------------------------------------------*/
$(document).ready(function(){
	$('.p-navL .current:has(li.current) a:first')
	.css('background-color', '#eaeaea')
	.hover(
		function() {
			$(this).css('background-color', '#d9d9d9');
		},
		function() {
			$(this).css('background-color', '#eaeaea');
		}
	);
});
/*メールフォーム送信完了メッセージ
-----------------------------------------------------------------------------*/
if (window.location.search == '?submit=1') {
	$('#thanksMassage').css('display','block');
	$('#formLead').css('display','none');
	$('form').css('display','none');
}
/*印刷用Window
-----------------------------------------------------------------------------*/
function openWin(){
	window.open(window.location.href,"printpage");
}
if(window.name == "printpage"){
	document.writeln("<link rel='stylesheet' href='/common/css/print_display.css' type='text/css' media='all' />");
}
/*
-----------------------------------------------------------------------------*/

