//-----------------------------------------------
// Big Menu JavaScript
//-----------------------------------------------
/* --- not */

var f = 0;
var prev_findex = 0;
var def_str = "";
var myFlash = new Array();
	myFlash[f++] = ["タイトル画", "top/title.jpg", "top/title.jpg","",550,350];
	myFlash[f++] = ["サイト人・トチギ", "totigi/sm.jpg", "totigi/totigi.swf","He is Totigi, SiteHuman. Click he."];
	
	myFlash[f++] = ["ぱおんぱおん★ぞうたん", "game/game/mini/zousan/sm.jpg","game/game/mini/zousan/zousan.swf", "The zousan GAME!"];
	myFlash[f++] = ["ぷよんぷよん★いるかたん", "game/game/mini/irukatan/sm.jpg","game/game/mini/irukatan/irukatan.swf", "The irukatan GAME!"];
var myFlashID = "totigi";

function TopSwfMenu(){
	document.write("&gt;&gt; TOP.Change ▼<bR> ");
	for(var i in myFlash){
		if(myFlash[i]){
			document.write("<a ");
			document.write(" onclick='TopSwfShow(\"" + i +"\")'>");
			document.write("<img ");
			document.write(" src='" + myFlash[i][1] +"' ");
			document.write(" alt='" + myFlash[i][0] +"' ");
			document.write(" id='topswf_" + i + "'");
			if(i > 0) document.write(" width=30 height=30 ");
			else document.write(" width=40 height=40 ");
			document.write(" class='topswf_img' style='margin:3px; border:1px solid gray;'>");
			document.write("</a>");
			document.write("\n");
		}
	}
	def_str = _gel("topswf_serif").innerHTML;
	
}
function TopReset(){
		document.getElementById("topswf").innerHTML = str;
}
/**/
function TopSwfShow(findex){
	
	if(myFlash[findex]){
		
		// イメージを大きく！
		var imgObj = document.getElementById("topswf_" + findex);
		imgObj.width = 40;
		imgObj.height = 40;
		
		// いままでのイメージを小さく
		if(prev_findex != findex){
			var imgObj = document.getElementById("topswf_" + prev_findex);
			imgObj.width = 30;
			imgObj.height = 30;
			prev_findex = findex;
		}
		
		// 台詞を記述
		
		// SWFの入れ替え
		var swfURL = myFlash[findex][2];
		var wp = 550;
		var hp = 360;
		if(myFlash[findex][4]) wp = myFlash[findex][4];
		if(myFlash[findex][5]) hp = myFlash[findex][5];
		var str = "";
		//alert(swfURL);
		// Xmas !!!
		if(findex != 0){
			document.getElementById("topswf_serif").innerHTML = myFlash[findex][3];
			// Object
			str += "	<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" ";
			str += "	codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" ";
			str += "	width=\"" + wp + "\" height=\"" + hp + "\" align=\"middle\">";
			// Param
			str += "	<param name=\"quality\" value=\"high\" />";
			str += "	<param name=\"bgcolor\" value=\"#000000\" />";
			str += "	<param name=\"allowScriptAccess\" value=\"sameDomain\" />";
			str += "	<param name=\"allowFullScreen\" value=\"false\" />";
			str += "	<param name=\"loop\" value=\"false\" />";
			str += "	<param name=\"menu\" value=\"false\" />";
			str += "	<param name=\"movie\" value=\"" + swfURL + "\" />";
			// Embed
			str += "		<embed ";
			str += "		src=\"" + swfURL + "\" ";
			str += "		loop=\"false\" menu=\"false\" ";
			str += "		quality=\"high\" ";
			str += "		bgcolor=\"#000000\" ";
			str += "		width=\"" + wp + "\" height=\"" + hp + "\" ";
			str += "		name=\"topswf\" ";
			str += "		align=\"middle\" ";
			str += "		allowScriptAccess=\"sameDomain\" ";
			str += "		allowFullScreen=\"false\" ";
			str += "		type=\"application/x-shockwave-flash\" ";
			str += "		pluginspage=\"http://www.adobe.com/go/getflashplayer_jp\" />";
			str += "	</object><br>";
		}else{
			document.getElementById("topswf_serif").innerHTML = def_str;
			str += "<img src='" + swfURL +"' width=" + wp + " height=" + hp +">";
		}
		// Write
		document.getElementById("topswf").innerHTML = str;
	}
}

