<!--
//===========================================================
// 汎用関数
//===========================================================
//-----------------------------------------------
// ブラウザバージョンチェック
//-----------------------------------------------
var		env_BrowserType;
var		env_AppVersion;

function	checkBrowser()
{
	var		n = navigator.appName;			//ブラウザ名
	var		v = navigator.appVersion;		//バージョン
	
	if( n.indexOf("Netscape")!=-1 ) {			//Netscape
		env_BrowserType = "Netscape";
	}
	else if( n.indexOf("Explorer")!=-1 ) {			//MSIE
		env_BrowserType = "Explorer";
	}
	else {
		env_BrowserType = "Unknown";
		env_AppVersion  = "Unknown";
	}
}

//-----------------------------------------------
// オブジェクトのオンオフ：名前からオブジェ検索
//-----------------------------------------------
function	setObjectVisibility()
{
	var i,v,obj,args=setObjectVisibility.arguments;
	for (i=0; i<(args.length-1); i+=2) {
		if ((obj=srFindObject(args[i]))!=null) { 
			v=args[i+1];	//visibility
			if (obj.style) { 
				obj=obj.style;
				v=(v=='show') ? 'visible' : (v=='hide') ? 'hidden' : v;
			}
			obj.visibility=v;
		}
	}
}

//-----------------------------------------------
// オブジェクトのオンオフ：オブジェクト直指定
//-----------------------------------------------
function	setObjectVisibilityByObj()
{
	var i,v,obj,args=setObjectVisibilityByObj.arguments;
	for (i=0; i<(args.length-1); i+=2) {
		obj = args[i];
		if (obj!=null) { 
			v=args[i+1];	//visibility
			if (obj.style) { 
				obj=obj.style;
				v=(v=='show') ? 'visible' : (v=='hide') ? 'hidden' : v;
			}
			obj.visibility=v;
		}
	}
}

//-----------------------------------------------
// オブジェクト検索
//-----------------------------------------------
function	srFindObject(name, doc)
{	
	var	x = null;
	if( !doc ) doc=document;
	if( document.getElementById(name) ) x=document.getElementById(name);	//IE5.x,NN6.xのメソッド
	if( !(x==doc[name]) && doc.all ) 	x=doc.all[name];					//IE4.x IE5.xのスタイルシート
//    for(i=0; !x && i<doc.forms.length; i++) x=doc.forms[i][name];			//Formオブジェクトを探す場合
    for(i=0; !x && i<doc.links.length; i++) x=doc.links[name];		//Formオブジェクトを探す場合
    for(i=0; !x && doc.layers && i<doc.layers.length ;i++ ) x=srFindObject(name, doc.layers[i].document);	//NN4.xのレイヤーオブジェクト
    return x;
}


//-----------------------------------------------
// 既にリンク状態にする    2002/10/26            
//-----------------------------------------------
function   srPrintLinkSideMenu(title, id, format)
{
	if( id < 10 ) {
		lname = "link0" + id;
		iname = "title0" + id;
	}
	else {
		lname = "link" + id;
		iname = "title" + id;
	}
	if((obj=srFindObject(lname))!=null) {
		if( format!=null ) {
			if ( format.charAt(0)=='j' ) {
				cImageSideMenu(title, id, 'navi')
			}
			else {
				gcImageSideMenu(title, id, 'navi')
			}
		}
		else {
			//旧タイプ対応
			gcImageSideMenu(title, id, 'navi')
		}
		if( obj.href )        obj.href        = "#";
		if( obj.onmouseover ) obj.onmouseover = "";
		if( obj.onmouseout )  obj.onmouseout  = "";
//		obj.style        = "cursor:default;";
	}
	else if(srFindObject(iname)) {
		if( format!=null ) {
			if ( format.charAt(0)=='j' ) {
				cImageSideMenu(title, id, 'navi')
			}
			else {
				gcImageSideMenu(title, id, 'navi')
			}
		}
		else {
			//旧タイプ対応
			gcImageSideMenu(title, id, 'navi')
		}
	}
}



