Just hoping someone could guide me in the right direction and possibly help with some syntax errors. (Don't finish the script for me just help me out please!)

Heres the form
index.html
HTML Code:
<form action="writePass(randomPass)" method="post">
    Email: <input type="text" name="email" id="getEmail"/>
    <input type="submit" name="submit" value="Send" />
</form>
javascript.js
Code:
emails=[];
emails[0]="thisemail@yahoo.com";
emails[1]="thatemail@gmail.com";

var mailPass="mailto:"+document.getElementById("getEmail").value;

//Collects email value and checks to see if it matches an email in the array then returns a random number
function getEmail(emailsArray) {
    var email = document.getElementById("getEmail").value;
    if (emailsArray.indexOf(email)>=0) {
        var randomPass=Math.floor(Math.random()*200000)+100000;
        return randomPass;
    } else {
        alert("You are not authorized.");
    }
}


function writePass (randomPass) {
    if (randomPass != null) {
        document.write(mailPass);
    } else {
        document.write("mailto:"+document.getElementById("getEmail").value);
    }
}

Thank you in advanced!