// ==UserScript==
// @name           Gaia Online: Automatically Fill in Password Information
// @namespace      OfflineGamers.com
// @description    Automatically fills in password fields in Gaia Online.
// @include        http://gaiaonline.com/*
// @include        http://*.gaiaonline.com/*
// ==/UserScript==

// These should be filled in if you have multiple accounts.
// These passwords will be filled into any "verify password"
// screens that appear when you do various tasks.
// If the username you're using isn't on the list,
// the default password will be used, which is useful
// if your accounts share the same password.
var passwords = {
	"Username1" : "password1",
	"Username2" : "password2",
	"Username3" : "password3",
	'*' : "password123" // default password
};

// No need to edit below this line.
var username = document.body.innerHTML.match(/<li class="avatarName">Welcome back <span style=".+?" class=".+?">(.+?)!<\/span><\/li>/i)[1];
if (document.getElementById("password_entry"))
	document.getElementById("password_entry").value = (typeof(passwords[username]) == "string" ? passwords[username] : passwords['*']);