//メニュー関連設定#########################################
//メニューID一覧
var all_menu = new Array('home','event','releases','webstore','contact','submenu_releases','submenu_webstore','about','links','lang');

//ページトップのURL
var top_url='http://www.weirdtruth.jp/';

//メニュー作成
function makeMainMenu(lang){
	var langflag = '';
	if(lang == 'jp'){
		langflag = '_j';
	}
	
	var table ='';
	
	table += "<div id=\"home\" onmouseover=\"alteringVisions('home','on');\" onmouseout=\"alteringVisions('home');\"><a href=\"" + top_url + "home/index" + langflag + ".html\"><img src=\"" + top_url + "misc/images/menu/home.jpg\" width=\"37\" height=\"25\" alt=\"Home\" /></a></div>\n";
	table += "<div id=\"event\" onmouseover=\"alteringVisions('event','on');\" onmouseout=\"alteringVisions('event');\"><a href=\"" + top_url + "event/index" + langflag + ".html\"><img src=\"" + top_url + "misc/images/menu/event.jpg\" width=\"32\" height=\"25\" alt=\"event\" /></a></div>\n";
	table += "<div id=\"releases\" onmouseover=\"alteringVisions('releases','on','on');\" onmouseout=\"alteringVisions('releases');\"><a href=\"" + top_url + "releases/index" + langflag + ".html\"><img src=\"" + top_url + "misc/images/menu/releases.jpg\" width=\"47\" height=\"25\" alt=\"releases\" /></a></div>\n";
	table += "<div id=\"webstore\" onmouseover=\"alteringVisions('webstore','on','on');\" onmouseout=\"alteringVisions('webstore');\"><a href=\"" + top_url + "cgi-bin/webstore/store" + langflag + ".cgi\"><img src=\"" + top_url + "misc/images/menu/webstore.jpg\" width=\"59\" height=\"25\" alt=\"web store\" /></a></div>\n";
	table += "<div id=\"contact\" onmouseover=\"alteringVisions('contact','on');\" onmouseout=\"alteringVisions('contact');\"><a href=\"" + top_url + "cgi-bin/contact/form" + langflag + ".cgi\"><img src=\"" + top_url + "misc/images/menu/contact.jpg\" width=\"46\" height=\"25\" alt=\"contact\" /></a></div>\n";

	table += "<map name=\"mainmenu\" id=\"mainmenu\">\n";
	table += "<area shape=\"rect\" coords=\"189,70,226,95\" href=\"" + top_url + "home/index" + langflag + ".html\" onmouseover=\"alteringVisions('home','on');\" alt=\"home\" />\n";
	table += "<area shape=\"rect\" coords=\"246,70,278,95\" href=\"" + top_url + "event/index" + langflag + ".html\" onmouseover=\"alteringVisions('event','on');\" alt=\"event\" />\n";
	table += "<area shape=\"rect\" coords=\"293,70,340,95\" href=\"" + top_url + "releases/index" + langflag + ".html\" onmouseover=\"alteringVisions('releases','on','on');\" alt=\"releases\" />\n";
	table += "<area shape=\"rect\" coords=\"356,70,415,95\" href=\"" + top_url + "cgi-bin/webstore/store" + langflag + ".cgi\" onmouseover=\"alteringVisions('webstore','on','on');\" alt=\"web store\" />\n";
	table += "<area shape=\"rect\" coords=\"429,70,475,95\" href=\"" + top_url + "cgi-bin/contact/form" + langflag + ".cgi\" onmouseover=\"alteringVisions('contact','on');\" alt=\"contact\" />\n";
	table += "</map>\n";

	table += "<div id=\"submenu_releases\" class=\"submenu\" onmouseover=\"alteringVisions('releases','on','on');\" onmouseout=\"alteringVisions('submenu_releases');\">\n";
	table += "<ul>\n";
	table += "<li><a href=\"" + top_url + "releases/index" + langflag + ".html\">Current Releases</A></li>\n";
	table += "<li><a href=\"" + top_url + "releases/soldout" + langflag + ".html\">Sold Out Releases</A></li>\n";
	table += "</ul>\n";
	table += "</div>\n";
	
	table += "<div id=\"submenu_webstore\" class=\"submenu\" onmouseover=\"alteringVisions('webstore','on','on');\" onmouseout=\"alteringVisions('submenu_webstore');\">\n";
	table += "<ul>\n";
	table += "<li><a href=\"" + top_url + "cgi-bin/webstore/store" + langflag + ".cgi\">Web Store Top</A></li>\n";
	table += "<li><a href=\"" + top_url + "cgi-bin/webstore/store" + langflag + ".cgi?pmode=list&selected_category=wtp\">WTP Releases</A></li>\n";
	table += "<li><a href=\"" + top_url + "cgi-bin/webstore/store" + langflag + ".cgi?pmode=list&selected_category=cd\">CD</A></li>\n";
	table += "<li><a href=\"" + top_url + "cgi-bin/webstore/store" + langflag + ".cgi?pmode=list&selected_category=vinyl\">Vinyl</A></li>\n";
	table += "<li><a href=\"" + top_url + "cgi-bin/webstore/store" + langflag + ".cgi?pmode=list&selected_category=tape\">Tape</A></li>\n";
	table += "<li><a href=\"" + top_url + "cgi-bin/webstore/store" + langflag + ".cgi?pmode=list&selected_category=other\">Other Stuffs</A></li>\n";
	table += "<li><a href=\"" + top_url + "cgi-bin/webstore/store" + langflag + ".cgi?pmode=showCart\">View Cart</A></li>\n";
	table += "<li><a href=\"" + top_url + "webstore/orderinfo" + langflag + ".html\">Ordering Information</A></li>\n";
	table += "</ul>\n";
	table += "</div>\n";
	
	document.write(table);
}

