<script language="JavaScript" type="text/javascript">
<!--
var loading;
function accountSubmit(isnew)
{
    if ((isnew != null) || (document.fm_switch.account[document.fm_switch.account.selectedIndex].value != '')) {
        if (loading == null) {
            loading = true;
            document.fm_switch.submit();
        }
    }
}
// -->
</script>

<?php echo _("Your accounts:") ?>&nbsp;<br />
<form name="fm_switch" action="<?php echo $fetch_url ?>">
<?php Util::pformInput() ?>
<input type="hidden" name="actionID" value="fetchmail_prefs_edit" />
<select name="account" class="fixed" onchange="javascript:accountSubmit()">
  <option value=""><?php echo _("Select an account") ?></option>
<?php for ($i = 0; $i < count($accounts); $i++): ?>
  <option value="<?php echo $i ?>"><?php echo $accounts[$i] ?></option>
<?php endfor; ?>
</select> or
<input type="button" class="button" onclick="document.fm_switch.actionID.value='fetchmail_create';accountSubmit(true);return true;" value="<?php echo _("Create a New Account") ?>" />
</form>
</td></tr></table></td></tr></table>

<br />
<table border="0" align="center" width="100%" cellspacing="0" cellpadding="0"><tr><td nowrap="nowrap">
<input type="button" name="back" class="button" onclick="document.location.href='<?php echo $prefs_url ?>'" value="<?php echo _("Return to Fetch Mail") ?>" />
</td></tr></table>
