
// 印刷用ページ

function print (css) {
	var strUrl;
	if(!css){ css = "";}
	if (window.location.search == "") {
		strUrl=window.location.href+"?print=true&css="+css;
	} else {
		strUrl=window.location.href+"&print=true&css="+css;
	}
	window.open(strUrl,'print','toolbar=yes,location=no,directories=no,personalbar=yes,status=no,menubar=yes,scrollbars=yes,titlebar=yes,resizable=yes,width=757');
}
function print2 (css) {
	alert('このページの印刷では、ブラウザの印刷ボタンを押して下さい');
	return;
}
var myUrl = window.location.href;
if(myUrl.match("print")) {
	var arr = myUrl.split("css=");
	if(arr[1]) {
		document.write('<link rel="stylesheet" type="text/css" media="all" href="' + arr[1] + '" rel="stylesheet" />');
	} else {
		document.write('<link rel="stylesheet" type="text/css" media="all" href="http://www.reihoku-kumamoto.jp/css/print/print.css" rel="stylesheet" />');
	}
}
function disablehref(){
	if(window.location.href.match("print")) {
		var input = document.getElementsByTagName("a");
		var count = input.length;
		for(var i =0; i < count; i++){
			document.getElementsByTagName("a")[i].removeAttribute("href");
		}
	}
}

// メニュー下部変更
$(document).ready(function(){
	
	$("#menu li").hover(
		function () {
			$("#top_img > div").hide();
			$("#top_img > div").eq($("#menu li").index(this)+1).show();
		},
		function () {
			$("#top_img > div").hide();
			$("#top_img > div:first").show();
		}
	);
});

// おしらせタブ
$(document).ready(function(){
	
		$("#oshirase_kinkyu_off #oshirase_menu > ul > li:first , #oshirase_kinkyu_on #oshirase_menu > ul > li:last").addClass("on");
		
		$("#oshirase_menu > ul > li").not("#oshirase_kinkyu_off #oshirase5").hover(function(){
			$(this).addClass("over").css("cursor","pointer");
		},function(){
			$(this).removeClass("over").css("cursor","default");
		});
		
		$("#oshirase_matter > ul").hide();
		$("#oshirase_kinkyu_off #oshirase_matter > ul:first").show();
		$("#oshirase_kinkyu_on #oshirase_matter > ul:last").show();
	
	$("#oshirase_menu > ul > li").not("#oshirase_kinkyu_off #oshirase5").click(function () {
		$("#oshirase_menu > ul > li").removeClass("on");
		$(this).addClass("on");
		$("#oshirase_matter > ul").hide();
		$("#oshirase_matter > ul").eq($("#oshirase_menu > ul > li").index(this)).show();
	});
	
});


// 文字サイズ変更 cookieを30日保持：[expires:30]
$(function(){
	$("#fsize").attr({href:$.cookie('style')});
	});
	function fsize(cssurl){
		$('#fsize').attr({href:cssurl});
		$.cookie('style',cssurl,{expires:30,path:'/'});
}

// window open

function m_win(url,windowname,width,height) {
 var features="location=no, menubar=no, status=yes, scrollbars=yes, resizable=yes, toolbar=no";
 if (width) {
  if (window.screen.width > width)
   features+=", left="+(window.screen.width-width)/2;
  else width=window.screen.width;
  features+=", width="+width;
 }
 if (height) {
  if (window.screen.height > height)
   features+=", top="+(window.screen.height-height)/2;
  else height=window.screen.height;
  features+=", height="+height;
 }
 window.open(url,windowname,features);
}

