//共通メニューの表示項目
hmenu_dir = new Array('', '/news', '/shibuya', '/product', '/proshop', '/archery');

smenu_lnk = new Array(hmenu_dir.length);
smenu_lnk[0] = '';
smenu_lnk[1] = new Array('index', 'product');
smenu_lnk[2] = '';
smenu_lnk[3] = new Array('index', 'record01', 'record02', 'success', 'catalog', 'nationwide');
smenu_lnk[4] = new Array('index', 'index#akihabara', 'point', 'faq', 'event', 'shop');
smenu_lnk[5] = new Array('index', 'term', 'list', 'competition');

function written_common(current_dir) {
	var rtn = '';
	var chk;
	var top_dir = 'http://shibuya-archery.com';
//	top_dir = 'http://shibuya-archery.com/tmp';

//ヘッダーメニューの書き込み
	rtn += '<div id="h_link"><a href="' + top_dir + '/recruit/index.html">■会社情報</a>　　　<a href="' + top_dir + '/link/index.html">■リンク集</a></div>';
	rtn += '<img src="' + top_dir + '/img/line.gif" width="800" height="3" id="h_line" />';
	rtn += '<ul>';
	for (x = 0; x < hmenu_dir.length; x ++) {
		rtn += '<li id="h_menu' + x + '" class="h_menu" onmouseover="lst_view(this, 1)" onmouseout="lst_view(this, 0)">';
		if (hmenu_dir[x] == '/' + current_dir || hmenu_dir[x] == current_dir) {
			chk = 1;
		} else {
			chk = 0;
		}
		if (x == 0) {
			rtn += '<a href="' + top_dir + '/j_index.html">';
		} else {
			rtn += '<a href="' + top_dir + hmenu_dir[x] + '/index.html">';
		}
		rtn += '<img src="' + top_dir + '/img/header/hmenu' + x + chk + '.gif" /></a>';

		if (smenu_lnk[x].length > 0) {
			rtn += '<div id="s_menu' + x + '" class="s_menu">';
			for (y = 0; y < smenu_lnk[x].length; y ++) {
				if (smenu_lnk[x][y].match(/#/)) {
					smenu_lnk[x][y] = smenu_lnk[x][y].replace("#", ".html#")
				} else {
					smenu_lnk[x][y] += ".html"
				}
				rtn += '<a href="' + top_dir + hmenu_dir[x] + '/' + smenu_lnk[x][y] + '">';
				rtn += '<img src="' + top_dir + '/img/header/smenu' + x + y + '.gif" /></a>';
			}
			rtn += '</div>';
		}
		rtn += '</li>';
	}
	rtn += '</ul>';

	document.getElementById('h_menu').innerHTML = rtn;

//フッターコピーライトの書き込み
	rtn  = '<img src="' + top_dir + '/img/line.gif" width="800" height="3" /><br />';
	rtn += '<img src="' + top_dir + '/img/spacer.gif" width="10" height="18" class="img_middle" />';
	rtn += '<span class="en">Copyright(C) 2003-2010 - All rights reserved by YASUI&amp; CO.　</span>';
	rtn += '弊社WWWサーバーが提供する情報・画像等を、権利者の許可なく複製、転用、販売などの二次利用をすることを、固く禁じます。';

	document.getElementById('f_copy').innerHTML = rtn;
}

function lst_view(obj, chk) {
	obj = obj.getElementsByTagName("div");
	if (obj.length == 0) { return false; }

	if (chk) {
		obj.item(0).style.display = "block";
	} else {
		obj.item(0).style.display = "none";
	}
}

function uri_lastdir(uri) {
	x = uri.lastIndexOf("/");
	y = uri.lastIndexOf("/", x - 1);

	return uri.substring(x, y);
}


