function formSubmit (type) {
    var form = document.forms[0];
    form.forms_submit_id.value = type;
    // if this is a login submit (not just locale toggle), then calculate client info
    if (type == "go") {
        sendClientInfo(form);
        sendFlashVersion(form);
        //  for testing (central timezone)
        // form.timeOffset.value = 360;
    }
    form.submit();
}

// Check for keypress - when enter hit, submit the form
if ('1'[0]) document.captureEvents(Event.KEYDOWN);
document.onkeydown = function(e) {
    if (!e && window.event)
    e = {
        which: event.keyCode
    };
    if (e.which == 13) {
        formSubmit('go');
    }
    return true;
}

function localeSubmit (locale) {
    document.forms[0].locale.value = locale;
    formSubmit('locale');
}

