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

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

// -->
</script>

<table border="0">
 <tr>
  <td><?php echo _("Spam folder:") ?><br />
   <select name="spam" onchange="newSpamFolderName();"><option><?php echo _("None") ?></option><?php echo IMP::flistSelect(_("Create a new Spam folder"), true, array('INBOX'), IMP::addPreambleString($prefs->getValue('spam_folder'))) ?></select>
   <input type="hidden" name="spam_new" value="" />
  </td>
 </tr>
</table>
<?php endif; ?>