//===========================================================
// 直イメージ変更関数:jpg
// Netscape 4.xには未対応：imgタグにonMouseイベントが無い為
//===========================================================
function	srChangeMyself(obj, path, name, onoff)
{
	if( onoff == 'on' ) {
		obj.src = "/top/" + path + "/images/" + name + "_a.jpg";
	}
	else {
		obj.src = "/top/" + path + "/images/" + name + "_s.jpg";
	}
}


//===========================================================
// 直イメージ変更関数:gif
// Netscape 4.xには未対応：imgタグにonMouseイベントが無い為
//===========================================================
function	gsrChangeMyself(obj, path, name, onoff)
{
	if( onoff == 'on' ) {
		obj.src = "/top/" + path + "/images/" + name + "_a.gif";
	}
	else {
		obj.src = "/top/" + path + "/images/" + name + "_s.gif";
	}
}


//===========================================================
// メニューシステム
//===========================================================
//-----------------------------------------------
// Menuオブジェクトのメソッド定義
//-----------------------------------------------
var	NowVisible	= null;
var	NowHidden 	= null;
var	timeID 		= null;
var browser 	= getBrowserName();
var version 	= parseInt(navigator.appVersion);

//-----------------------------------------------
// Menuへのアイテム追加
//-----------------------------------------------
function	addMenuItem(text, uri)
{
	var	idname = this.name + this.items.length;
	
	//IEはcursor:hand、NNはcursor:pointer。もうやだ。
   	document.write("<DIV id='"+idname+"' style='background-color:#333333; cursor:hand; position:absolute; left:"+this.left+"px; top:"+eval(this.top+this.items.length*this.height)+"px; width:"+this.width+"; visibility:hidden;' onmouseOver='onMOver(this,window."+this.name+", \""+uri+"\")' onmouseOut='onMOut(this,window."+this.name+")' onmouseDown='onMDown(this,window."+this.name+")' onmouseUp='onMUp(this,window."+this.name+")' onClick='location.href=\""+uri+"\"'>");
	document.write("<TABLE class='menu1' border=0 cellpadding=0 cellspacing=0 width="+this.width+">");
	document.write("<TR><TD style='color:white;'>");
//	document.write("<A href='"+uri+"'>");
	document.write("&nbsp;&nbsp;"+text);
//  document.write("</A>");
   	document.write("</TD></TR></TABLE></DIV>");
	
	this.items[this.items.length] = srFindObject(idname);
}

//-----------------------------------------------
// Menuへのタイトルアイテム追加
//-----------------------------------------------
function	addMenuTitle(text)
{
	var	idname = this.name + this.items.length;
	
	//cursor:handが正しい
   	document.write("<DIV id='"+idname+"' style='background-color:#000099; position:absolute; left:"+this.left+"px; top:"+eval(this.top+this.items.length*this.height)+"px; width:"+this.width+"; visibility:hidden;' onmouseOver='menuVisible(window."+this.name+")' onmouseOut='menuHiddenOn(window."+this.name+")'>");
	document.write("<TABLE class='menu1' border=0 cellpadding=0 cellspacing=0 width="+this.width+">");
	document.write("<TR><TD style='color:white;'>");
	document.write(text);
   	document.write("</TD></TR></TABLE></DIV>");
	
	this.items[this.items.length] = srFindObject(idname);
}

//-----------------------------------------------
// コンストラクタ
//-----------------------------------------------
function	Menu(id, name, left, top, width)
{
	this.id		 	  = id;
	this.name   	  = name;
//	this.width	 	  = 240;
    this.width        = width;
	this.height	 	  = 20;
	this.left   	  = left;
	this.top    	  = top;
//	this.numitem  	  = 0;
	this.items	      = new Array;
	this.addMenuItem  = addMenuItem;
	this.addMenuTitle = addMenuTitle;
}

//-----------------------------------------------
// 色を変えるフラグ
//-----------------------------------------------
function	changeColor(obj, onoff)
{
	if( onoff==1 ) {
		obj.style.backgroundColor 	= "navy";
		obj.style.color 			= "yellow";
	}
	else if( onoff==0 ) {
		obj.style.backgroundColor 	= "#333333";
		obj.style.color 			= "white";
	}
	else if( onoff==2 ) {
		obj.style.backgroundColor 	= "#cccc00";
		obj.style.color 			= "black";
	}
}

