User:Metrosio/monobook.js

var previousBlockFocus = []; var rootBlocks = []; var ticks = 0; var intervalStarted = false; var intervalId = 0; function inArray (value, arr) { for(var s = 0; s < arr.length; s++) if(value == arr[s]) return true; return false; }

function beginMenu { ticks = new Date.getTime + 3499; }

function closeMenu { if(!intervalStarted) { intervalId = setInterval ( function{			if (ticks < new Date.getTime ) {				for(var i = 0; i < previousBlockFocus.length; i++)					document.getElementById('navBlock'+previousBlockFocus[i]).style.display='none';				clearInterval(intervalId);				intervalStarted = false;			}		}, 5000 ); intervalStarted = true; } }

function pinMenu(block) { ticks += 2; var currentBlock = document.getElementById('navBlock'+block); var parentId = (currentBlock.parentNode.id).replace(/^navBlock/, '');

if(previousBlockFocus.length > 0 && inArray(parentId, rootBlocks)) {		previousBlockFocus = previousBlockFocus.reverse; for(var i = 0; i < previousBlockFocus.length; i++) document.getElementById('navBlock'+previousBlockFocus[i]).style.display='none'; previousBlockFocus = []; } else if(inArray(block, previousBlockFocus)) { var closeLeaf = previousBlockFocus.pop; document.getElementById('navBlock'+closeLeaf).style.display="none"; }		currentBlock.style.display = "block"; if(previousBlockFocus.length>0) { var lastOpen = previousBlockFocus.pop; if(parentId != lastOpen) document.getElementById('navBlock'+lastOpen).style.display="none"; else previousBlockFocus.push(parentId); }		if(!inArray(block, rootBlocks)) previousBlockFocus.push(block); }

function forwardSeek(linkArray, block, iteration, htmlResult) { if(linkArray.length > 2) htmlResult.push(''); else htmlResult.push(''); htmlResult.push(' '+linkArray[0]+''); htmlResult.push(' '); if(typeof(linkArray[2]) != 'undefined') { htmlResult.push(''); for(var c = 0; c < linkArray[2].length; c++) block = forwardSeek(linkArray[2][c], block, 0, htmlResult); htmlResult.push(' '); }	return block; }

