//////////////////////////////////////////////////////////////////
//
//================================================================
// KOKUYO --- JavaScript
//            Copyright 2004 CATWALK,Inc. All rights reserved.
//            http://www.web-kyoto.com
//================================================================
//
// 2006年12月6日 S&T用にカスタマイズ。
// 2009年1月21日 リニューアルに伴い、改変。
// 
// 2009年6月～7月　ヘッダー部分の回収作業の為改変
// 
// *MEMO 旧カテゴリ*
//  category01 = 商品情報
//  category02 = ソリューション紹介
//  category03 = 使う！楽しむ！（090223のリニューアル後は未使用）
//  category04 = コミュニティ（090223のリニューアル後は未使用）
//  category05 = コクヨの取り組み（090223のリニューアル後は未使用）
//  category06 = 企業情報
//
//////////////////////////////////////////////////////////////////

// 090223 追記
// 文字サイズ変更用CSSの読み込み
document.write('<link rel="alternate stylesheet" type="text/css" href="/common/css/big.css" title="big">');
document.write('<link rel="alternate stylesheet" type="text/css" href="/common/css/medium.css" title="medium">');
document.write('<link rel="alternate stylesheet" type="text/css" href="/common/css/small.css" title="small">');
// 画像ロールオーバー用JS：styleswicher.jsの読み込み
document.write('<script type="text/javascript" src="/common/js/rollover.js"></script>');
// 文字サイズ変更用JS：styleswicher.jsの読み込み
document.write('<script type="text/javascript" src="/common/js/styleswitcher.js"></script>');

//////////////////////////////////////////////////////////////////
// HEADER書き出しメソッド
//////////////////////////////////////////////////////////////////