//-----------------------------------------------
// MouseOver時の関数
//-----------------------------------------------
function	onMOver(obj, pmenu, uri) {
    if( browser == "Netscape" ) {
        if( version < 5 ) { return 0; } 
    }
	window.status = location.protocol + '//' + location.host + uri;
	menuVisible(pmenu);
	changeColor(obj, 1);
}

//-----------------------------------------------
// レイヤーを隠すフラグON 0.5秒後に消える
//-----------------------------------------------
function	menuHiddenOn(pmenu) {
    if( browser == "Netscape" ) {
        if( version < 5 ) { return 0; } 
    }
	NowHidden = pmenu;
	if( NowVisible==pmenu ) NowVisible=null;
	timeID = setTimeout("menuHidden()", 500);
}

//-----------------------------------------------
// MouseOut時の関数
//-----------------------------------------------
function	onMOut(obj, pmenu) {
    if( browser == "Netscape" ) {
        if( version < 5 ) { return 0; } 
    }
	changeColor(obj, 0);
	menuHiddenOn(pmenu);
}

//-----------------------------------------------
// MouseDown時の関数
//-----------------------------------------------
function	onMDown(obj, pmenu) {
    if( browser == "Netscape" ) {
        if( version < 5 ) { return 0; } 
    }
	changeColor(obj, 2);
}

//-----------------------------------------------
// MouseUp時の関数
//-----------------------------------------------
function	onMUp(obj, pmenu) {
    if( browser == "Netscape" ) {
        if( version < 5 ) { return 0; } 
    }
	changeColor(obj, 1);
}

//-----------------------------------------------
// menuに登録されているリストを表示
//-----------------------------------------------
function	menuVisible(pmenu) {
    if( browser == "Netscape" ) {
        if( version < 5 ) { return 0; } 
    }
	if( pmenu == NowHidden ) {		//自分が消えようとしていたら再表示
		NowHidden = null;
		if( timeID ) clearTimeout(timeID);
	}
	else if( NowHidden ) {			//他が消えようとしていたら即消し
		menuHidden();
		if( timeID ) clearTimeout(timeID);
	}
	cImageTmenu('', pmenu.id, 'on');
	for(i=0;i<pmenu.items.length;i++) {	//見せるべきアイテムを表示
		setObjectVisibilityByObj(pmenu.items[i], 'visible');
	}
	NowVisible = pmenu;
}

//-----------------------------------------------
// menuを隠す
//-----------------------------------------------
function	menuHidden() {
	if( !NowHidden ) return;
	cImageTmenu('', NowHidden.id, 'off');
	for(i=0;i<NowHidden.items.length;i++) {
//		NowHidden.items[i].style.visibility = 'hidden';
		setObjectVisibilityByObj(NowHidden.items[i], 'hidden');
	}
}


