var htmlData = new String();
var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);

var agent = navigator.userAgent;
var ver = new Number();
var isIE = (agent.indexOf("MSIE") != -1) ? true : false;
var isNN = (agent.indexOf('Netscape') != -1) ? true : false;
if(isIE) {ver = Number(agent.substring(agent.indexOf("MSIE",0) + 5, agent.indexOf(";", agent.indexOf("MSIE",0))));}
else if(isNN) {ver = Number(agent.substring(agent.indexOf("Netscape/", 0) + 9,agent.indexOf(" ", agent.indexOf("Netscape/", 0))));}

if(hasRightVersion) {
	var flaPath="http://www2.athome.co.jp/atweb_static/common/swf/zenkoku.swf";
	var flaWidth="339";
	var flaHeight="141";
	var flaBGcolor="#ffffff";
	var flaVers="xmlPath=http://www2.athome.co.jp/atweb_static/common/xml/zenkoku.xml";
	htmlData += "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"781\" height=\"141\" align=\"center\">\n";
	htmlData += "<tr>\n";
	if(isIE && ver >= 5.5) {
		htmlData += "<td width=\"442\">&nbsp;</td>\n";
	} else if(isNN && ver >= 7.1) {
		htmlData += "<td width=\"441\">&nbsp;</td>\n";
	}
	htmlData += "<td width=\"339\" align=\"right\">\n";
	htmlData += "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"" + flaWidth + "\" height=\"" + flaHeight + "\" align=\"left\">\n";
	htmlData += "<param name=\"movie\" value=\"" + flaPath + "\">";
	htmlData += "<param name=\"bgcolor\" value=\"" + flaBGcolor + "\" />\n";
	htmlData += "<param name=\"flashvars\" value=\"" + flaVers  + "\" />\n";
	htmlData += "<param name=\"quality\" value=\"high\" />\n";		
	htmlData += "<param name=\"wmode\" value=\"transparent\" />\n";
	htmlData += "<param name=\"menu\" value=\"false\" />\n";
	htmlData += "<embed src=\"" + flaPath + "\" width=\"" + flaWidth + "\" height=\"" + flaHeight + "\" bgcolor=\"" + flaBGcolor + "\" flashvars=\""+ flaVers + "\" quality=\"high\"  wmode=\"transparent\" menu=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />\n";
	htmlData += "</object>\n";
	htmlData += "</td>\n";
	htmlData += "</tr>\n"
	htmlData += "</table>\n";
} else {
	var alternateContent = 'An old version of the Flash plugin was detected. <strong><a href="http://www.macromedia.com/go/getflash/">Please upgrade your Flash plugin.</a></strong>';
	htmlData += alternateContent;
}
function findElementObj(id){
	if(document.getElementById) {return document.getElementById(id);}
	else if(document.all) {return document.all(id);}
	else if(document.layers) {return document.layers[id];}
}
function findElementStyle(id){
	if(document.getElementById) {return document.getElementById(id).style;}
	else if(document.all) {return document.all(id).style;}
	else if(document.layers) {return document.layers[id];}
}
function openFloatingFlashMenu() {
	findElementStyle("floatingFlash").display = "block";
	findElementObj("floatingFlash").innerHTML = htmlData
}
function closeFloatingFlashMenu() {
	findElementStyle("floatingFlash").display = "none";
	findElementObj("floatingFlash").innerHTML = "";
}
function hdrMenu(){
	if((isIE && ver >= 5.5 || isNN && ver >= 7.1) && hasRightVersion) {
		//InternetExplorer5.5以上又はNetscape7.1以上
		document.write("<div id=\"jsmenu1\"><img src=\"http://www2.athome.co.jp/atweb_static/common/images/jsmenu_part_01.gif\" width=\"224\" height=\"18\" alt=\"\" border=\"0\" hspace=\"5\" vspace=\"8\"><a href=\"javascript:;\" onmouseover=\"openFloatingFlashMenu();\"><img src=\"http://www2.athome.co.jp/atweb_static/common/images/jsmenu_global_btn.jpg\" width=\"329\" height=\"34\" alt=\"\" border=\"0\"></a></div>\n");
	} else {
		document.write('<div id="jsmenu2">');
		document.write('<table border="0" cellpadding="0" cellspacing="0">\n');
		document.write('<tr>\n');
		document.write('<td style="padding-right:1px;"><a href="javascript:;" onmouseover="menuOpen(this);" onmouseout="menuClose(this);"><img src="http://www2.athome.co.jp/atweb_static/common/images/jsmenu_btn_01_off.gif" width="59" height="21" alt="" border="0"></a></td>\n');
		document.write('<td style="padding-right:1px;"><a href="javascript:;" onmouseover="menuOpen(this);" onmouseout="menuClose(this);"><img src="http://www2.athome.co.jp/atweb_static/common/images/jsmenu_btn_02_off.gif" width="59" height="21" alt="" border="0"></a></td>\n');
		document.write('<td style="padding-right:1px;"><a href="javascript:;" onmouseover="menuOpen(this);" onmouseout="menuClose(this);"><img src="http://www2.athome.co.jp/atweb_static/common/images/jsmenu_btn_03_off.gif" width="59" height="21" alt="" border="0"></a></td>\n');
		document.write('<td style="padding-right:1px;"><a href="javascript:;" onmouseover="menuOpen(this);" onmouseout="menuClose(this);"><img src="http://www2.athome.co.jp/atweb_static/common/images/jsmenu_btn_04_off.gif" width="59" height="21" alt="" border="0"></a></td>\n');
		document.write('<td style="padding-right:1px;"><a href="javascript:;" onmouseover="menuOpen(this);" onmouseout="menuClose(this);"><img src="http://www2.athome.co.jp/atweb_static/common/images/jsmenu_btn_05_off.gif" width="59" height="21" alt="" border="0"></a></td>\n');
		document.write('<td style="padding-right:1px;"><a href="javascript:;" onmouseover="menuOpen(this);" onmouseout="menuClose(this);"><img src="http://www2.athome.co.jp/atweb_static/common/images/jsmenu_btn_06_off.gif" width="59" height="21" alt="" border="0"></a></td>\n');
		document.write('<td style="padding-right:1px;"><a href="javascript:;" onmouseover="menuOpen(this);" onmouseout="menuClose(this);"><img src="http://www2.athome.co.jp/atweb_static/common/images/jsmenu_btn_07_off.gif" width="59" height="21" alt="" border="0"></a></td>\n');
		document.write('<td style="padding-right:1px;"><a href="javascript:;" onmouseover="menuOpen(this);" onmouseout="menuClose(this);"><img src="http://www2.athome.co.jp/atweb_static/common/images/jsmenu_btn_08_off.gif" width="59" height="21" alt="" border="0"></a></td>\n');
		document.write('<td style="padding-right:0px;"><a href="javascript:;" onmouseover="menuOpen(this);" onmouseout="menuClose(this);"><img src="http://www2.athome.co.jp/atweb_static/common/images/jsmenu_btn_09_off.gif" width="59" height="21" alt="" border="0"></a></td>\n');
		document.write('</tr>\n');
		document.write('</table>\n');
		document.write('<div id="jsmenuSub" onmouseover="menuOpen2();" onmouseout="menuClose2();" style="height:18px;background-color:#0079D1;visibility:hidden;text-indent:8px;line-height:18px;"></div>\n');
		document.write('</div>\n');
	}
}
// ここから下がjavascriptのメニュー部分 --------------------------------------------------------
var stockObject = new Object();
function menuOpen(obj){
	stockObject = obj;
	var target = obj.firstChild;
	var index = target.src.indexOf("_off.gif");
	if(index > 0) {
		target.src = target.src.substring(0, index) + "_on.gif"; 
		var num = Number(target.src.substring(index -2, index));
		menuSubOpen(num);
	}
}
function menuOpen2(){
	menuOpen(stockObject);	
}
function menuClose(obj){
	var target = obj.firstChild;
	var index = target.src.indexOf("_on.gif");
	if(index > 0) {
		target.src = target.src.substring(0, index) + "_off.gif"; 
		menuSubClose();
	}
}
function menuClose2() {
	menuClose(stockObject);
}
function menuSubOpen(num) {
	findElementObj("jsmenuSub").innerHTML = subMenuList[num];
	findElementStyle("jsmenuSub").visibility = "visible";
}
function menuSubClose(){
	findElementStyle("jsmenuSub").visibility = "hidden";
}

