﻿//拡張開く
function ow_ex4() {
	window.open('/ff11us/altana/index.html','ex4');
}


var button = new Button();
button.slide = true;
/*
 * SubMenu
 *------------------------------------------------------------------------*/
if (isMatchUrl('https')) var str = 'http://www.playonline.com';
else var str = '';

var sub = new Menu('sub');
//スライドメニューを使う
sub.slide = true;
/*------------------------------------------------------------------------*/
if(isMatchUrl('index.shtml')){
	sub.slide = false;
	sub.backgroundImage('/ff11us/imgs/introbt.gif' );
	sub.size(170,693 + 28 + 90);

	button.id('newplayer');
	button.position(0,0,0,0);
	button.size(170,75);
	button.link('/ff11us/newplayer/index.html');
	button.target('_blank');
	button.alt('New Player Guide');

	button.id('tmp');
	button.position(0,0,0,-75);
	button.size(149,65);
	button.link(null);
	button.alt('');

	button.id('sub1');
	button.position(5,0,-5,-140);
	button.size(149,22);
	button.link(str+'/ff11us/intro/about/welcom.html?pageID=about');
	button.alt('Welcome to Vana\'diel');

	button.id('sub2');
	button.position(5,0,-5,-162);
	button.size(149,22);
	button.link(str+'/ff11us/intro/world/index.html');
	button.alt('Locations');

	button.id('sub3');
	button.position(5,0,-5,-184);
	button.size(149,22);
	button.link(str+'/ff11us/intro/about/live01.html?pageID=about');
	button.alt('Citizens of Vana\'diel');

	button.id('sub4');
	button.position(5,0,-5,-206);
	button.size(149,22);
	button.link(str+'/ff11us/intro/monster/index.html?pageID=monster');
	button.alt('Monsters');

	button.id('sub5');
	button.position(5,0,-5,-228);
	button.size(149,22);
	button.link(str+'/ff11us/guide/system/index.html?pageID=system');
	button.alt('Gameplay');

	button.id('sub6');
	button.position(5,0,-5,-250);
	button.size(149,29);
	button.link(null);

	button.id('sub7');
	button.position(5,0,-5,-279);
	button.size(149,22);
	button.link(str+'/ff11us/intro/extension.html?pageID=extension');
	button.alt('Rise of the Zilart');

	button.id('sub8');
	button.position(5,0,-5,-301);
	button.size(149,22);
	button.link(str+'/ff11us/promathia/index.html');
	button.alt('Chains of Promathia');
	button.target('_blank');

	button.id('sub9');
	button.position(5,0,-5,-323);
	button.size(149,22);
	button.link(str+'/ff11us/ahturhgan/index.html');
	button.alt('Treasures of Aht Urhgan');
	button.target('_blank');

	button.id('sub10');
	button.position(5,0,-5,-345);
	button.size(149,22);
	button.link(str+'/ff11us/altana/index.html');
	button.alt('Wings of the Goddess');
	button.target('_blank');

	button.id('sub11');
	button.position(5,0,-5,-367);
	button.size(149,29);
	button.link(null);

	button.id('sub12');
	button.position(5,0,-5,-396);
	button.size(149,22);
	button.link(str+'/ff11us/addon/index.html');
	button.alt('A Crystalline Prophecy');
	button.target('_blank');

	button.id('sub13');
	button.position(5,0,-5,-418);
	button.size(149,22);
	button.link(str+'/ff11us/addon/index.html');
	button.alt('A Moogle Kupo d\'Etat');
	button.target('_blank');

	button.id('sub14');
	button.position(5,0,-5,-440);
	button.size(149,22);
	button.link(str+'/ff11us/addon/index.html');
	button.alt('A Shantotto Ascension');
	button.target('_blank');

	button.id('sub15');
	button.position(5,0,-5,-462);
	button.size(149,15);
	button.link(null);

	button.id('sub16');
	button.position(5,0,-5,-477);
	button.size(149,22);
	button.link(str+'/ff11us/intro/shop.html');
	button.alt('Online Store');

	button.id('sub17');
	button.position(5,0,-5,-499);
	button.size(149,22);
	button.link(str+'/ff11us/intro/optional/wd_transfer01.html');
	button.alt('World Transfer');

	button.id('sub18');
	button.position(5,0,-5,-521);
	button.size(149,22);
	button.link(str+'/ff11us/topics/optional/regist.html');
	button.alt('Registration Code Sales');

	button.id('sub19');
	button.position(5,0,-5,-543);
	button.size(149,42);
	button.link(null);

} else if (isMatchUrl('/info/')||isMatchUrl('/polnews')||isMatchUrl('/polff11s')||isMatchUrl('/topics')||isMatchUrl('/server')||isMatchUrl('/service/')||isMatchUrl('/verup/')||isMatchUrl('/newsletter/')) {

	sub.slide = false;
	sub.backgroundImage('/ff11us/imgs/introbt2.gif' );
	sub.size(170,681 + 28 + 90);

	button.id('newplayer');
	button.position(0,0,0,0);
	button.size(170,63);
	button.link('/ff11us/newplayer/index.html');
	button.target('_blank');
	button.alt('New Player Guide');

	button.id('tmp');
	button.position(0,0,0,-63);
	button.size(149,65);
	button.link(null);
	button.alt('');

	button.id('sub1');
	button.position(5,0,-5,-128);
	button.size(149,22);
	button.link(str+'/ff11us/intro/about/welcom.html?pageID=about');
	button.alt('Welcome to Vana\'diel');

	button.id('sub2');
	button.position(5,0,-5,-150);
	button.size(149,22);
	button.link(str+'/ff11us/intro/world/index.html');
	button.alt('Locations');

	button.id('sub3');
	button.position(5,0,-5,-172);
	button.size(149,22);
	button.link(str+'/ff11us/intro/about/live01.html?pageID=about');
	button.alt('Citizens of Vana\'diel');

	button.id('sub4');
	button.position(5,0,-5,-194);
	button.size(149,22);
	button.link(str+'/ff11us/intro/monster/index.html?pageID=monster');
	button.alt('Monsters');

	button.id('sub5');
	button.position(5,0,-5,-216);
	button.size(149,22);
	button.link(str+'/ff11us/guide/system/index.html?pageID=system');
	button.alt('Gameplay');

	button.id('sub6');
	button.position(5,0,-5,-238);
	button.size(149,29);
	button.link(null);

	button.id('sub7');
	button.position(5,0,-5,-267);
	button.size(149,22);
	button.link(str+'/ff11us/intro/extension.html?pageID=extension');
	button.alt('Rise of the Zilart');

	button.id('sub8');
	button.position(5,0,-5,-289);
	button.size(149,22);
	button.link(str+'/ff11us/promathia/index.html');
	button.alt('Chains of Promathia');
	button.target('_blank');

	button.id('sub9');
	button.position(5,0,-5,-311);
	button.size(149,22);
	button.link(str+'/ff11us/ahturhgan/index.html');
	button.alt('Treasures of Aht Urhgan');
	button.target('_blank');

	button.id('sub10');
	button.position(5,0,-5,-333);
	button.size(149,22);
	button.link(str+'/ff11us/altana/index.html');
	button.alt('Wings of the Goddess');
	button.target('_blank');

	button.id('sub11');
	button.position(5,0,-5,-355);
	button.size(149,29);
	button.link(null);

	button.id('sub12');
	button.position(5,0,-5,-384);
	button.size(149,22);
	button.link(str+'/ff11us/addon/index.html');
	button.alt('A Crystalline Prophecy');
	button.target('_blank');

	button.id('sub13');
	button.position(5,0,-5,-406);
	button.size(149,22);
	button.link(str+'/ff11us/addon/index.html');
	button.alt('A Moogle Kupo d\'Etat');
	button.target('_blank');

	button.id('sub14');
	button.position(5,0,-5,-428);
	button.size(149,22);
	button.link(str+'/ff11us/addon/index.html');
	button.alt('A Shantotto Ascension');
	button.target('_blank');

	button.id('sub15');
	button.position(5,0,-5,-450);
	button.size(149,15);
	button.link(null);

	button.id('sub16');
	button.position(5,0,-5,-465);
	button.size(149,22);
	button.link(str+'/ff11us/intro/shop.html');
	button.alt('Online Store');

	button.id('sub17');
	button.position(5,0,-5,-487);
	button.size(149,22);
	button.link(str+'/ff11us/intro/optional/wd_transfer01.html');
	button.alt('World Transfer');

	button.id('sub18');
	button.position(5,0,-5,-509);
	button.size(149,22);
	button.link(str+'/ff11us/topics/optional/regist.html');
	button.alt('Registration Code Sales');

	button.id('sub19');
	button.position(5,0,-5,-531);
	button.size(149,42);
	button.link(null);

}