//-----------------------------------------------
// 全メニュー作成
//-----------------------------------------------
function print_layer()
{
    if( browser == "Netscape" ) {
        if( version < 5 ) { return 0; } 
    }
	
	//ホーム
	window.menu0 = new Menu(0, "menu0",   8, 124, 0);
	
	//ゲーム
	window.menu1 = new Menu(1, "menu1",  52, 124, 224);
	menu1.addMenuItem("九怨 -kuon-",                         'javascript:OpenWindowNormal( \\\"http://www.ku-o-n.net/top/\\\", \\\"FROM_KUON\\\", 900, 640 );' );
	menu1.addMenuItem("アーマード・コア ネクサス",           'javascript:OpenWindowNormal( \\\"http://www.armoredcore.net/top/\\\", \\\"FROM_AC\\\", 900, 640 );' );
	menu1.addMenuItem("NEBULA -ECHO NIGHT-",                 'javascript:OpenWindowNormal( \\\"http://www.nebula-en.net/top/\\\", \\\"FROM_NEBULA_EN\\\", 900, 640 );' );
	menu1.addMenuItem("O･TO･GI 〜百鬼討伐絵巻〜",            'javascript:OpenWindowResize( \\\"http://www.o-to-gi.net/top/\\\", \\\"FROM_OTOGI2\\\", 900, 640 );' );
	menu1.addMenuItem("SHADOW TOWER ABYSS",                  'javascript:OpenWindowNormal( \\\"http://www.st-abyss.net/top/\\\", \\\"FROM_STA\\\", 900, 640 );' );
	menu1.addMenuItem("RUNE II",                             "/top/soft/rune2/"   );
	menu1.addMenuItem("天誅参",                              "/top/soft/tenchu3/" );
	menu1.addMenuItem("サウザンドランド",                    "/top/soft/1000land/");
//	menu1.addMenuItem("シャドウタワー　アビス",              "/top/soft/stabyss/" );
	menu1.addMenuItem("アーマード・コア３　サイレントライン","/top/soft/ac3sl/"   );
//	menu1.addMenuItem("Ｏ・ＴＯ・ＧＩ〜御伽〜",              "/top/soft/otogi/"   );
//	menu1.addMenuItem("叢-MURAKUMO-",                        "/top/soft/murakumo/");
//	menu1.addMenuItem("RUNE",                                "/top/soft/rune/"    );
//	menu1.addMenuItem("アーマード・コア３",                  "/top/soft/ac3/"     );
//	menu1.addMenuItem("キングスフィールド４",                "/top/soft/kf4/"     );
//	menu1.addMenuItem("エヴァーグレイス２",                  "/top/soft/eg2/"     );
//	menu1.addMenuItem("アーマード・コア２アナザーエイジ",    "/top/soft/ac2aa/"   );
//	menu1.addMenuItem("くりクリミックス",                    "/kurikuri/"         );
//	menu1.addMenuItem("アーマード・コア２",                  "/top/soft/ac2/"     );
//	menu1.addMenuItem("エヴァーグレイス",                    "/top/soft/eg/"      );
//	menu1.addMenuItem("エターナルリング",                    "/top/soft/ering/"   );
	menu1.addMenuItem("製品全リスト",                        "/top/soft/");
	
	//ダウンロード
	window.menu3 = new Menu(3, "menu3", 126, 124, 280);
	menu3.addMenuItem("フロム・ソフトウェア特製デスクトップテーマ","/top/download/desktoptheme/"       );
	menu3.addMenuItem("RUNE II",                                   "/top/soft/rune2/download/"         );
	menu3.addMenuItem("天誅 参",                                   "/top/soft/tenchu3/download/"       );
	menu3.addMenuItem("サウザンドランド",                          "/top/soft/1000land/download/"      );
	menu3.addMenuItem("アーマード・コア３サイレントライン",        "/top/soft/accommon/download/ac3sl/");
//	menu3.addMenuItem("Ｏ・ＴＯ・ＧＩ〜御伽〜",                    "/top/soft/otogi/download/"         );
//	menu3.addMenuItem("叢-MURAKUMO-",                              "/top/soft/murakumo/download/"      );
//	menu3.addMenuItem("RUNE",                                      "/top/soft/rune/download/"          );
//	menu3.addMenuItem("アーマード・コア３",                        "/top/soft/accommon/download/ac3/"  );
//	menu3.addMenuItem("キングスフィールド４",                      "/top/soft/kf4/download/"           );
//	menu3.addMenuItem("エヴァーグレイス２",                        "/top/soft/eg2/download/"           );
//	menu3.addMenuItem("アーマード・コア２アナザーエイジ",          "/top/soft/accommon/download/ac2aa/");
//	menu3.addMenuItem("くりクリミックス",                          "/kurikuri/fan/"                    );
//	menu3.addMenuItem("アーマード・コア２",                        "/top/soft/accommon/download/ac2/"  );
//	menu3.addMenuItem("エヴァーグレイス",                          "/top/soft/eg/download/"            );
	menu3.addMenuItem("ソードオブムーンライト",                    "/soft/som/"                        );
	menu3.addMenuItem("ダウンロード全リスト",                      "/top/download/"                    );
	
	//関連商品：ID=2
	window.menu2 = new Menu(2, "menu2", 213, 124, 200);
	menu2.addMenuItem("RUNE II",                                   "/top/soft/rune2/goods/");
	menu2.addMenuItem("天誅 参",                                   "/top/soft/tenchu3/goods/");
	menu2.addMenuItem("アーマード・コア３サイレントライン",        "/top/soft/accommon/goods/");
	menu2.addMenuItem("RUNE",                                      "/top/soft/rune/goods/"    );
	menu2.addMenuItem("アーマード・コア３",                        "/top/soft/accommon/goods/");
	menu2.addMenuItem("キングスフィールド４",                      "/top/soft/kf4/goods/"     );
	menu2.addMenuItem("エヴァーグレイス２",                        "/top/soft/eg2/goods/"     );
	menu2.addMenuItem("アーマード・コア２アナザーエイジ",          "/top/soft/accommon/goods/");
	menu2.addMenuItem("アーマード・コア２",                        "/top/soft/accommon/goods/");
	menu2.addMenuItem("エヴァーグレイス",                          "/top/soft/eg/goods/"      );
	menu2.addMenuItem("エターナルリング",                          "/top/soft/ering/goods/"   );
	menu2.addMenuItem("関連商品全リスト",                          "/top/goods/"              );
	
	//e-ポストカード
	window.menu4 = new Menu(4, "menu4", 287, 124, 0);
	
	//イベント情報
	window.menu5 = new Menu(5, "menu5", 381, 124, 360);
	menu5.addMenuItem("『AC3SL』 サマーキャラバン 2003 レポート",                     "/top/event/report/ac3sl2003sum/index.html" );
//	menu5.addMenuItem("『AC3SL』 サマーキャラバン 2003 開催！！",                     "/top/event/info/ac3sl_tour03sum/index.html" );
//	menu5.addMenuItem("『AC3SL』 チャンピオントーナメントレポート",                   "/top/event/report/ac3sloffb_2003/index.html" );
	menu5.addMenuItem("『天誅 参』先行体験会開催！",                                  "/top/event/info/ten3_exp_mar/index.html"   );
	menu5.addMenuItem("『Thousand Land』 マイクロソフト杯 レポート",                  "/top/event/report/1000ms/index.html"       );
	menu5.addMenuItem("『Thousand Land』編集部対抗読者プレゼント争奪戦!! レポート",   "/top/event/report/1000editor/index.html"   );
	menu5.addMenuItem("『アーマード・コア３』日韓対抗戦レポート",                     "/top/event/report/ac3obkr_2002/index.html" );
	menu5.addMenuItem("Games-Japan Festa in Osaka 2002 レポート",                     "/top/event/report/gjfo2002/index.html"     );
	menu5.addMenuItem("『「アーマード・コア３公式大会』レポート",                     "/top/event/report/ac3offb_2002/index.html" );
	
	//会社・採用情報
	window.menu6 = new Menu(6, "menu6", 472, 124, 200);
	menu6.addMenuItem("会社概要",                              "/top/employ/company/"                );
	menu6.addMenuItem("採用情報",                              "/top/employ/recruit/"                );
	menu6.addMenuItem("&gt; 新卒採用情報",                     "/top/employ/recruit/sinsotsu/2004/"  );
	menu6.addMenuItem("&gt; &gt; 2004年卒業者向け新卒採用",    "/top/employ/recruit/sinsotsu/2004/"  );
	menu6.addMenuItem("&gt; 中途採用情報",                     "/top/employ/recruit/tyuto/"          );
	menu6.addMenuItem("&gt; アルバイト",                       "/top/employ/recruit/arbeit/"         );
	menu6.addMenuItem("当社へのアクセス",                      "/top/employ/access/"                 );
	menu6.addMenuItem("お問い合わせ",                          "/top/employ/inquiry/"                );
	
	//リンク
	window.menu7 = new Menu(7, "menu7", 581, 124, 180);
	menu7.addMenuItem("関連企業リンク",             "/top/link/"             );
	menu7.addMenuItem("当サイトへのリンクについて", "/top/link/caution.html" );
	
	//編集後記
//	window.menu8 = new Menu(8, "menu8", 640, 124, 160);
//	menu8.addMenuItem("編集後記",           "/top/postscript/"            );
//	menu8.addMenuItem("広報からのお知らせ", "/top/postscript/inform.html" );
	window.menu8 = new Menu(8, "menu8", 702, 124, 0);
	
	//お知らせ
	window.menu9 = new Menu(9, "menu9", 620, 124, 180);
	menu9.addMenuItem("ソフトに関するお知らせ", "/top/information/index.html" );
	menu9.addMenuItem("広報からのお知らせ", 	"/top/information/index.html" );
	
	return 0;
}

