var ms = new select_nav();
ms.add("Gracia Epilogue", "graciaepilogue_01");
ms.add("Gracia Final", "graciafinal_01");
ms.add("Gracia Part 2", "graciapt2_01");
ms.add("Gracia Part 1", "gracia_01");
ms.add("Hellbound", "hellbound_01");
ms.add("Kamael", "kamael_01");
ms.add("Interlude", "interlude_01");
ms.add("Chronicle 5", "chronicle5_01");
ms.add("Chronicle 4", "chronicle4_01");
ms.add("Chronicle 3", "chronicle3_01");
ms.add("Chronicle 2", "chronicle2_01");
ms.add("Chronicle 1", "chronicle1_01");
ms.add("Prelude", "career");

ms.html_style = 'text-align: right; margin-right: 15px;';

// cheap fix for Prelude pages that don't have common name scheme..
ms.opt1_names = new Array('career', 'regions', 'summon', 'items', 'others');

// override the compare function in order to correctly match sub pages...
ms.compare = function(page_id, cur_page) 
{
	var name = this.pages[page_id].page.split('_');
	var cur_page = cur_page.split('_');
	name = name[0];
	cur_page = cur_page[0];
	
	// cheap Prelude fix continued...
	if(page_id == (this.pages.length - 1))
	{
		for(var i=0; i < this.opt1_names.length; i++)
		{
			if(this.opt1_names[i] == cur_page)
			{
				this.cur_page = 'career';
				return true;
			}
		}
	}
	
	if(name == cur_page)
	{
		this.cur_page = this.pages[page_id].page;
		return true;
	}
}
ms.output();