//preload menu image

//swap image
function swpImg(lstr,lnum) {
//How to Use
//name="logo0" HENKOU ATO =logo01.gif NO BAAI swpImg(this.name, 1);
	//lnum=0 onMouseOut, lnum=1 onMouseOver
	//
	//Event-moto no src
	var lin=document.images[lstr].src;
	//Event-moto no pic-No. XXX_0.gif to 0
	var linnum=lin.substring(lin.length-5,lin.length-4);
	//XXX_0.gif to XXX_
	lin=lin.substring(0,lin.length-5);
	document.images[lstr].src=lin+lnum+".gif";
}
//swpImg_goTopd
function set_gotop(lnum,lbgcol,lmgn) {
	var ltxt='';
	var ltmp;
	if (lnum==ltmp) {
		lnum=1;
	}
	if (lbgcol==ltmp) {
		lbgcol="B1D7F3";
	}
	if (lmgn==ltmp) {
		lmgn=5;
	}
	switch(lnum) {
	case 0:
		ltxt += '<img src="img/blank.gif" width=1 height=1 alt="">';
		break;
	case 1:
		ltxt += '<a href="#top" title="Top of this page.">';
		switch(lbgcol) {
		case "FFFFFF":
			ltxt += '<img src="img/btn/b_gotop10.gif" width=57 height=20 align="right"';
			ltxt += ' onMouseOver="this.src=\'img/btn/b_gotop11.gif\'"';
			ltxt += ' onMouseOut="this.src=\'img/btn/b_gotop10.gif\'"';
			break;
		case "blue":
			ltxt += '<img src="img/btn/b_gotop20.gif" width=61 height=20 align="right"';
			ltxt += ' onMouseOver="this.src=\'img/btn/b_gotop21.gif\'"';
			ltxt += ' onMouseOut="this.src=\'img/btn/b_gotop20.gif\'"';
			break;
		case "B1D7F3":
			ltxt += '<img src="img/btn/b_gotop00.gif" width=45 height=16 align="right"';
			ltxt += ' onMouseOver="this.src=\'img/btn/b_gotop01.gif\'"';
			ltxt += ' onMouseOut="this.src=\'img/btn/b_gotop00.gif\'"';
			break;
		}
		ltxt += ' style="margin-right:'+lmgn+'px;"';
		ltxt += ' alt="Top of this page."></a>';
		break;
	}
	document.write(ltxt);
}
//swpImg_goTop
function set_gotop_(lnum,lbgcol) {
	var ltxt='';
	var ltmp;
	if (lnum==ltmp) {
		lnum=1;
	}
	if (lbgcol==ltmp) {
		lbgcol="B1D7F3";
	}
	switch(lnum) {
	case 0:
		ltxt += '<img src="img/blank.gif" width=1 height=1 alt="">';
		break;
	case 1:
		ltxt += '<a href="#top" title="Top of this page.">';
		switch(lbgcol) {
		case "FFFFFF":
			break;
		case "blue":
			break;
		case "B1D7F3":
			ltxt += '<img src="img/gotop00.gif" width=47 height=12 align="right"';
			ltxt += ' onMouseOver="this.src=\'img/gotop01.gif\'"';
			ltxt += ' onMouseOut="this.src=\'img/gotop00.gif\'"';
			break;
		}
		ltxt += ' alt="Top of this page."></a>';
		break;
	}
	document.write(ltxt);
}
//<title>
function setTitle(lname) {
	document.write("<title>PeKay\'s House</title>");
	//Favicon
	//document.write('<link rel="SHORTCUT ICON" href="favicon.ico">');
	//image toolbar no mukou
	document.write('<meta http-equiv="imagetoolbar" content="no">');
}

//menu
function setMenu(lname) {
	//<table><tr>
	var lList=new Array("top", "about", "help", "pc", "tukutte", "present", "faq", "mail");
	var wList=new Array( 52,     87,      67,    70,      85,       52,       52,    52);
	var aList=new Array("Home", "What is &quot;PeKay\'s House&quot;?", "How to play", "Play with PC", "Play with craft", "Present", "FAQ", "Contact");
	var i,lw;
	var lpre=new Array(lList.length);
	if (lname=="top") {
		document.write("<table width=800 height=52 style='left:0px; margin-top:2px; position:relative;' cellpadding=0 cellspacing=0 border=0><tr>");
	} else {
		document.write("<table width=800 height=52 style='left:0px; margin-top:7px; position:relative;' cellpadding=0 cellspacing=0 border=0><tr>");
	}
	for (i=0; i<lList.length; i++) {
		//preLoad
		lpre[i]=new Image(wList[i],52);
		lpre[i].src="img/menu/mb_"+lList[i]+"1.gif";
		//<td>
		if (i==0) {
			//1st
			lw=97;
		} else if (i==lList.length-1) {
			//last
			lw=97;
		} else {
			//normal
			lw=101;
		}
		document.write("<td width="+lw+" height=54 align='center' valign='middle'>");
		//<a href~><img></a></td>
		if (lname==lList[i]) {
			//now page is button off
			document.write("<img src='img/menu/mb_" +lList[i]+ "2.gif' name='mb_" +lList[i]+ "' alt='" +aList[i]+ "' width="+wList[i]+" height=52'></td>");
		} else {
			//other page is button on
			if (i==0) {
				//home btn
				document.write("<a href='index.html' title='Home'><img src='img/menu/mb_" +lList[i]+ "0.gif' name='mb_"+lList[i]+ "' alt='" +aList[i]+ "' width="+wList[i]+" height=52 onMouseOver='swpImg(this.name,1)' onMouseOut='swpImg(this.name,0)'></a></td>");
			} else {
				//single-quot ga umaku denai node betu syori
//				document.write("<a href='top_" +lList[i]+ ".html' title='" +aList[i]+ "'><img src='img/menu/mb_" +lList[i]+ "0.gif' name='mb_"+lList[i]+ "' alt='" +aList[i]+ "' width="+wList[i]+" height=52 onMouseOver='swpImg(this.name,1)' onMouseOut='swpImg(this.name,0)'></a></td>");
				document.write("<a href=\"top_" +lList[i]+ ".html\" title=\"" +aList[i]+ "\"><img src=\"img/menu/mb_" +lList[i]+ "0.gif\" name=\"mb_"+lList[i]+ "\" alt=\"" +aList[i]+ "\" width="+wList[i]+" height=52 onMouseOver=\"swpImg(this.name,1)\" onMouseOut=\"swpImg(this.name,0)\"></a></td>");
			}
		}
	}
	//</tr></table>
	document.write("</tr></table>");
}