//フッター作成
function makeFooterMenuEN(){
	var table ='';
	
	table += "<div id=\"about\" onmouseover=\"alteringVisions('about','on');\" onmouseout=\"alteringVisions('about');\"><a href=\"" + top_url + "about/index.html\"><img src=\"" + top_url + "misc/images/footermenu/about.gif\" width=\"64\" height=\"24\" alt=\"about WTP\" /></a></div>\n";
	table += "<div id=\"links\" onmouseover=\"alteringVisions('links','on');\" onmouseout=\"alteringVisions('links');\"><a href=\"" + top_url + "links/index.html\"><img src=\"" + top_url + "misc/images/footermenu/links.gif\" width=\"25\" height=\"24\" alt=\"Links\" /></a></div>\n";
	table += "<div id=\"lang\" class=\"japanese\" onmouseover=\"alteringVisions('lang','on');\" onmouseout=\"alteringVisions('lang');\"><a href=\"" + top_url + "home/index_j.html\"><img src=\"" + top_url + "misc/images/footermenu/japanese.gif\" width=\"75\" height=\"24\" alt=\"Japanese Page\" /></a></div>\n";


	table += "<map name=\"footermenu\" id=\"footermenu\">\n";
	table += "<area shape=\"rect\" coords=\"9,0,73,24\" href=\"" + top_url + "about/index.html\" onmouseover=\"alteringVisions('about','on');\" alt=\"about WTP\" />\n";
	table += "<area shape=\"rect\" coords=\"86,0,111,24\" href=\"" + top_url + "links/index.html\" onmouseover=\"alteringVisions('links','on');\" alt=\"links\" />\n";
	table += "<area shape=\"rect\" coords=\"122,0,197,24\" href=\"" + top_url + "home/index_j.html\" onmouseover=\"alteringVisions('lang','on');\" alt=\"Japanese Page\" />\n";
	table += "</map>\n";
	
	document.write(table);
}

function makeFooterMenuJP(){
	var table ='';
	
	table += "<div id=\"about\" onmouseover=\"alteringVisions('about','on');\" onmouseout=\"alteringVisions('about');\"><a href=\"" + top_url + "about/index_j.html\"><img src=\"" + top_url + "misc/images/footermenu/about.gif\" width=\"64\" height=\"24\" alt=\"about WTP\" /></a></div>\n";
	table += "<div id=\"links\" onmouseover=\"alteringVisions('links','on');\" onmouseout=\"alteringVisions('links');\"><a href=\"" + top_url + "links/index_j.html\"><img src=\"" + top_url + "misc/images/footermenu/links.gif\" width=\"25\" height=\"24\" alt=\"Links\" /></a></div>\n";
	table += "<div id=\"lang\" class=\"english\" onmouseover=\"alteringVisions('lang','on');\" onmouseout=\"alteringVisions('lang');\"><a href=\"" + top_url + "home/index.html\"><img src=\"" + top_url + "misc/images/footermenu/english.gif\" width=\"68\" height=\"24\" alt=\"English Page\" /></a></div>\n";


	table += "<map name=\"footermenu\" id=\"footermenu\">\n";
	table += "<area shape=\"rect\" coords=\"9,0,73,24\" href=\"" + top_url + "about/index_j.html\" onmouseover=\"alteringVisions('about','on');\" alt=\"about WTP\" />\n";
	table += "<area shape=\"rect\" coords=\"86,0,111,24\" href=\"" + top_url + "links/index_j.html\" onmouseover=\"alteringVisions('links','on');\" alt=\"links\" />\n";
	table += "<area shape=\"rect\" coords=\"122,0,190,24\" href=\"" + top_url + "home/index.html\" onmouseover=\"alteringVisions('lang','on');\" alt=\"English Page\" />\n";
	table += "</map>\n";
	
	document.write(table);
}

//メニュースクリプト##############################################
//ブラウザ変数
ie = (document.all)? true:false; //IE4
ns = (document.layers)? true:false; //NN4
ns6 = (document.getElementById)? true:false; //その他モダンブラウザ


//ブラウザごとにレイヤー名を振り分け
function getLayername(layername){
	var mortalagony;

	if(ns6){
		mortalagony = document.getElementById(layername).style;
	}else if(ie){
		mortalagony = document.all[layername].style;
	}else if(ns){
		mortalagony = document.layers[layername];
	}else{
		mortalagony = false;
	}
	return mortalagony;
}

//ロールオーバー
function alteringVisions(layer_name,flag,submenuflag){
	var obj = getLayername(layer_name);
	if(flag == 'on'){
		for(var i=0;i<all_menu.length;i++){
			if(all_menu[i] != layer_name){
				var this_layer = getLayername(all_menu[i]);
				this_layer.visibility = 'hidden';
			}
		}
		obj.visibility = 'visible';
		if(submenuflag){
			var submenu_obj = getLayername('submenu_' + layer_name);
			submenu_obj.visibility = 'visible';
		}
	}else{
		obj.visibility = 'hidden';
	}
}

//カート追加###########################
function addToCart(id)
{
	document.form.pmode.value = 'addtoCart';
	document.form.selected_id.value = id;	document.form.submit();
}