function WriteHeader(pos) {
	// HEADER書き出し
	// if(pos == "category02") {
	//	 document.write('<div id="hd" class="solution">');
	// }
	// else {
	//	 document.write('<div id="hd">');
	// }


	if(pos == "index" || pos == "solution" || pos == "company" || pos == "stationery" || pos == "category06") {

	var category01 = '<li><a href="/stationery/index.html"><img src="/common/image/global_navi02_n.gif" alt="商品情報"></a></li>';
	var category02 = '<li><a href="/solution/index.html"><img src="/common/image/global_navi03_n.gif" alt="法人のお客様"></a></li>';
	var category06 = '<li><a href="/company/index.html"><img src="/common/image/global_navi01_n.gif" alt="企業情報"></a></li>';
	var mode = '';

	// 変数によって場合分け
	if(pos == "stationery") {
		category01 = '<li><a href="/stationery/index.html"><img src="/common/image/global_navi02_r.gif" alt="商品情報"></a></li>';
	} else 
		
	if(pos == "solution") {
		category02 = '<li><a href="/solution/index.html"><img src="/common/image/global_navi03_r.gif" alt="法人のお客様"></a></li>'
	} else
	
	if(pos == "company") {
		category06 = '<li><a href="/company/index.html"><img src="/common/image/global_navi01_r.gif" alt="企業情報"></a></li>';
	}

	if(pos == "stationery") {
		mode = '';
	} else 
		
	if(pos == "solution" || pos == "category02") {
		mode = 'solution'
	} else
	
	if(pos == "company" || pos == "category06") {
		mode = 'company';
	}

	document.write('<div id="hd" class="',mode,'">\
		<div class="mainlogo">\
			<div class="wrap">\
				<h1 class="logo"><a href="/"><img src="/common/image/logo_img_01.png" width="139" height="33" alt="KOKUYO ひらめき・はかどり・ここちよさ"></a></h1>\
					<p class="company_name"><img src="/common/image/main_header_img_01.png" width="129" height="13" alt="コクヨS&amp;T株式会社"></p>\
					<ul class="navi">\
						<li><a href="/inquiry/"><img src="/common/image/main_header_img_02.png" width="85" height="10" alt="お客さま相談室"></a></li>\
						<li><a href="/sitemap/"><img src="/common/image/main_header_img_03.png" width="83" height="10" alt="サイトマップ"></a></li>\
						<li><a href="http://www.kokuyo.co.jp/"><img src="/common/image/main_header_img_04.png" width="75" height="10" alt="グループトップ"></a></li>\
					</ul>\
				<form action="http://search.kokuyo.co.jp/search" method="GET" name="gs" target="_blank">\
					<input value="xml_no_dtd" name="output" type="hidden">\
					<input value="date:D:L:d1" name="sort" type="hidden">\
					<input value="default_frontend" name="client" type="hidden">\
					<input value="Shift_JIS" name="ie" type="hidden">\
					<input value="Shift_JIS" name="oe" type="hidden">\
					<input value="default_frontend" name="proxystylesheet" type="hidden">\
					<input value="default_collection" name="site" type="hidden">\
					<input type="text" name="q" value="" class="txtbox"><input name="submit" type="image" src="/common/image/main_header_submit.png" alt="検索" title="検索">\
				</form>\
			</div>\
		</div>\
		<ul id="globalNavi">'
		,category01,category02,category06,
		'</ul><!--/globalNavi-->\
		<dl id="fontSize">\
			<dt><img src="/common/image/header_font_size.gif" alt="文字サイズ"></dt>\
			<dd><ul>\
				<li class="small"><a href="javascript:void(0)" onClick="setActiveStyleSheet(\'small\'); return false;">小</a></li>\
				<li class="medium"><a href="javascript:void(0)" onClick="setActiveStyleSheet(\'medium\'); return false;">中</a></li>\
				<li class="big"><a href="javascript:void(0)" onClick="setActiveStyleSheet(\'big\'); return false;">大</a></li>\
			</ul></dd>\
		</dl>\
	</div>');

	}
	else {
		// グローバルナビゲーションの設定
		var category01 = '<li><a href="/stationery/"><img src="/common/image/sub_header_nabi_01_n.png" width="81" height="25" alt="商品情報"></a></li>';
		var category02 = '<li><a href="/solution/"><img src="/common/image/sub_header_nabi_02_n.png" width="79" height="25" alt="法人のお客様"></a></li>';
		var category06 = '<li><a href="/company/"><img src="/common/image/sub_header_nabi_03_n.png" width="78" height="25" alt="企業情報"></a></li>';
		var mode = '';
		
		
		// 変数によって場合分け
		if(pos == "category01" || pos == "category01top" || pos == "category01cat") {
			category01 = '<li><a href="/stationery/"><img src="/common/image/sub_header_nabi_01_r.png" width="81" height="25" alt="商品情報"></a></li>';
		} else if(pos == "category02") {
			category02 = '<li><a href="/solution/"><img src="/common/image/sub_header_nabi_02_r.png" width="79" height="25" alt="法人のお客様"></a></li>';
			mode = 'bluehd';
		} else if(pos == "category06") {
			category06 = '<li><a href="/company/"><img src="/common/image/sub_header_nabi_03_r.png" width="78" height="25" alt="企業情報"></a></li>';
			mode = 'grayhd';
		}

		document.write('<div id="hd" class="',mode,'">\
	<div class="otherheader">\
		<div class="box01">\
			<h1 class="logo"><a href="/"><img src="/common/image/sub_logo.png" width="142" height="17" alt="KOKUYO"></a></h1>\
			<dl class="fontsize">\
				<dt><img src="/common/image/fontsize_img_01.png" width="56" height="11" alt="文字サイズ"></dt>\
				<dd>\
					<ul>\
						<li class="small" onClick="setActiveStyleSheet(\'small\'); return false;">小</li>\
						<li class="medium" onClick="setActiveStyleSheet(\'medium\'); return false;">中</li>\
						<li class="big" onClick="setActiveStyleSheet(\'big\'); return false;">大</li>\
					</ul>\
				</dd>\
			</dl>\
			<ul class="navi01">'
				,category01
				,category02
				,category06,
			'</ul>\
		</div>\
		</div>\
	</div>');
		
		

		// 商品情報用カテゴリメニュー
		if(pos == "category01") {
		document.write('\
		<div id="grovalnavi01">\
			<ul>\
				<li><a href="/stationery/cat/stationery/"><img src="/common/image/sub_header_nabi_04_n.png" alt="文具" width="90" height="29"></a></li>\
				<li><a href="/stationery/cat/note/"><img src="/common/image/sub_header_nabi_05_n.png" alt="ノート" width="90" height="29"></a></li>\
				<li><a href="/stationery/cat/file/"><img src="/common/image/sub_header_nabi_06_n.png" alt="ファイル" width="90" height="29"></a></li>\
				<li><a href="/stationery/cat/pcsupply/"><img src="/common/image/sub_header_nabi_07_n.png" alt="OA機器PC用品" width="90" height="29"></a></li>\
				<li><a href="/stationery/cat/label/"><img src="/common/image/sub_header_nabi_08_n.png" alt="プリンタ用紙関連" width="90" height="29"></a></li>\
				<li><a href="/stationery/cat/character/"><img src="/common/image/sub_header_nabi_09_n.png" alt="キャラクター&amp;シリーズ" width="90" height="29"></a></li>\
				<li><a href="/stationery/cat/hirameki/"><img src="/common/image/sub_header_nabi_10_n.png" alt="ひらめき商品" width="90" height="29"></a></li>\
				<li><a href="/stationery/cat/others/"><img src="/common/image/sub_header_nabi_11_n.png" alt="その他" width="90" height="29"></a></li>\
			</ul>\
		</div>');
		}
		else if(pos == "category01top" || pos == "category01cat") {
		document.write('');
		}
	}
}
	// 商品情報カテゴリメニュー用設定
	function WriteMenu(pos) {
		// カテゴリメニューの設定
		var catMenu01 = '<li><a href="/stationery/cat/stationery/"><img src="/common/image/sub_header_nabi_04_n.png" alt="文具" width="90" height="29"></a></li>';
		var catMenu02 = '<li><a href="/stationery/cat/note/"><img src="/common/image/sub_header_nabi_05_n.png" alt="ノート" width="90" height="29"></a></li>';
		var catMenu03 = '<li><a href="/stationery/cat/file/"><img src="/common/image/sub_header_nabi_06_n.png" alt="ファイル" width="90" height="29"></a></li>';
		var catMenu04 = '<li><a href="/stationery/cat/pcsupply/"><img src="/common/image/sub_header_nabi_07_n.png" alt="OA機器PC用品" width="90" height="29"></a></li>';
		var catMenu05 = '<li><a href="/stationery/cat/label/"><img src="/common/image/sub_header_nabi_08_n.png" alt="プリンタ用紙関連" width="90" height="29"></a></li>';
		var catMenu06 = '<li><a href="/stationery/cat/character/"><img src="/common/image/sub_header_nabi_09_n.png" alt="キャラクター&amp;シリーズ" width="90" height="29"></a></li>';
		var catMenu07 = '<li><a href="/stationery/cat/hirameki/"><img src="/common/image/sub_header_nabi_10_n.png" alt="ひらめき商品" width="90" height="29"></a></li>';
		var catMenu08 = '<li><a href="/stationery/cat/others/"><img src="/common/image/sub_header_nabi_11_n.png" alt="その他" width="90" height="29"></a></li>';
		// 変数によって場合分け
		if(pos == "catMenu01") {
			catMenu01 = '<li><a href="/stationery/cat/stationery/"><img src="/common/image/sub_header_nabi_04_r.png" alt="文具" width="90" height="29"></a></li>';
		} else if(pos == "catMenu02") {
			catMenu02 = '<li><a href="/stationery/cat/note/"><img src="/common/image/sub_header_nabi_05_r.png" alt="ノート" width="90" height="29"></a></li>';
		} else if(pos == "catMenu03") {
			catMenu03 = '<li><a href="/stationery/cat/file/"><img src="/common/image/sub_header_nabi_06_r.png" alt="ファイル" width="90" height="29"></a></li>';
		} else if(pos == "catMenu04") {
			catMenu04 = '<li><a href="/stationery/cat/pcsupply/"><img src="/common/image/sub_header_nabi_07_r.png" alt="OA機器PC用品" width="90" height="29"></a></li>';
		} else if(pos == "catMenu05") {
			catMenu05 = '<li><a href="/stationery/cat/label/"><img src="/common/image/sub_header_nabi_08_r.png" alt="プリンタ用紙関連" width="90" height="29"></a></li>';
		} else if(pos == "catMenu06") {
			catMenu06 = '<li><a href="/stationery/cat/character/"><img src="/common/image/sub_header_nabi_09_r.png" alt="キャラクター&amp;シリーズ" width="90" height="29"></a></li>';
		} else if(pos == "catMenu07") {
			catMenu07 = '<li><a href="/stationery/cat/hirameki/"><img src="/common/image/sub_header_nabi_10_r.png" alt="ひらめき商品" width="90" height="29"></a></li>';
		} else if(pos == "catMenu08") {
			catMenu08 = '<li><a href="/stationery/cat/others/"><img src="/common/image/sub_header_nabi_11_r.png" alt="その他" width="90" height="29"></a></li>';
		}
		document.write('\
		<div id="grovalnavi01">\
			<ul>',
			catMenu01,
			catMenu02,
			catMenu03,
			catMenu04,
			catMenu05,
			catMenu06,
			catMenu07,
			catMenu08,
			'</ul>\
		</div>');
}