var ss_size = 200 + 28;


function charamake(){
	window.open("/ff11us/intro/charmake/index.html","chara","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=no,width=549,height=399");
}

//ゲーム紹介
if(isMatchUrl('/intro/')){
	document.write('<img src="/ff11us/menu/imgs/catl01.gif">');
	sub.backgroundImage('/ff11us/menu/imgs/subbt01.gif' );
	sub.size(170,528+ss_size);
	
	link = [
	'about&start',
		'/ff11us/intro/about/welcom.html?pageID=about',
		'/ff11us/intro/about/history01.html?pageID=about',
		'/ff11us/intro/about/class01.html?pageID=about',
		'/ff11us/intro/about/job01.html?pageID=about',
		'/ff11us/intro/about/live01.html?pageID=about',
		'javascript:charamake();&end',
	'/ff11us/intro/world/index.html',
	'monster&start',
		'/ff11us/intro/monster/index.html?pageID=monster',
		'/ff11us/intro/monster/tribe.html?pageID=monster&end',
	'extension&start',
		'/ff11us/intro/extension.html?pageID=extension',
		'/ff11us/promathia/index.html&blank',
		'/ff11us/ahturhgan/index.html&blank',
		'/ff11us/altana/index.html&blank&end',
	'/ff11us/intro/shop.html',
	'/ff11us/intro/optional/wd_transfer01.html'
		];

	alt = [
	'Welcome to Vana\'diel',
		'Adventure With Friends',
		'The History of Vana\'diel',
		'The Five Races',
		'Jobs',
		'Citizens of Vana\'diel',
		'Character Creation Trial',
	'Locations',
	'Adversaries',
		'The Valdeaunia Region',
		'The Beastmen Forces',
	'Expansion Pack',
		'Treasures of Aht Urhgan',
		'Chains of Promathia',
		'Rise of the Zilart',
		'Wings of the Goddess',
	'Online Store',
	'World Transfer'
		];

}

