<?php if (!$prefs->isLocked('drafts_folder')): ?>
<script language="JavaScript" type="text/javascript">
<!--

function newFolderName()
{
    document.prefs.drafts.onchange = null;
    if (document.prefs.drafts.selectedIndex == 0) {
        var folder = window.prompt('<?php echo addslashes(_("Enter the name for your new drafts folder")) ?>', document.prefs.drafts_new . value ? document.prefs.drafts_new.value : '');
        if (folder != '' && folder != null) {
            document.prefs.drafts_new.value = folder;
            document.prefs.drafts[0].text = '<?php echo addslashes(_("Create a new drafts folder")) ?> [' + document.prefs.drafts_new.value + ']';
        }
    }
    document.prefs.drafts.onchange = newFolderName;
}

// -->
</script>

<table border="0">
<tr>
    <td><?php echo _("Drafts folder:") ?><br />
	<select name="drafts" onchange="newFolderName();"><?php echo IMP::flistSelect(_("Create a new drafts folder"), true, array('INBOX'), IMP::preambleString() . $prefs->getValue('drafts_folder')) ?></select>
	<input type="hidden" name="drafts_new" value="" />
    </td>
</tr></table>

<?php endif; ?>