function copy(pos) {
	if(pos == "stationery" || pos == "search") {
	document.write('<dl class="productsMenu">');
	document.write('<dt><img src="/stationery/image/title_menu.gif" alt="商品情報メニュー"></dt>');
	document.write('<dd><ul><!--');
	document.write('--><li class="arwLink"><a href="/search/sp_search.php">キーワードで探す</a></li><!--');
	document.write('--><li class="arwLink"><a href="/search/1c_search_t.php">カテゴリから探す</a></li><!--');
	document.write('--><li class="arwLink"><a href="/search/theme.html">テーマで探す</a></li><!--');
	document.write('--><li class="arwLink"><a href="/download/">サポートツール</a></li><!--');
	document.write('--><li class="arwLink"><a href="/stationery/purchase.html">購入のご案内</a></li><!--');
	document.write('--><li class="arwLink"><a href="/tekigou/">適合表</a></li><!--');
	document.write('--></ul></dd>');
	document.write('</dl><!-- /productsMenu end -->');
//	document.write('<div id="itemNavi">');
//	document.write('<p><img src="/stationery/image/fMenu.gif" alt="商品情報メニュー">&nbsp;&nbsp;<a href="/search/1c_search_t.php">カテゴリ一覧</a>&nbsp;&nbsp;<a href="/search/theme.html">テーマから探す</a>&nbsp;&nbsp;<a href="/download/">サポートツール</a>&nbsp;&nbsp;<a href="/enjoy/">キャンペーン・楽しむ</a>&nbsp;&nbsp;<a href="/stationery/purchase.html">購入のご案内</a>&nbsp;&nbsp;<a href="/tekigou/">適合表</a></p>');
//	document.write('</div><!-- /itemNavi -->');
	} else {

	}
	document.write('<div id="ft">');
	document.write('<ul id="siteNavi02">');
	document.write('<li class="arwLink"><a href="/">TOP</a></li><!--');
	document.write('--><li class="arwLink"><a href="/stationery/">商品情報</a></li><!--');
	document.write('--><li class="arwLink"><a href="/solution/">法人のお客様</a></li><!--');
	document.write('--><li class="arwLink"><a href="/company/">企業情報</a></li><!--');
	document.write('--><li class="arwLink"><a href="/enjoy/">キャンペーン・楽しむ</a></li><!--');
//	document.write('--><li class="arwLink"><a href="/inquiry/">お問い合わせ</a></li><!--');
	document.write('--><li class="arwLink"><a href="/sitemap/">サイトマップ</a></li><!--');
	document.write('--></ul>');
	document.write('<div class="bgBox">');
	document.write('<ul id="siteNavi03">');
	document.write('<li class="noLine"><a href="/privacy/index.html">個人情報保護方針</a></li><!--');
	document.write('--><li><a href="/p-po/index.html">ご利用規約</a></li><!--');
	document.write('--><li><a href="/inquiry/">お客様相談室</a></li><!--');
//	document.write('--><li><a href="http://www.kokuyo.co.jp/faq/" target="_blank">お客様相談室</a></li><!--');
	document.write('--></ul>');
	document.write('<address>Copyright 2009 KOKUYO S&amp;T Co.,Ltd. All rights reserved.</address>');
	document.write('</div>');
	document.write('</div><!-- /footer end -->');
}