//===========================================================
// イメージ変更旧関数
//===========================================================
//-----------------------------------------------
// トップページゲームタイトル用：未使用
//-----------------------------------------------
function cImageTitle(id, onoff)
{
	if( onoff=="on" ) {
		document.images["title"+id].src = "./images/title/games"+id+".jpg";
	}
	else {
		document.images["title"+id].src = "./images/title/games"+id+"s.jpg";
	}
}

//-----------------------------------------------
// 全ページ：トップメニュー用
//-----------------------------------------------
function cImageTmenu(layerid, id, onoff)
{
    if( id<10 ) { id="0"+id; }
	if( onoff=="on" || onoff=="show" ) {
		document.images["tmenu"+id].src = "/top/images/tmenu"+id+"a.gif";
	}
	else {
		document.images["tmenu"+id].src = "/top/images/tmenu"+id+".gif";
	}
}

//-----------------------------------------------
// 全ページ：サイドメニュー及びボタン用(jpg)
//-----------------------------------------------
function cImageSideMenu(url, id, onoff, sid, iid)
{
	//sid : 同じイメージAを違うイメージオブジェクトに使う際に指定('a', 'b', 'c', ...)
	//iid : 同じイメージオブジェクトに違うイメージを使う際に指定('A', 'B', 'C', ...)
	
    var real_id;
    
	if( id<10 ) { id="0"+id; }
    real_id = id;
	
    if( sid )					{ id      = id      + sid; }
    if( iid && onoff=="on" ) 	{ real_id = real_id + iid; }
	
	if( onoff=="on" ) {
		document.images["title"+id].src = "/top/"+url+"/images/but"+real_id+"_a.jpg";
	}
	else if( onoff=="off" ) {
		document.images["title"+id].src = "/top/"+url+"/images/but"+real_id+"_s.jpg";
	}
	else if( onoff=="navi" ) {
		document.images["title"+id].src = "/top/"+url+"/images/but"+real_id+"_n.jpg";
	}
}

