//////////////////////////////////////////////////////////////////
//
//================================================================
// KOKUYO --- JavaScript
//            Copyright 2004 CATWALK,Inc. All rights reserved.
//            http://www.web-kyoto.com
//================================================================
//
// 右メニュー部分記述用JavaScript
// Created by CATWALK（三原比呂美）
// 2005年03月12日
// このスクリプトに対するお問い合わせは
// 三原　比呂美：hiromi@web-kyoto.com
// 宛に願います。
//
//////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////
// 変数保持オブジェクト
//////////////////////////////////////////////////////////////////
function LinkObject(title, name, url) {
	this.title = title;
	this.name = name;
	this.url = url;
}

//////////////////////////////////////////////////////////////////
// RIGHT MENU書き出しメソッド
//////////////////////////////////////////////////////////////////
function CWShowRightNavigationMenu(nowurl) {
	var objArray = new Array();
	objArray.push(new LinkObject("ユニバーサルデザインTOP", "", "/yokoku/ud/index.html"));
	objArray.push(new LinkObject("コクヨのユニバーサルデザイン", "", "/yokoku/ud/aboutud/index.html"));
	objArray.push(new LinkObject("コクヨのユニバーサルデザイン", "ユニバーサルデザインとは", "/yokoku/ud/aboutud/ud.html"));
	objArray.push(new LinkObject("コクヨのユニバーサルデザイン", "ロン・メイスの7原則", "/yokoku/ud/aboutud/ud_principle.html"));
	objArray.push(new LinkObject("コクヨのユニバーサルデザイン", "コクヨ6つの要件", "/yokoku/ud/aboutud/ud_requirements.html"));
	objArray.push(new LinkObject("製品で見るユニバーサルデザイン", "", "/yokoku/ud/products/index.html"));
	objArray.push(new LinkObject("製品で見るユニバーサルデザイン", "基本がしっかり", "/yokoku/ud/products/category01.html"));
	objArray.push(new LinkObject("製品で見るユニバーサルデザイン", "五感で伝わる", "/yokoku/ud/products/category02.html"));
	objArray.push(new LinkObject("製品で見るユニバーサルデザイン", "安全・安心", "/yokoku/ud/products/category03.html"));
	objArray.push(new LinkObject("製品で見るユニバーサルデザイン", "使い方がわかる", "/yokoku/ud/products/category04.html"));
	objArray.push(new LinkObject("製品で見るユニバーサルデザイン", "ラクにつかえる", "/yokoku/ud/products/category05.html"));
	objArray.push(new LinkObject("体験するユニバーサルデザイン", "申し込みフォーム", "/yokoku/ud/experience/index.html"));
	objArray.push(new LinkObject("体験するユニバーサルデザイン", "出張授業のご案内", "/yokoku/ud/experience/info.html"));
	objArray.push(new LinkObject("体験するユニバーサルデザイン", "出張授業の申し込み", "/yokoku/ud/experience/privacy.html"));
	objArray.push(new LinkObject("体験するユニバーサルデザイン", "ショールーム 、校外学習コースのご案内", "/yokoku/ud/experience/sr_info.html"));
	objArray.push(new LinkObject("こうして生まれたユニバーサルデザイン", "", "/yokoku/ud/story/index.html"));
	objArray.push(new LinkObject("こうして生まれたユニバーサルデザイン", "フィットカーブ", "/yokoku/ud/story/story1.html"));
	objArray.push(new LinkObject("こうして生まれたユニバーサルデザイン", "プニョプニョピン", "/yokoku/ud/story/story2.html"));
	objArray.push(new LinkObject("ネット購入窓口", "", "/yokoku/ud/purchase/index.html"));
	

	
	// 選択されているURLからオブジェクトを取得
	var select_obj = null;
	for(var i = 0;i < objArray.length;i++) {
		var obj = objArray[i];
		if(obj.url == nowurl) {
			select_obj = obj;
			break;
		}
	}
	// メニュー部分の吐き出し
	var btitle = "";
	for(var i = 0;i < objArray.length;i++) {
		var obj = objArray[i];
		var flag = 0;
		
		// タイトルが異なる場合はフラグを設定
		if(btitle != obj.title) {
			if(btitle != "") {
				flag = 2;
			} else {
				flag = 1;
			}
			btitle = obj.title;
		}
		
		// 選択オブジェクトと同じタイトルかどうか
		var check = 0;
		if(select_obj.title == obj.title) {
			check = 1;
		}
		// フラグが設定されている場合はクラスを書き出し
		if(flag) {
			if(flag == 2) {
				document.write('</div>');
			}
			document.write('<div class="mnc">');
			if(obj.url == nowurl) {
				document.write('<div class="mnnow"><b>' + obj.title + '</b></div>');
			} else if ( obj.title == select_obj.title ) {
				document.write('<div class="mnnow"><a href="' + obj.url + '"><b>' + obj.title + '</b></a></div>');
			} else {
				document.write('<div class="mnd"><a href="' + obj.url + '"><b>' + obj.title + '</b></a></div>');
			}

		// フラグが設定されていない場合はサブクラス
		} else {
			if(check) {
				if(obj.url == nowurl) {
					document.write('<div class="mnnows">' + obj.name + '</div>');
				} else {
					document.write('<div class="mn"><a href="' + obj.url + '">' + obj.name + '</a></div>');
				}
			}
		}
	}
	// メニューを閉じるためのDIVタグ
	document.write('</div>');
}