//// 以下は、古いメニュー用の関数群 ////

//////////////////////////////////////////////////////////////////
// 画像スワップメソッド
//////////////////////////////////////////////////////////////////
function swapImage() {
	var i;
	var j = 0;
	var args = swapImage.arguments;
	document.MM_sr = new Array;
	for(i = 0;i < (args.length - 2);i+=3)
   if((x = findObject(args[i])) != null) {
	 	document.MM_sr[j++] = x;
		if(!x.osrc)
			x.osrc = x.src;
		x.src = args[i+2];
	}
}

//////////////////////////////////////////////////////////////////
// オブジェクトのチェック
//////////////////////////////////////////////////////////////////
function findObject(n, doc) {
	var p;
	var i;
	var x;
	if(!doc)
		doc = document;
	if((p = n.indexOf("?")) > 0 && parent.frames.length) {
		doc = parent.frames[n.substring(p+1)].document;
		n = n.substring(0, p);
	}
  if(!(x = doc[n]) && doc.all)
		x = doc.all[n];
	for(i = 0;!x && i < doc.forms.length;i++)
		x=doc.forms[i][n];
  for(i = 0;!x && doc.layers && i < doc.layers.length;i++)
		x=findObject(n,doc.layers[i].document);
  if(!x && doc.getElementById)
		x = doc.getElementById(n);
	return x;
}

//////////////////////////////////////////////////////////////////
// 画像の読み込み
//////////////////////////////////////////////////////////////////
function _preload() {
	var doc = document;
	if(doc.images) {
		if(!doc.MM_p)
			doc.MM_p=new Array();
    var i;
		var j = doc.MM_p.length;
		var args = _preload.arguments;
		for(i = 0;i < args.length;i++) {
			if(args[i].indexOf("#") != 0) {
				doc.MM_p[j] = new Image;
				doc.MM_p[j++].src = args[i];
			}
		}
	}
}

//////////////////////////////////////////////////////////////////
// 画像のリストア
//////////////////////////////////////////////////////////////////
function _restore() {
	var i;
	var x;
	var args = document.MM_sr;
	for(i = 0;args && i < args.length && (x = args[i]) && x.osrc;i++)
		x.src=x.osrc;
}
