
	// 詳細ページのヘッダー画像名をランダムに取得する関数
	// 引数：なし
	// 戻り値：画像ファイル名(相対パスつき)
	function getPagetopImgName() {
		var no = Math.floor(Math.random() * 10);
		var top_graphic = "../common/page_top"+no+".jpg";
		return top_graphic;
	}

	// サブウィンドウをオープンする関数(ウィンドウのリサイズは可能)
	// 引数：URL、ターゲット、ウィンドウの幅、ウィンドウの高さ
	// 戻り値：なし
	function subWindowOpen(url,t,w,h){
		var win = window.open(url,t,"width=" + w + ",height=" + h + ", resizable=no, scrollbars=no, top=0");
		win.focus();
	}

	function mapOpen(url){
		var win = window.open(url,"map","width=750,height=600");
		win.focus();
	}
	function smallMapOpen(url){
		//var win = window.showModalDialog(url,"smallMap","width=450,height=400");
		//var win = window.showModalDialog(url,"smallMap","dialogWidth:450; dialogHeight:400");
		var win = window.open(url,"smallMap","width=450,height=400");
		win.focus();
	}

	// リンクメニューにマウスが入った場合
	function menuLinkIn(arg) {
		document.images["arrow_" + arg].src = "./images/menu_arrow_act.gif";
	}

	// リンクメニューからマウスが出た場合
	function menuLinkOut(arg) {
		document.images["arrow_" + arg].src = "./images/menu_arrow.gif";
	}

	// ボタンメニューにマウスが入った場合
	function buttonLinkIn(arg) {
		document.images[arg].src = "./images/" + arg + "_act.gif";
	}

	// ボタンメニューからマウスが出た場合
	function buttonLinkOut(arg) {
		document.images[arg].src = "./images/" + arg + ".gif";
	}

	// レイヤーの表示
	function show(id,helpmsg,x,y){
		if(document.layers){
//			x = window.event.layerX;
//			y = window.event.layerY;
			document.layers[0].document.open();
			document.layers[0].document.write(helpmsg);
			document.layers[0].document.close();
			document.layers[0].moveTo(x + 10, y + 20);
			document.layers[0].visibility = "SHOW";
		}
		else if(document.all){
//			x = window.event.clientX;
//			y = window.event.clientY;
			document.all(id).innerHTML = helpmsg;
			document.all[id].style.pixelLeft = x+10;
			document.all[id].style.pixelTop = y+20;
			document.all[id].style.visibility = "visible";
		}
	}

	//レイヤーの非表示
	function hide(id) {

		if (!document.all[id].contains(window.event.toElement)) {
			if(document.layers){
				document.layers[0].visibility = "HIDE";
			}
			else if(document.all){
				document.all[id].style.visibility = "hidden";
			}
		}

	}

	// 資料請求メール送信
	function sendRequestMail() {

		// 名前チェック
		if (document.requestForm.a.value=="") {
			alert("名前の入力をお願いします。");
			return false;
		}

		// メールアドレスチェック
		if (document.requestForm.f.value=="") {
			alert("e-mail アドレスの入力をお願いします。");
			return false;
		}

		// メールアドレスチェック
		if (document.requestForm.f.value.indexOf('@')==-1) {
			alert("e-mail アドレスの入力に間違いがあるようです。\nご確認ください。");
			return false;
		}

		document.requestForm.submit();
	}

	function showCaptionWindow(caption,center,img,w,h) {
		w=window.open("","caption","width="+w+",height="+h);
		w.document.open();
		w.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">\n');
		w.document.write('<HTML>\n');
		w.document.write('<HEAD>\n');
		w.document.write('	<META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">\n');
		w.document.write('	<META http-equiv="Content-Style-Type" content="text/css">\n');
		w.document.write('<!--ロボット回避用-->\n');
		w.document.write('	<META http-equiv="Pragma" content="no-cache">\n');
		w.document.write('	<META name="robots" content="noindex,nofollow">\n');
		w.document.write('<!--StileSheet-->\n');
		w.document.write('	<link rel=stylesheet type="text/css" href="/'+center+'/css/'+center+'.css" title="style">\n');
		w.document.write('</HEAD>\n');
		w.document.write('<BODY class="bgcolor">\n');
		w.document.write('<IMG src="/'+center+'/images/'+img+'">\n');
		w.document.write('<BR>');
		w.document.write('<TABLE border="0" class="center_color" cellspacing="0" cellpadding="0">');
		w.document.write('<TR>');
		w.document.write('<TD>');
		w.document.write('<TABLE border="0" cellspacing="1" cellpadding="5">');
		w.document.write('<TR class="center_subcolor">');
		w.document.write('<TD>');
		w.document.write(caption);
		w.document.write('</TD>');
		w.document.write('</TR>');
		w.document.write('</TABLE>');
		w.document.write('</TD>');
		w.document.write('</TR>');
		w.document.write('</TABLE>');
		w.document.write('\n');
		w.document.write('<BR>\n');
		w.document.write('<CENTER>\n');
		w.document.write('	<A HREF="" onClick="window.close()">\n');
		w.document.write('	<IMG src="/common/map_close.gif" border="0" alt="閉じる"></A>\n');
		w.document.write('</CENTER>\n');
		w.document.write('</BODY>\n');
		w.document.write('</HTML>\n');
		w.document.close();
	}
	
	// 年齢自動算出
	function agecalc() {
window.alert("hit!"+ document.agecalc);
		with (document.agecalc) {
			dd = parseInt(f.selectedIndex) + 1;
			mm = parseInt(e.selectedIndex) + 1;
			yy = d.value;
			if (yy.length != 4 || isNaN(yy)) {
				document.agecalc.g.value = "4桁の西暦（たとえば2000年なら2000）を半角で入力してください。";
				document.agecalc.d.select();
				document.agecalc.d.focus();
				return;
   			}
		}
		days = new Date();
		gdate = days.getDate();
		gmonth = days.getMonth();
		gyear = days.getYear();
		if (gyear < 2000) gyear += 1900;
		age = gyear - yy;
		if ((mm == (gmonth + 1)) && (dd <= parseInt(gdate))) {
			age = age; 
		} else {
			if (mm <= (gmonth)) {
				age = age;
			} else {
				age = age - 1; 
			}
		}
		if (age == 0)
		age = age;
		document.agecalc.g.value = age;
	}

