//ブラウザ判別

var aVer = navigator.appVersion;
var aName = navigator.appName;
var uAgent = navigator.userAgent;

//MACの場合
if(aVer.indexOf("Mac") > -1)
{
	//Safariの場合
	if(aName == "Safari"){
		document.write('<link rel="stylesheet" type="text/css" href="/font.css" />');
	}
	//Netscape,Firefoxの場合
	if(aName == "Netscape"){
		document.write('<link rel="stylesheet" type="text/css" href="/content/font_mac.css" />');
	}
	
//Windowsの場合
}else{
	//Netscape
	if (aName == "Netscape"){
		if(uAgent.indexOf("Firefox") > -1){
			document.write('<link rel="stylesheet" type="text/css" href="/content/font_ff.css" />');
		}else{
			document.write('<link rel="stylesheet" type="text/css" href="/font_nc.css" />');	
		}
	}
}

// プリントダイアログ呼び出し
function callPrint(){
	// MACのIEの場合アラートを出す
	var ua=navigator.userAgent.toLowerCase();
	if((ua.indexOf("mac")>-1) && (ua.indexOf("msie")>-1)){
		alert('ブラウザの印刷ボタンを押して下さい');
		return;
	}
	print();
}

//文字の拡大
function getCookie(){
	zoom = "";
	cName = "FujisawaWeb=";
	tmpCookie = document.cookie + ";";
	start = tmpCookie.indexOf(cName);
	if (start != -1)
	{
		end = tmpCookie.indexOf(";", start);
		zoom = tmpCookie.substring(start + cName.length, end);
		document.getElementById("contentsArea_r").style.fontSize = zoom;
	} else {
		document.getElementById("contentsArea_r").style.fontSize = "100%";
	}
}

function textSizeUp(){
	currentSize = document.getElementById("contentsArea_r").style.fontSize;
	selectSize = "";
	if ( currentSize == "100%" ){
		selectSize = "18pt";
	}
	else if ( currentSize == "18pt" ){
		selectSize = "20pt";
	}
	else if ( currentSize == "20pt" ){
		selectSize = "22pt";
	}
	else if ( currentSize == "22pt" ){
		selectSize = "24pt";
	}
	else if ( currentSize == "24pt" ){
		m = escape("これ以上文字のサイズを大きくできません。");
		alert(unescape(m));
		selectSize = "24pt";
	}
	else {
		selectSize = "100%";
	}
	document.getElementById("contentsArea_r").style.fontSize = selectSize;
}

function textSizeReset(){
	currentSize = document.getElementById("contentsArea_r").style.fontSize;
	m = escape("標準文字サイズに戻しますか？");
	/*m = escape("ただいまの文字サイズは" + currentSize + "（標準：12pt）です。元に戻しますか？");*/
	r = confirm(unescape(m));
	if (r) {
		currentSize = "100%";
		document.getElementById("contentsArea_r").style.fontSize = currentSize;
	}
}

// --------------------------------------------------
// for print page
// --------------------------------------------------
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=yes,directories=no,personalbar=yes,status=no,menubar=yes,scrollbars=yes,titlebar=yes,resizable=yes,width=640,height=600');
}
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="/content/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");
		}
	}
}

function showHeaderAd() {
document.getElementById("headerAd").style.visibility = "visible";
}