// on the login form pages, when you click links saying e.g. 'register for access'
// we need to store the email currently on the email entry form, to use on the next
// page
var email_link_click = function(e) {
    // some forms have an "email" field; others (GMN) a "username" field
    var input_field = $('id_email'); 
    if (input_field == null)
    {
        input_field = $('id_username');
    }
    if (input_field.value != "")
    {
        window.location.href = this.href + "?email=" + input_field.value
        // return false; // too easy
        Event.stop(e);
    }
}

links = $$('a.store_email_on_click');

for ( i = 0; i < links.length; i++ )
{ 
    Event.observe( links[i], 'click', email_link_click);
}