//copyright
function setCopyright(lnum,lsub) {
	if (lnum == void(0)) {
		lnum="";
	}
	document.write("<table width=800 cellpadding=0 cellspacing=0 style='margin:0 0 5px 0;padding:0px;'><tr>");
		document.write("<td width=1 class='cpy' align='left' valign='top'>&nbsp;</td>");
		if (lsub == void(0)) {
			document.write("<td class='cpy' align='right' valign='top' style='padding-top:3px;'>");
		} else {
			document.write("<td class='cpy' align='center' valign='top'>");
		}
		document.write("&copy; 2001 Tamie Asakura&nbsp;");
		document.write("</td>");
		document.write("<td width=1 class='cpy' align='left' valign='top'>&nbsp;</td>");
	document.write("</tr></table>");
}

//mailt0
function myMail(larg,lmgn) {
	//lmgn=[U,R,D,L]
	var ltxt="";
	var lid="b_info_mail0_"+larg;
	ltxt += "<a href='mailto:&#104;&#101;&#108;&#112;&#64;&#112;&#101;&#107;&#97;&#121;&#46;&#106;&#112;' title='&#104;&#101;&#108;&#112;&#64;&#112;&#101;&#107;&#97;&#121;&#46;&#106;&#112;'>";
	ltxt += "<img src='img/btn/b_info_mail00.gif' name='b_info_mail0' alt='info@pekay.jp' width=63 height=11 ";
	//margin
	if (lmgn != void(0)) {
		ltxt += "style='";
		ltxt += "margin-top:" + lmgn[0]+"px;";
		ltxt += "margin-right:" + lmgn[1]+"px;";
		ltxt += "margin-bottom:" + lmgn[2]+"px;";
		ltxt += "margin-left:" + lmgn[3] + "px;' ";
	}
	//mouseAct
	ltxt += "onMouseOver='this.src=\"img/btn/b_info_mail01.gif\"' ";
	ltxt += "onMouseOut='this.src=\"img/btn/b_info_mail00.gif\"' ";
	ltxt += "></a>";
	document.write(ltxt);
}

//lastupdate
function setLastUpdate(lstr) {
	var ldate=new Date(document.lastModified); 
	var lyear=ldate.getFullYear();
	var lmonth=ldate.getMonth() + 1;
	var lday=ldate.getDate();
	switch(lstr) {
		case "top":
			//Last Update:2007/03/23
			if (lmonth < 10) {
				lmonth ="0"+lmonth;
			}
			if (lday < 10) {
				lday ="0"+lday;
			}
			var ltxt="Last Update:"+lmonth+"/"+lday+"/"+lyear;
			document.write(ltxt);
			break;
	}
}

//Window Resize
function myResize(lw,lhFlag) {
	var lstr=navigator.userAgent.toUpperCase();
	if (lstr.indexOf("FIREFOX") != -1) {
		//firefox
	} else {
		var ly=document.images["chkWin"].offsetTop;
		window.resizeTo(lw+28,ly+195);
		window.focus();
	}
}
//maitTo Friends
function setToFriends(lnum) {
	document.write('<a href="mailto:?subject=PeKay\'s House&body=http://www.pekay.jp/" title="Tell your friends about PeKay.">');
	switch(lnum) {
	case 1:
		document.write('<img src="img/ban/to_friends1.gif" width=150 height=40 alt="Tell your friends about PeKay."></a>');
		break;
	case 2:
		document.write('<img src="img/ban/to_friends2.gif" width=72 height=26 alt="Tell your friends about PeKay."></a>');
		break;
	default:
		break;
	}
}
//dousa kankyo
function myEnv() {
	document.write('This site requires Flash Player ver. 9 or higher.<br>');
	document.write('<a class="here" href="http://www.adobe.com/shockwave/download/?P1_Prod_Version=ShockwaveFlash&Lang=English" target="_blank" title="Install Flash Player.">&#8250;&#8250; Click here to install</a><br>');
	document.write('<br>');
	document.write('*We recommend a broadband environment, such as DSL, higher-capacity optical link, and etc.<br>');
}
