/*
 *
 *      右ソデメニュー
 *
 */
//右ソデメニュー　親項目
ProductTbl = new Array("ユーザ向け", "開発者向け", "データ販売");
SupportTbl = new Array("よくあるご質問", "ACT距離計算サービス<br />メンテナンス情報","ダウンロード", "お問い合わせ");

ParentTbl = new Array(ProductTbl, SupportTbl);

//右ソデメニュー　子項目
UserTbl = new Array("距離計算クライアント", "距離計算ワークシート", "距離計算ワークシート<br>２点間計算対応版", "距離計算パッケージ<br />for MapInfo", "簡易配車インタフェース", "ECO2-Calc／＋<br>エコエコカルク／プラス");
DevelopTbl = new Array("距離計算サービス", "距離計算パッケージ<br />のカスタマイズ", "距離計算コア<br>エンタープライズ版", "位置検索ライブラリ");
DataTbl = new Array("県庁・市区町村データ");

ChildTbl = new Array(UserTbl, DevelopTbl, DataTbl);

//リンク（親項目）
function switchLink(id, id2){
	
//	alert("wsitchLink: " + id + ", " + id2);
	
	switch(id){
		
		//製品・サービス
		case 0:
			switch(id2){
				case 0:				//ユーザ向け(一時的にパス変更）
					return("http://www.act-inc.jp/user/index.html");
					break;
				case 1:				//開発者向け(一時的にパス変更）
					return("http://www.act-inc.jp/develop/index.html");
					break;
				case 2:				//データ販売(一時的にパス変更）
					return("http://www.act-inc.jp/data/index.html");
					break;
				default:
					break;
			}
			break;

		//サポート
		case 1:
			switch(id2){
				case 0:				//FAQ (一時的にパス変更）
					return("http://www.act-inc.jp/faq/index.html");
					break;
				case 1:				//サービスメンテナンス情報(一時的にパス変更）
					return("http://www.act-inc.jp/asp/index.html");
					break;
				case 2:				//ダウンロード (一時的にパス変更）
					return("http://www.act-inc.jp/dl/index.html");
					break;
				case 3:				//お問い合わせ (一時的にパス変更）
					return("https://secure01.hs.kddi.ne.jp/act-inc.co.jp/inquire.html");
					break;
				default:
					break;
			}
			break;

		default:
			break;
	}
}

//リンク（子項目）
function switchLink2(id, id2){
	
//	alert("wsitchLink2: " + id + ", " + id2);
	
	switch(id){
		
		//ユーザ向け
		case 0:
			switch(id2){
				case 0:				//距離計算クライアント
					return("http://www.act-inc.jp/user/product/smd.html");
					break;
				case 1:				//距離計算ワークシート
					return("http://www.act-inc.jp/user/product/xls.html");
					break;
				case 2:				//距離計算ワークシート　２点間計算対応版
					return("http://www.act-inc.jp/user/product/xls2.html");
					break;
				case 3:				//距離計算パッケージ
					return("http://www.act-inc.jp/user/product/std.html");
					break;
				case 4:				//簡易配車インタフェース
					return("http://www.act-inc.jp/user/product/rps.html");
					break;
				case 5:				//エコエコカルク
					return("http://www.act-inc.jp/user/product/co2.html");
					break;
				default:
					break;
			}
			break;

		//開発者向け
		case 1:
			switch(id2){
				case 1:				//距離計算パッケージ
					return("http://www.act-inc.jp/develop/product/sdk.html");
					break;
				case 2:				//コア
					return("http://www.act-inc.jp/develop/product/ent.html");
					break;
				case 0:				//サービス
					return("http://www.act-inc.jp/develop/product/asp.html");
					break;
				case 3:				//位置検索
					return("http://www.act-inc.jp/develop/product/dk.html");
					break;
				default:
					break;
			}
			break;
			
		//データ販売
		case 2:
			switch(id2){
				case 0:				//県庁・市区町村データ
					return("http://www.act-inc.jp/data/pref.html");
					break;
				default:
					break;
			}
			break;

		default:
			break;
	}
}