function loadNavigationLinks { var navigationPanel = document.getElementById('p-navigation'); var navigationLinksArray = [ [ 			["FFXIclopedia ›› ", "/wiki/Main_Page", [					["Current News", "/wiki/Main_Page/News"], ["Community ›› ", "/wiki/Main_Page/Community_Portal", [							["Blogs", "http://forums.ffxiclopedia.org/weblogs.php"], ["Chat", "http://ffochat.com/irc/ffxiclopedia"], ["Forums", "http://forums.ffxiclopedia.org/"], ["Twitter", "http://twitter.com/ffxiclopedia"] ]					],					["Knowledge Base", "/wiki/Main_Page/Knowledge_Base"], ["About FFXIclopedia", "/wiki/Main_Page/Info"], ["Random ›› ", "/wiki/Special:Random", [							["Random Page", "/wiki/Special:Random"], ["Random Image", "/wiki/Special:Random/Image"], ["Random Video", "/wiki/Special:Random/Video"] ]					]				]			] 		], 		[			["Character Creation ›› ", "/wiki/Character_Creation", [					["Races ›› ", "/wiki/Races", [							["Elvaan", "/wiki/Elvaan"], ["Hume", "/wiki/Hume"], ["Galka", "/wiki/Galka"], ["Mithra", "/wiki/Mithra"], ["Tarutaru", "/wiki/Tarutaru"] ]					],					["Allegiance ›› ", "/wiki/Allegiance", [							["Bastok", "/wiki/Bastok"], ["San d'Oria", "/wiki/San_d%27Oria"], ["Windurst", "/wiki/Windurst"] ]					],					["Starting Jobs ›› ", "/wiki/Category:Jobs", [							["Black Mage", "/wiki/Black_Mage"], ["Monk", "/wiki/Monk"], ["Red Mage", "/wiki/Red_Mage"], ["Thief", "/wiki/Thief"], ["Warrior", "/wiki/Warrior"], ["White Mage", "/wiki/White_Mage"] ]					],					["Worlds", "/wiki/Worlds"] ]			]		],		[			["Jobs &amp; Battle ›› ", "/wiki/Category:Jobs", [					["Jobs ›› ", "/wiki/Category:Jobs", [							["Bard", "/wiki/Bard"], ["Beastmaster", "/wiki/Beastmaster"], ["Black Mage", "/wiki/Black_Mage"], ["Blue Mage", "/wiki/Blue_Mage"], ["Corsair", "/wiki/Corsair"], ["Dancer", "/wiki/Dancer"], ["Dark Knight", "/wiki/Dark_Knight"], ["Dragoon", "/wiki/Dragoon"], ["Monk", "/wiki/Monk"], ["Ninja", "/wiki/Ninja"], ["Paladin", "/wiki/Paladin"], ["Puppetmaster", "/wiki/Puppetmaster"], ["Ranger", "/wiki/Ranger"], ["Red Mage", "/wiki/Red_Mage"], ["Samurai", "/wiki/Samurai"], ["Scholar", "/wiki/Scholar"], ["Summoner", "/wiki/Summoner"], ["Thief", "/wiki/Thief"], ["Warrior", "/wiki/Warrior"], ["White Mage", "/wiki/White_Mage"] ]					],					["Job Abilities", "/wiki/Category:Job_Abilities"], ["Job Traits", "/wiki/Category:Job_Traits"], ["Combat Skills", "/wiki/Category:Combat_Skills"], ["Magic Skills ›› ", "/wiki/Category:Magic", [							["Blue Magic", "/wiki/Category:Blue_Magic"], ["Dark Magic", "/wiki/Category:Dark_Magic"], ["Divine Magic", "/wiki/Category:Divine_Magic"], ["Elemental Magic", "/wiki/Category:Elemental_Magic"], ["Enfeebling Magic", "/wiki/Category:Enfeebling_Magic"], ["Enhancing Magic", "/wiki/Category:Enhancing_Magic"], ["Healing Magic", "/wiki/Category:Healing_Magic"], ["Ninjutsu", "/wiki/Category:Ninjutsu"], ["Songs ›› ", "/wiki/Category:Songs", [									["Enfeebling Songs", "/wiki/Category:Enfeebling_Songs"], ["Enhancing Songs", "/wiki/Category:Enhancing_Songs"] ]							],							["Summoning Magic", "/wiki/Category:Summoning_Magic"], ["Weapon Skills", "/wiki/Category:Weapon_Skills"], ["Status Effects", "/wiki/Category:Status_Effects"], ["Merit Points", "/wiki/Category:Merit_Points"] ]					]				]			]		],		[			["Other Activities ›› ", "/wiki/Other_Activities", [					["Crafts ›› ", "/wiki/Crafts", [							["Alchemy", "/wiki/Category:Alchemy"], ["Bonecraft", "/wiki/Category:Bonecraft"], ["Clothcraft", "/wiki/Category:Clothcraft"], ["Cooking", "/wiki/Category:Cooking"], ["Fishing", "/wiki/Category:Fishing"], ["Goldsmithing", "/wiki/Category:Goldsmithing"], ["Leathercraft", "/wiki/Category:Leathercraft"], ["Smithing", "/wiki/Category:Smithing"], ["Woodworking", "/wiki/Category:Woodworking"], ["Synergy", "/wiki/Category:Synergy"] ]					],					["Hobbies ›› ", "/wiki/Hobbies", [							["Chocobo Digging", "/wiki/Chocobo_Digging"], ["Clamming", "/wiki/Clamming"], ["Excavation", "/wiki/Excavation"], ["Gardening", "/wiki/Category:Gardening"], ["Harvesting", "/wiki/Harvesting"], ["Logging", "/wiki/Logging"], ["Mining", "/wiki/Mining"] ]					],					["Adventuring Fellow", "/wiki/Adventuring_Fellow_Guide"], ["Chocobo Raising", "/wiki/Category:Chocobo_Raising"], ["Chocobo Racing", "/wiki/Chocobo_Racing_Guide"], ["Moblin Maze Mongers", "/wiki/Category:Moblin_Maze_Mongers"], ["Pankration", "/wiki/Category:Pankration"] ]			]		],		[			["Exploring Vana'diel ›› ", "/wiki/Category:Areas", [					["Architecture", "/wiki/Category:Architecture"], ["Areas", "/wiki/Category:Areas"], ["Bestiary ›› ", "/wiki/Category:Bestiary", [							["Notorious Monsters", "/wiki/Category:Notorious_Monsters"] ]					],					["NPCs ›› ", "/wiki/Category:NPCs", [							["Armor Storer", "/wiki/Armor_Storer"], ["Allegiance Changer", "/wiki/Allegiance_Changer"], ["Assault Mission Giver", "/wiki/Assault_Mission_Giver"], ["Chocobo Renter", "/wiki/Chocobo_Renter"], ["Conquest Overseer", "/wiki/Conquest_Overseer"], ["Event Item Storer", "/wiki/Event_Item_Storer"], ["Guild Merchant", "/wiki/Guild_Merchant"], ["Imperial Gate Guard", "/wiki/Imperial_Gate_Guard"], ["Map Marker", "/wiki/Map_Marker"], ["Outpost Vendor", "/wiki/Outpost_Vendor"], ["Past Event Watcher", "/wiki/Past_Event_Watcher"], ["Regional Vendor", "/wiki/Regional_Vendor"], ["Standard Merchant", "/wiki/Standard_Merchant"], ["Tenshodo Merchant", "/wiki/Tenshodo_Merchant"], ["Title Changer", "/wiki/Title_Changer"], ["Warp NPCs", "/wiki/Category:Warp_NPCs"], ["Weather Checker", "/wiki/Weather_Checker"] ]					],					["Transportation ›› ", "/wiki/Category:Transportation", [							["Airships", "/wiki/Category:Airships"], ["Ferries", "/wiki/Category:Ferries"], ["Chocobo", "/wiki/Chocobo"], ["Magic ›› ", "/wiki/Magic", [									["Gate Crystals", "/wiki/Gate_Crystals"], ["Outpost Teleporting", "/wiki/Outpost_Teleporting"], ["Warp NPCs", "/wiki/Warp_NPCs"], ["Home Point", "/wiki/Home_Point"], ["Runic Portals", "/wiki/Runic_Portals"] ]							] 						]					], 					["Reputation", "/wiki/Reputation"], ["Vana'diel Tribune", "/wiki/Category:Vana%27diel_Tribune"] ]			]		],		[			["Items ›› ", "/wiki/Items", [					["Armor ›› ", "/wiki/Category:Armor", [							["Shields", "/wiki/Category:Shields"], ["Head", "/wiki/Category:Head"], ["Neck", "/wiki/Category:Neck"], ["Body", "/wiki/Category:Body"], ["Hands", "/wiki/Category:Hands"], ["Waist", "/wiki/Category:Waist"], ["Legs", "/wiki/Category:Legs"], ["Feet", "/wiki/Category:Feet"], ["Back", "/wiki/Category:Back"], ["Earrings", "/wiki/Category:Earrings"], ["Rings", "/wiki/Category:Rings"] ]					],					["Food ›› ", "/wiki/Category:Food", [							["Meals ›› ", "/wiki/Category:Meals", [									["Meat &amp; Eggs", "/wiki/Category:Meat_%26_Eggs"], ["Seafood", "/wiki/Category:Seafood"], ["Vegetables", "/wiki/Category:Vegetables"], ["Soups", "/wiki/Category:Soups"], ["Breads &amp; Rice", "/wiki/Category:Breads_%26_Rice"], ["Sweets", "/wiki/Category:Sweets"], ["Drinks", "/wiki/Category:Drinks"] ]							],							["Ingredients", "/wiki/Category:Ingredients"], ["Fish", "/wiki/Category:Fish"] ]					], 					["Furniture", "/wiki/Category:Furnishings"], ["Weapons ›› ", "/wiki/Category:Weapons", [							["Hand-to-Hand", "/wiki/Category:Hand-to-Hand"], ["Daggers", "/wiki/Category:Daggers"], ["Swords", "/wiki/Category:Swords"], ["Great Swords", "/wiki/Category:Great_Swords"], ["Axes", "/wiki/Category:Axes"], ["Great Axes", "/wiki/Category:Great_Axes"], ["Scythes", "/wiki/Category:Scythes"], ["Polearms", "/wiki/Category:Polearms"], ["Katana", "/wiki/Category:Katana"], ["Great Katana", "/wiki/Category:Great_Katana"], ["Clubs", "/wiki/Category:Clubs"], ["Staves", "/wiki/Category:Staves"], ["Ranged ›› ", "/wiki/Category:Ranged", [									["Archery", "/wiki/Category:Archery"], ["Marksmanship", "/wiki/Category:Marksmanship"], ["Throwing", "/wiki/Category:Throwing"] ]							],							["Instruments ›› ", "/wiki/Category:Instruments", [									["String Instruments", "/wiki/Category:String_Instruments"], ["Wind Instruments", "/wiki/Category:Wind_Instruments"], ["Fishing Gear", "/wiki/Fishing_Gear"] ]							],							["Ammo &amp; Misc. ›› ", "/wiki/Category:Ammo_%26_Misc.", [									["Ammunition", "/wiki/Category:Ammunition"], ["Fishing Gear", "/wiki/Category:Fishing_Gear"], ["Grips", "/wiki/Category:Grips"], ["Pet Items", "/wiki/Category:Pet_Items"] ]							]						]					]				]			]		],		[			["Battles &amp; Storyline ›› ", "/wiki/Battles_%26_Storyline", [					["Abyssea", "/wiki/Category:Abyssea"], ["Assault", "/wiki/Category:Assault"], ["Battlefields ›› ", "/wiki/Category:Battlefields", [							["BCNM", "/wiki/Category:BCNM"], ["ENM", "/wiki/Category:ENM"], ["ISNM", "/wiki/Category:ISNM"], ["Walk of Echoes", "/wiki/Category:Walk_of_Echoes_Battlefields"] ]					],					["Besieged", "/wiki/Besieged"], ["Conflict ›› ", "/wiki/Conflict", [							["Ballista", "/wiki/Ballista"], ["Brenner", "/wiki/Brenner"], ["Diorama - Ghelsba Outpost", "/wiki/Diorama_-_Ghelsba_Outpost"] ]					],					["Campaign ›› ", "/wiki/Category:Campaign", [							["Campaign Battles", "/wiki/Category:Campaign_Battles"], ["Campaign Operations", "/wiki/Category:Campaign_Operations"], ["Freelance NPCs", "/wiki/Category:Freelance_NPCs"], ["Tactical Assessment", "/wiki/Tactical_Assessment"] ]					],					["End Game ›› ", "/wiki/End_Game", [							["Allied Notes Notorious Monsters", "/wiki/Category:Allied_Notes_Notorious_Monsters"], ["Dynamis", "/wiki/Category:Dynamis"], ["Einherjar", "/wiki/Category:Einherjar"], ["Limbus", "/wiki/Category:Limbus"], ["Salvage", "/wiki/Category:Salvage"], ["Sea", "/wiki/Category:Sea_Notorious_Monsters"], ["Sky", "/wiki/Category:Sky_Notorious_Monsters"], ["Stronghold Notorious Monsters", "/wiki/Category:Stronghold_Notorious_Monsters"], ["Zeni Notorious Monsters", "/wiki/Category:Zeni_Notorious_Monsters"], ["Voidwalker Notorious Monsters", "/wiki/Voidwalker_Notorious_Monsters"] ]					],					["Fields of Valor", "/wiki/Fields_of_Valor"], ["Garrison", "/wiki/Category:Garrison"], ["Missions ›› ", "/wiki/Category:Missions", [							["Bastok", "/wiki/Category:Bastok_Missions"], ["San d'Oria", "/wiki/Category:San_d%27Oria_Missions"], ["Windurst", "/wiki/Category:Windurst_Missions"], ["Rise of the Zilart", "/wiki/Category:Rise_of_the_Zilart_Missions"], ["Chains of Promathia", "/wiki/Category:Chains_of_Promathia_Missions"], ["Treasures of Aht Urhgan", "/wiki/Category:Treasures_of_Aht_Urhgan_Missions"], ["Wings of the Goddess", "/wiki/Category:Wings_of_the_Goddess_Missions"], ["A Crystalline Prophecy", "/wiki/Category:A_Crystalline_Prophecy_Missions"], ["A Moogle Kupo d'Etat", "/wiki/Category:A_Moogle_Kupo_d%27Etat_Missions"], ["A Shantotto Ascension", "/wiki/Category:A_Shantotto_Ascension_Missions"], ["Vision of Abyssea", "/wiki/Category:Vision_of_Abyssea_Quests"], ["Scars of Abyssea", "/wiki/Category:Scars_of_Abyssea_Quests"] ]					],					["Moblin Maze Mongers", "/wiki/Category:Moblin_Maze_Mongers"], ["Quests ›› ", "/wiki/Category:Quests", [							["Bastok Quests", "/wiki/Category:Bastok_Quests"], ["San d'Oria Quests", "/wiki/Category:San_d%27Oria_Quests"], ["Windurst Quests", "/wiki/Category:Windurst_Quests"], ["Jeuno Quests", "/wiki/Category:Jeuno_Quests"], ["Outlands Quests", "/wiki/Category:Outlands_Quests"], ["Other Quests", "/wiki/Category:Other_Quests"], ["Aht Urhgan Quests", "/wiki/Category:Aht_Urhgan_Quests"], ["Crystal War Quests", "/wiki/Category:Crystal_War_Quests"], ["Abyssea Quests", "/wiki/Category:Vision_of_Abyssea_Quests"] ]					]				]			]		],		[			["Wiki-related ›› ", "/wiki/Template:New_User", [					["Guides", "/wiki/Category:Guides"], ["Browse Userboxes ›› ", "/wiki/Category:Userboxes", [							["Create Userboxes", "/wiki/Special:UserBoxes"] ]					],					["Editing guide", "/wiki/FFXIclopedia:Editing_Guide"], ["Editing tips", "/wiki/FFXIclopedia:How_to_use_the_Item_Template_and_other_useful_Editing_Tips"], ["Policies ›› ", "/wiki/FFXIclopedia:Policies", [							["Report Vandal", "/wiki/FFXIclopedia:Vandalism"] ]					],					["Templates", "/wiki/Category:Templates"] ]			]		],		[			["Around the Web ›› ", "/wiki/Links", [					["Links", "/wiki/FFXIclopedia:Links"] ]			] 		]	];

var linkId = 0; var blockId = 0; var htmlResult = []; htmlResult.push(' '); for (var i = 0; i < navigationLinksArray.length; i++) { var link = navigationLinksArray[i]; htmlResult.push(''); for(var r = 0; r < link.length; r++) { rootBlocks.push(blockId-1); blockId = forwardSeek(link[r], blockId, 0, htmlResult); }		htmlResult.push(' '); }	htmlResult.push(' '); navigationPanel.innerHTML = htmlResult.join('\n'); } function searchInputChangeAndGo(text) { var searchInput = document.getElementById('searchInput'); var goButton = document.getElementById('searchGoButton'); if(typeof(searchInput)=='object'&&typeof(goButton)=='object') { searchInput.value = unescape(text); goButton.click; } } var currentSearchSuggestions = []; var currentSearchSuggestionIndex = -1; function advanceForward { if(currentSearchSuggestions.length>0) { if(currentSearchSuggestions.length!=1 && currentSearchSuggestionIndex>=0) { var currentKeySelectedSuggestion = document.getElementById('searchSuggestion'+currentSearchSuggestionIndex); if(typeof(currentKeySelectedSuggestion)=='object') currentKeySelectedSuggestion.className = ""; }		if(currentSearchSuggestionIndex+1 == currentSearchSuggestions.length) { currentSearchSuggestionIndex = 0; } else { currentSearchSuggestionIndex++; }		var newCurrentKeySelectedSuggestion = document.getElementById('searchSuggestion'+currentSearchSuggestionIndex); if(typeof(newCurrentKeySelectedSuggestion)=='object') newCurrentKeySelectedSuggestion.className = "searchSuggestHover"; } } function advanceBackward { if(currentSearchSuggestions.length>0) { if(currentSearchSuggestions.length!=1 && currentSearchSuggestionIndex>=0) { var currentKeySelectedSuggestion = document.getElementById('searchSuggestion'+currentSearchSuggestionIndex); if(typeof(currentKeySelectedSuggestion)=='object') currentKeySelectedSuggestion.className = ""; }		if(currentSearchSuggestionIndex <= 0) { currentSearchSuggestionIndex = currentSearchSuggestions.length-1; } else { currentSearchSuggestionIndex--; }		var newCurrentKeySelectedSuggestion = document.getElementById('searchSuggestion'+currentSearchSuggestionIndex); if(typeof(newCurrentKeySelectedSuggestion)=='object') newCurrentKeySelectedSuggestion.className = "searchSuggestHover"; } } function searchInputChange(searchBox, key) { if(typeof(searchBox)=='object') { switch(key) { case 38 /* UP KEY */: if(currentSearchSuggestions.length>0) advanceBackward; break; case 40 /* DOWN KEY */: if(currentSearchSuggestions.length>=0) advanceForward; break; default: if(searchBox.value!='') { if (window.XMLHttpRequest) xmlhttp=new XMLHttpRequest; else xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");

xmlhttp.onreadystatechange=function {						if (xmlhttp.readyState==4 && xmlhttp.status==200) { currentSearchSuggestionIndex = -1; var searchSuggest = document.getElementById('searchSuggest'); if(typeof(searchSuggest)=='object') { searchSuggest.innerHTML = ''; var response = eval('('+xmlhttp.responseText+')'); var suggestions = response.suggestions; currentSearchSuggestions = suggestions; var buffer = []; for(var suggestion in suggestions) { var text = suggestions[suggestion]; buffer.push(''+text+' '); }								searchSuggest.innerHTML=buffer.join('\n'); searchSuggest.style.display='block'; }						}					}					xmlhttp.open("GET","http://wiki.ffxiclopedia.org/index.php?action=ajax&rs=getLinkSuggest&format=json&query="+searchBox.value,true); xmlhttp.send; }			break; }	} } function searchInputHide { var searchSuggest = document.getElementById('searchSuggest'); if(typeof(searchSuggest)=='object') setTimeout(function {			searchSuggest.style.display = 'none';		}, 500); } function searchFormSubmit(searchForm) { if(currentSearchSuggestionIndex>=0) { searchForm.elements[1].value = currentSearchSuggestions[currentSearchSuggestionIndex]; }	return true; } function loadSearchSuggest { var searchContainer = document.getElementById('p-search'); if(typeof(searchContainer)=='object') { searchContainer.innerHTML = ' 	 Search ' + '\n' + '	 ' + '\n' + '		 ' + '\n' + '			' + '\n' + '			' + '\n' + '			 ' + '\n' + '			' + '\n' + '		 ' + '\n' + '	 ' + '\n' + '	 '+'\n'; }	} window.onload=function { loadNavigationLinks; loadSearchSuggest };