//プレイ環境
if(isMatchUrl('/envi/')){
	document.write('<img src="/ff11us/menu/imgs/catl02.gif">');
	sub.backgroundImage('/ff11us/menu/imgs/subbt02.gif' );
	sub.size(170,136+ss_size);

	link = [
	'/ff11us/envi/ps/ps01.html',
	'/ff11us/envi/win/win01.html',
	'/ff11us/envi/xbox/xbox01.html',
	'/ff11us/envi/charge.html'
	];

	alt = [
	'PlayStationg(R)2',
	'Windows(R)',
	'Xbox(R) 360',
	'Monthly Service Fees'
	]
}

//プレイガイド
if(isMatchUrl('/guide/')){
	document.write('<img src="/ff11us/menu/imgs/catl03.gif">');
	sub.backgroundImage('/ff11us/menu/imgs/subbt03.gif' );
	sub.size(170,640+ss_size);
	
	link = [
	'system&start',
		'/ff11us/guide/system/index.html?pageID=system',
		'/ff11us/guide/system/quests.html?pageID=system',
		'/ff11us/guide/system/comm.html?pageID=system',
		'/ff11us/guide/system/battle.html?pageID=system',
		'/ff11us/guide/system/other.html?pageID=system',
		'/ff11us/guide/system/worlds.html?pageID=system',
		'/ff11us/guide/system/item.html?pageID=system',
		'/ff11us/guide/system/dictionary01.html?pageID=system&end',
	'development&start',
		'/ff11us/guide/development/concept01.html?pageID=development',
		'/ff11us/guide/development/awards.html?pageID=development',
		'/ff11us/guide/development/census/index.html&blank',
		'/ff11us/guide/development/vt2/backnumber/index.html&blank',
		'/ff11us/guide/development/goblin/main/index.html&end&blank',
	'conflict&start',
		'/ff11us/guide/conflict/ballista01.html?pageID=conflict&end',
	'/ff11us/guide/mogbon/index.html',
	'/ff11us/guide/mogtab/index.html',
	'/ff11us/guide/recruitment01.html',
	'/ff11us/crs/&blank',
	'/pcd/verup/ff11us/update.html'
	];

	alt = [
	'Gameplay',
		'Job and Races',
		'Quests,Missions,Conquest',
		'Communications',
		'Battle System',
		'Other System Features',
		'Worlds in FINAL FANTASY XI',
		'Crystals ansd Synthesis',
		'About Auto-translate Function',
	'Developper\'s Room',
		'Concept Art',
		'Awards',
		'Vana\'diel Census',
		'Vana\'diel Tribune',
		'Goblin\'s Diary',
	'Conflict',
		'Ballista',
	'Mog Bonanza',
	'Mog Tablet',
	'Adventurer Recruitment Program',
	'Character Reactivation Service',
	'Update History'
	]
}

