// ==UserScript==
// @name           ALPA/ASA MEC Login
// @namespace      http://www.flywithsteve.com/projects/scripts
// @description    This script automatically logs you in to the MEC/Crewroom website for ASA pilots.
// @include        http://crewroom.alpa.org/asa/DesktopDefault.aspx
// ==/UserScript==

// Username and Password
var myAlpaID, myAlpaPass;
myAlpaID = " --- USERNAME HERE --- ";
myAlpaPass = " --- PASSWORD HERE --- ";

//add event listener to call my anonymous function after the page loads
window.addEventListener('load',
function() {
	// Input name/pass
	document.getElementById("_ctl1_Id_No").value = myAlpaID;
	document.getElementById("_ctl1_password").value = myAlpaPass;
	
	// Submit login form.
	document.getElementById("_ctl1_SigninBtn").click();
}, true);