// JavaScript Document

// 20100910_トップページ、活動報告をindex.htmlからindex.phpに変更

//配列の初期設定
var gmenu = new Array();
var gmenu_key = new Array();
var gmenu_style = new Array();
var gmenu_sub = new Array();


/**** グローバルメニュー　キー ****/
gmenu_key[0] = 'home';
gmenu_key[1] = 'about';
gmenu_key[2] = 'project';
gmenu_key[3] = 'whatsnew';
gmenu_key[4] = 'information';
gmenu_key[5] = 'access';
gmenu_key[6] = 'contact';

/**** アクティブカテゴリ用スタイルシート ****/
/*
gmenu_style['home']    = '<link href="/css/home.css" rel="stylesheet" type="text/css">';
gmenu_style['about']      = '<link href="/css/about.css" rel="stylesheet" type="text/css">';
gmenu_style['project']      = '<link href="/css/project.css" rel="stylesheet" type="text/css">';
gmenu_style['flashnews']   = '<link href="/css/flashnews.css" rel="stylesheet" type="text/css">';
gmenu_style['information']     = '<link href="/css/information.css" rel="stylesheet" type="text/css">';
gmenu_style['access']   = '<link href="/css/access.css" rel="stylesheet" type="text/css">';
gmenu_style['contact']      = '<link href="">';
*/

/**** HOMEメニュー ****/
gmenu_sub['home']  = new Array();
gmenu['home']    = '<a class="MenuBarItemSubmenu" href="http://www.jilaf.or.jp/index.php">HOME</a>';

/**** JILAFについてメニュー ****/
gmenu_sub['about']  = new Array();
gmenu['about']    = '<a class="MenuBarItemSubmenu" href="http://www.jilaf.or.jp/about/index.html">JILAFについて</a>';

/**** 主な事業メニュー ****/
gmenu_sub['project']  = new Array();
gmenu['project']    = '<a class="MenuBarItemSubmenu" href="#">主な事業</a>';
gmenu_sub['project'][0] = '<a href="http://www.jilaf.or.jp/jinbutu/index.html">人物招聘</a>';
gmenu_sub['project'][1] = '<a href="http://www.jilaf.or.jp/genpro/index.html">現地支援</a>'; 
gmenu_sub['project'][2] =  '<a href="http://www.jilaf.or.jp/jinzai/index.html">人材育成</a>';
gmenu_sub['project'][3] =  '<a href="http://www.jilaf.or.jp/report/index.html">広報</a>';

/**** FLASHNEWSメニュー ****/
gmenu_sub['whatsnew']  = new Array();
gmenu['whatsnew']    = '<a class="MenuBarItemSubmenu" href="http://www.jilaf.or.jp/newsflash/index.php">Whats New</a>';

/**** インフォメーションメニュー ****/
gmenu_sub['information']  = new Array();
gmenu['information']    = '<a class="MenuBarItemSubmenu" href="#">インフォメーション</a>';
gmenu_sub['information'][0] = '<a href="http://www.jilaf.or.jp/mail/index.html">JILAFメールマガジン</a>';
gmenu_sub['information'][1] = '<a href="http://www.jilaf.or.jp/rodojijyo/index.html">海外の労働事情</a>';
gmenu_sub['information'][2] = '<a href="http://www.jilaf.or.jp/genpro/positive/index.html">POSITIVE</a>';
gmenu_sub['information'][3] = '<a href="http://www.jilaf.or.jp/kouryu/index.html">国際交流チームの派遣</a>';
/*gmenu_sub['information'][4] = '<a href="/information/equality/index.html">支援団体一覧</a>';
gmenu_sub['information'][5] = '<a href="/information/library/index.html">交流国一覧</a>';
gmenu_sub['information'][6] = '<a href="/information/link/index.html">JILAF紹介動画</a>';
*/

/**** ACCESSメニュー ****/
gmenu_sub['access']  = new Array();
gmenu['access']    = '<a class="MenuBarItemSubmenu" href="http://www.jilaf.or.jp/about/map.html">アクセス</a>';

/**** お問い合わせメニュー ****/
gmenu_sub['contact']  = new Array();
gmenu['contact']    = '<a class="MenuBarItemSubmenu" href="mailto:info&#64;&#106;i&#108;af&#46;or.&#106;p">お問い合わせ</a>';



/******************************************************************************
グローバルメニューの出力
******************************************************************************/

function dispGmenu(tab){
	if(tab){
		document.write(gmenu_style[tab]);
	}
document.write('<ul id="GlobalMenuBar" class="MenuBarHorizontal">');
	for(i=0; i<gmenu_key.length; i++){
			document.write('<li id="gmenu_'+gmenu_key[i]+'_id" class="gmenu_'+gmenu_key[i]+'">');
			document.write(gmenu[gmenu_key[i]]);
			document.write('<ul onMouseOver="changeClass(\'gmenu_'+gmenu_key[i]+'_id\',\'gmenu_'+gmenu_key[i]+'_hover\');"  onMouseOut="changeClass(\'gmenu_'+gmenu_key[i]+'_id\',\'gmenu_'+gmenu_key[i]+'\');">');
				for(j=0; j<gmenu_sub[gmenu_key[i]].length; j++){
					document.write('<li class="gmenu_'+gmenu_key[i]+'_'+j+'">'+gmenu_sub[gmenu_key[i]][j]+'</li>');
				}
			document.write('</ul>');
			document.write('</li>');
	}
document.write('</ul>');

/**ソース出力

			document.write('<br />');
			document.write('<br />');
	if(tab){
		document.write('&lt;link href="/css/'+tab+'.css" rel="stylesheet" type="text/css"&gt;');
			document.write('<br />');
	}
document.write('&lt;ul id="GlobalMenuBar" class="MenuBarHorizontal"&gt;');
			document.write('<br />');
	for(i=0; i<gmenu_key.length; i++){
			document.write('&lt;li class="gmenu_'+gmenu_key[i]+'"&gt;');
			document.write('<br />');
			document.write(gmenu[gmenu_key[i]]);
			document.write('<br />');
			document.write('&lt;ul&gt;');
			document.write('<br />');
				for(j=0; j<gmenu_sub[gmenu_key[i]].length; j++){
					document.write('&lt;li class="gmenu_'+gmenu_key[i]+'_'+j+'"&gt;'+gmenu_sub[gmenu_key[i]][j]+'&lt;/li&gt;');
			document.write('<br />');
				}
			document.write('&lt;/ul&gt;');
			document.write('<br />');
			document.write('&lt;/li&gt;');
			document.write('<br />');
	}
document.write('&lt;/ul&gt;');
			document.write('<br />');


**/




//Spryのプルダウンメニューを実行
var GlobalMenuBar = new Spry.Widget.MenuBar("GlobalMenuBar", {imgDown:"js/SpryMenuBarDownHover.gif", imgRight:"js/SpryMenuBarRightHover.gif"});

}


//プルダウン時に親メニューの背景classを変更する
function changeClass(i,c){
 if(document.all) document.all(i).className=c;
 else if(document.getElementById)
  document.getElementById(i).className=c;
}