if(isMatchUrl('/download/')){
	document.write('<img src="/ff11us/menu/imgs/catl05.gif">');
	sub.backgroundImage('/ff11us/menu/imgs/subbt05.gif' );
	sub.size(170,136+ss_size);

	link = [
	'media&start',
		'/ff11us/download/media/sysinfo01.html?pageID=media',
		'/ff11us/download/media/vista01.html?pageID=media&end',
	'/ff11us/download/wind/index.html'
	];

	alt = [
	'Multimedia',
		'System Information',
		'Benchmark program',
	'Vana\'diel Wind'
	]
}

if (isMatchUrl('/rule/')){
	document.write('<img src="/ff11us/menu/imgs/catl06.gif">');
	sub.backgroundImage('/ff11us/menu/imgs/subbt06.gif' );
	sub.size(170,472+ss_size);

	link = [
	'/ff11us/rule/index.html',
	'https://secure.playonline.com/ff11us/rule/policy.shtml',
	'manner&start',
		'/ff11us/rule/manner01.html?pageID=manner',
		'/ff11us/rule/manner02.html?pageID=manner',
		'/ff11us/rule/manner03.html?pageID=manner',
		'/ff11us/rule/manner04.html?pageID=manner',
		'/ff11us/rule/manner05.html?pageID=manner&end',
	'support&start',
		'/ff11us/rule/support01.html?pageID=support',
		'/ff11us/rule/support02.html?pageID=support',
		'/ff11us/rule/support03.html?pageID=support',
		'/ff11us/rule/support04.html?pageID=support',
		'/ff11us/rule/support05.html?pageID=support&end',
	'/ff11us/rule/uacs01.html',
	'/ff11us/rule/specialtask.html'
	];
	alt  = [
	'Rules & Policies',
	'GM Policy',
	'Online Manners',
		'	Outline',
		'	Communicating with Players',
		'	Rules',
		'	Dealing with Disruptions',
		'	Account Penalties',
	'Support Staff',
		'	What&#8217;s a GM?',
		'	When to Call a GM',
		'	Problems in the GM Service',
		'	How to Help Yourself',
		'	Afterword',
	'Unauthorized Access',
	'The Special Task Force'
	];

}

/*------------------------------------------------------------------------*/

/* SUB MENU */
var slide_header_data = new Object();
var slide_y = new Object();

if(!isMatchUrl('index.shtml')&&!isMatchUrl('/info/')&&!isMatchUrl('/polnews')&&!isMatchUrl('/polff11s')&&!isMatchUrl('/topics')&&!isMatchUrl('/server')&&!isMatchUrl('/service/')&&!isMatchUrl('/verup/')&&!isMatchUrl('/newsletter/')){
	for(var i=0; i<link.length; i++){

		if (link[i].indexOf('&start', 0) != -1) {
			var match_string = new RegExp(/&start/);
			link[i] = link[i].replace(match_string, '');
			button.id(link[i]);
			button.childNodesStart();
			button.size(162,28);
			button.position(0,0,0,i*(-28));

			slide_y[link[i]] = button.button_aggregater[link[i]].background_image_y;
		} else {
			button.id('subbt'+i);
			button.size(162,28);
			button.position(0,0,0,i*(-28));
		}

		if (link[i].indexOf('&blank', 0) != -1) {
			var match_string = new RegExp(/&blank/);
			link[i] = link[i].replace(match_string, '');
			button.target('_blank');
		}


		if (link[i].indexOf('&end', 0) != -1) {
			button.childNodesEnd();
			var match_string = new RegExp(/&end/);
			link[i] = link[i].replace(match_string, '');
		}

		if (link[i].indexOf('http', 0) != -1) {
			button.link(link[i]);
		} else {
			button.link(str+link[i]);
		}

		button.alt(alt[i]);

	}
}
if(!isMatchUrl('index.shtml')&&!isMatchUrl('/info/')&&!isMatchUrl('/polnews')&&!isMatchUrl('/polff11s')&&!isMatchUrl('/topics')&&!isMatchUrl('/server')&&!isMatchUrl('/service/')&&!isMatchUrl('/verup/')&&!isMatchUrl('/newsletter/')){
	button.id('subbt'+i);
	button.size(170,24);
	button.position(0,0,0,i*(-28));
	button.link(null);
}

sub.flushFF11(button);
button.cleanup();

//パラメータを取得し、IDと一致する場合はメニューを開ける
if(!isMatchUrl('index.shtml')&&!isMatchUrl('/info/')&&!isMatchUrl('/polnews')&&!isMatchUrl('/polff11s')&&!isMatchUrl('/topics')&&!isMatchUrl('/server')&&!isMatchUrl('/service/')&&!isMatchUrl('/verup/')&&!isMatchUrl('/newsletter/')){
	slideSwitch($GET('pageID'),-170,slide_y[$GET('pageID')]);
}