function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1]).src;
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		buttonmap_1 = newImage('img/map_btn_off.gif');
		buttonmap_2= newImage('img/map_btn_on.gif');
		button01_1 = newImage('../menu/img/button1_off.gif');
		button01_2= newImage('../menu/img/button1_on.gif');
		button02_1 = newImage('../menu/img/button2_off.gif');
		button02_2= newImage('../menu/img/button2_on.gif');
		button03_1 = newImage('../menu/img/button3_off.gif');
		button03_2= newImage('../menu/img/button3_on.gif');
		button04_1 = newImage('../menu/img/button4_off.gif');
		button04_2= newImage('../menu/img/button4_on.gif');
		button06_1 = newImage('../menu/img/button6_off.gif');
		button06_2= newImage('../menu/img/button6_on.gif');
		button07_1 = newImage('../menu/img/button7_off.gif');
		button07_2= newImage('../menu/img/button7_on.gif');
		button08_1 = newImage('../menu/img/button8_off.gif');
		button08_2= newImage('../menu/img/button8_on.gif');
		button09_1 = newImage('../menu/img/button9_off.gif');
		button09_2= newImage('../menu/img/button9_on.gif');
		button10_1 = newImage('../menu/img/button10_off.gif');
		button10_2= newImage('../menu/img/button10_on.gif');
		button99_1 = newImage('../menu/img/kujira_on.gif');
		button99_2 = newImage('../menu/img/kujira.gif');
		preloadFlag = true;
	}
}

var newwin;
function showWin(url,nam,param){
	if(newwin){
		if(!newwin.closed){
			//newwin.location.href=url;
			newwin.close();
			newwin=window.open(url,nam,param);
			newwin.focus();
		}else{
			newwin=window.open(url,nam,param);
		}
	}else{
		newwin=window.open(url,nam,param);
	}
	
	//newwin.resizeTo(param.substr(6,3),param.substr(17,3));
	if(!!newwin){
		//newwin.document.open();
		//newwin.document.write("KKK");
		//newwin.document.close();
	}
}


function header_write(){
	document.write("<img src='../img/top.jpg' border='0' vspace='0' usemap='#Map'><map name='Map'><area shape='rect' coords='0,0,160,70' href='main.html'></map>");
}

function menu_write(){
	tmp = "";
	tmp = tmp + "<table  background='../menu/img/menu.jpg' style='background-repeat:no-repeat' width='130' height='630' border='0' cellspacing='0' cellpadding='0'>";
	tmp = tmp + "<tr><td></td><td height='30px'><a href='plan.html' onMouseOver=\"changeImages('button01','button01_2');return true;\" onMouseOut=\"changeImages('button01','button01_1');return true;\"><img src='../menu/img/button1_off.gif' Name='button01' border='0' width='106' height='21' style='margin-left:4px'></a></td></tr>";
	tmp = tmp + "<tr><td></td><td height='30px'><a href='introduce.html' onMouseOver=\"changeImages('button02','button02_2');return true;\" onMouseOut=\"changeImages('button02','button02_1');return true;\"><img src='../menu/img/button2_off.gif' Name='button02' border='0' width='106' height='21' style='margin-left:4px'></a></td></tr>";
	tmp = tmp + "<tr><td></td><td height='30px'><a href='compliments.html' onMouseOver=\"changeImages('button04','button04_2');return true;\" onMouseOut=\"changeImages('button04','button04_1');return true;\"><img src='../menu/img/button4_off.gif' Name='button04' border='0' width='106' height='21' style='margin-left:4px'></a></td></tr>";
	tmp = tmp + "<tr><td></td><td height='30px'><a href='breath.html' onMouseOver=\"changeImages('button06','button06_2');return true;\" onMouseOut=\"changeImages('button06','button06_1');return true;\"><img src='../menu/img/button6_off.gif' Name='button06' border='0' width='106' height='21' style='margin-left:4px'></a></td></tr>";
	tmp = tmp + "<tr><td></td><td height='30px'><a href='koujo.html' onMouseOver=\"changeImages('button07','button07_2');return true;\" onMouseOut=\"changeImages('button07','button07_1');return true;\"><img src='../menu/img/button7_off.gif' Name='button07' border='0' width='106' height='21' style='margin-left:4px'></a></td></tr>";
	tmp = tmp + "<tr><td></td><td height='30px'><a href='../map/tdc_map.html' target='brank' onMouseOver=\"changeImages('button10','button10_2');return true;\" onMouseOut=\"changeImages('button10','button10_1');return true;\"><img src='../menu/img/button10_off.gif' Name='button10' border='0' width='106' height='21' style='margin-left:4px'></a></td></tr>";
	tmp = tmp + "<tr><td></td><td height='80px'><a href='tooushin.html' onMouseOver=\"changeImages('button09','button09_2');return true;\" onMouseOut=\"changeImages('button09','button09_1');return true;\"><img src='../menu/img/button9_off.gif' Name='button09' border='0' width='107' height='53' style='margin-left:4px'></a></td></tr>";
	tmp = tmp + "<tr><td></td><td height='50px'><a href='tomother.html' onMouseOver=\"changeImages('button08','button08_2');return true;\" onMouseOut=\"changeImages('button08','button08_1');return true;\"><img src='../menu/img/button8_off.gif' Name='button08' border='0' width='107' height='53' style='margin-left:4px'></a></td></tr>";
	tmp = tmp + "<tr><td></td><td align='left'><a href='main.html' onMouseOver=\"changeImages('button99','button99_1');return true;\" onMouseOut=\"changeImages('button99','button99_2');return true;\"><img src='../menu/img/kujira.gif' Name='button99' border='0' width='110' height='91' style='margin-left:4px'></a></td></tr>";
	tmp = tmp + "</table>";

	document.write(tmp);
}