//親項目表示(一時的にパス変更）
function writeRMenu(id, id2, id3){
	
//	alert("writeRMenu: " + id + ", " + id2 + ", " + id3);
	
    document.write("<table cellpadding=0 cellspacing=0 style=\"margin:3px 0px 3px 0px;\"><tr height=93><td>");
    document.write("<a href=\"http://www.act-inc.jp/function/index.html\"><img src=\"http://www.act-inc.jp/img/funclogo.gif\" border=0></a></td></tr>");
    
	for(k=0; k<ParentTbl.length; k++){
		if(k==0){
		    document.write("<tr><td bgcolor=\"#ffffff\"><b>製品・サービス</b></td></tr>");
		} else {
		    document.write("<tr><td bgcolor=\"#ffffff\"><b>サポート</b></td></tr>");
		}

		document.write("<table border=0 bgcolor=\"#444444\" cellspacing=0 cellpadding=0 width=150><tr><td>");
		document.write("<table border=0 cellspacing=1 cellpadding=3>");
		
		for(i=0; i<ParentTbl[k].length; i++){
			
				if((i==id)&&(k==id3)){
					if(id2!=99){
						document.write(
							"<tr><td class=menu-right-noselect><a href=\"", switchLink(k, i), "\" class=rmenu>",
							ParentTbl[k][i],
							"</a></td></tr>"
							);
							RMenuChildWrite(id, id2);
					} else {
						document.write(
							"<tr><td class=menu-right-select><a href=\"", switchLink(k, i), "\" class=rmenu>",
							ParentTbl[k][i],
							"</a></td></tr>"
							);
							if(k==0){
								RMenuChildWrite(id);
							}
					}
					continue;
				}
				
			document.write(
				"<tr><td class=menu-right><a href=\"", switchLink(k, i), "\" class=rmenu>",
				ParentTbl[k][i],
				"</a></td></tr>"
				);
		}
		
		document.write("</table></td></tr>");
		
	}
		
	document.write("</table>");

}

//子項目表示（製品・サービス）
function RMenuChildWrite(id, id2){
	
//	alert("RMenuChildWrite: " + id + ", " + id2);

	for(j=0; j<ChildTbl[id].length; j++){
		if(j==id2){
			document.write(
				"<tr><td class=menu-right2-select><a href=\"", switchLink2(id, j), "\" class=rmenu>",
				ChildTbl[id][j],
				"</a></td></tr>"
				);
			continue;
		}

		document.write(
			"<tr><td class=menu-right2><a href=\"", switchLink2(id, j), "\" class=rmenu>",
			ChildTbl[id][j],
			"</a></td></tr>"
			);
	}
}

/*
 *
 *      右肩機能メニュー
 *
 */

sw = new Array("<td class=func-of>", "<td class=func-on>");

// 機能一覧
function writeUsersFunction(material) {
	
	aend = new Array("", "</a>");
	func_name = new Array("ルート計算", "区間距離表", "地図表示", "最短ルート計算", "地図分割", "住所検索", "到達圏計算", "速度変更", "配車機能", 
	"流入圏計算", "道路編集");
			
	switch(material){
		case "std":
			FuncSwTbl = new Array( 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1 );
			break;
		case "smd":
			FuncSwTbl = new Array( 1, 1, 1, 1, 0, 1, 1, 0, 0, 1, 0 );
			break;
		case "xls":
			FuncSwTbl = new Array( 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 0 );
			break;
		case "rps":
			FuncSwTbl = new Array( 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1 );
			break;
		default:
			break;
	}
	    
	document.write("<table cellpadding=0 cellspacing=0 heitht=78 width=300 border=0>");
	for(i=0; i<11; i++){
		if(!(i%3)){
			document.write("<tr>");
		}
		document.write(sw[FuncSwTbl[i]] + SetAnchor(i) + func_name[i] + "</td>" + aend[FuncSwTbl[i]]);
		if(!((i+1)%3)){
			document.write("</tr>");
		}
	}
	document.write("</table>");
}

//リンク先
function SetAnchor(n){
	
	linkTbl = new Array("route", "kukan", "map", "route", "div", "gio", "area", "modify", "rpsfunc", "area", "edit");
	
	if(FuncSwTbl[n]){
		return "<a href=/function/" + linkTbl[n] + ".html class=tmenu>";
	} else {
		return "";
	}
}


/*
 *
 *      ロゴ＆ロゴ脇メニュー
 *
 */
function writeLogo(){
	document.write("<tr class=logo><td></td></tr>");
	document.write("<tr height=23><td><table border=0 margin=0 cellpadding=0 cellspasing=0 width=100%><tr valign=\"top\">");
	document.write("<td><img src=\"http://www.act-inc.jp/img/s.png\" width=\"10\"></td>");
	document.write("<td align=left><a href=\"http://www.act-inc.jp/index.html\"><img src=\"http://www.act-inc.jp/img/logo.gif\" alt=\"アドバンスド・コア・テクノロジー\"  border=\"0\"></a></td>");
	document.write("<td valign=bottom align=right class=submenu>");
	document.write("<a href=\"http://www.act-inc.jp/sitemap.html\">サイトマップ</a>");
	document.write(" | <a href=\"http://www.act-inc.jp/company/index.html\">会社概要</a>");
	document.write(" | <a href=\"http://www.act-inc.jp/company/policy.html\">プライバシーポリシー</a>");
	document.write(" | <a href=\"http://www.act-inc.jp/link.html\">関連ホームページ</a>");
	document.write(" | <a href=\"http://www.act-inc.jp/index.html\">トップページ</a></td>");
	document.write("</tr></table></td></tr>");
}