//-----------------------------------------------
// 全ページ：サイドメニュー及びボタン用(gif)
//-----------------------------------------------
function gcImageSideMenu(url, id, onoff, sid, iid)
{
    var real_id;
    
	if( id<10 ) { id="0"+id; }
    real_id = id;
	
    if( sid ) 					{ id      = id      + sid; }
    if( iid && onoff=="on" ) 	{ real_id = real_id + iid; }
	
	if( onoff=="on" ) {
		document.images["title"+id].src = "/top/"+url+"/images/but"+real_id+"_a.gif";
	}
	else if( onoff=="off" ) {
		document.images["title"+id].src = "/top/"+url+"/images/but"+real_id+"_s.gif";
	}
	else if( onoff=="navi" ) {
		document.images["title"+id].src = "/top/"+url+"/images/but"+real_id+"_n.gif";
	}
}

//===========================================================
// ウィンドウを開く
// Created : (2003-07-23) MUKAS
//===========================================================
function	OpenWindowNormal(url, name, wid, hei)
{
	wid += 31;
	hei += 134;

	var NewWin;
	var WinStt = "scrollbars=yes,directories=yes,location=yes,status=yes,resizable=yes,toolbar=yes,menubar=yes,width=" + wid;
	WinStt += ",height=" + hei + ",screenX=20, screenY=20,left=20,top=20";
	NewWin = window.open( url, name, WinStt );
}


//===========================================================
// ウィンドウを開く
// Created : (2003-07-10) MUKAS
//===========================================================
function	OpenWindowResize(url, name, wid, hei)
{
	wid += 15;
	hei += 134;

	var NewWin;
	var WinStt = "scrollbars=no,directories=yes,location=yes,status=yes,resizable=yes,toolbar=yes,menubar=yes,width=" + wid;
	WinStt += ",height=" + hei + ",screenX=20, screenY=20,left=20,top=20";
	NewWin = window.open( url, name, WinStt );
}




//===========================================================
// 直イメージ変更関数:gif（ファイル指定・汎用）
// Netscape 4.xには未対応：imgタグにonMouseイベントが無い為
// Created : (2003-07-10) MUKAS
//===========================================================
function	gimgCM(obj, path, name, id)
{
	obj.src = "/top" + path + "/images/" + name + "_" + id + ".gif";
}
//-->
