<script language="JavaScript" type="text/javascript">
<!--

function submit_form()
{
<?php if (!$driver->getParam('hordeauth', $realm)): ?>
    if (document.vacation.password.value == "") {
        alert('<?php echo addslashes(_("You must provide your password")) ?>');
        document.vacation.password.focus();
        return false;
    }
<?php endif; ?>
    if (document.vacation.mess.value == "" && document.vacation.mode.value == "set") {
        alert('<?php echo addslashes(_("You must provide some message text to set a vacation notice")) ?>');
        document.vacation.mess.focus();
        return false;
    } else {
        return true;
    }
}
//-->
</script>

<table class="light" border="0" cellpadding="2" cellspacing="0">
<tr>
<td class="header">
  <?php echo _("Change Vacation Notices") ?>
</td>
</tr>
<tr>
<td>

<div class="light">
  <?php echo _("A vacation notice will automatically reply to any incoming mail you receive while you are away or unable to attend to your e-mail -- for example while on vacation or out of town on business.") ?>
  <?php echo _("It could be used as a courtesy to let others know why you are not answering their e-mail to you.") ?>
  <?php echo _("This form lets you install or remove a vacation notice for your e-mail account. You should edit the default message to meet your needs.") ?>
</div>
<br />
<form class="light" method="post" action="<?php echo Horde::applicationUrl('main.php') ?>" name="vacation">
<?php echo Horde::formInput() ?>

<input type="radio" name="mode" value="set" checked="checked">
       <?php echo _("Set/install vacation notice") ?>
<br />
<input type="radio" name="mode" value="unset">
       <?php echo _("Unset/remove vacation notice") ?>

<div>
<br />
<?php echo _("Message:") ?>
<br />
<textarea name="mess" rows="8" cols="70"><?php echo htmlspecialchars($curmessage) ?></textarea>
</div>

<div>
<br />
<?php echo _("Alias address for this account (optional):") ?>
<br />
<input name="alias" type="text" size="70">
<?php echo Help::link('vacation', 'vacation-alias') ?>
<br />
</div>

<div class="light">
<br />

<?php if (!$driver->getParam('hordeauth', $realm)): ?>
<?php echo _("For your protection and safety, you must identify yourself with your login password to verify this change.") ?>
<?php echo _("Then submit the form so that your vacation notice can be updated.") ?>
<br />
<br />
<?php echo _("Your password:") ?>&nbsp;
<input type="password" name="password" size="12" maxlength="32" />&nbsp;
<?php endif; ?>
<input class="button" type="submit" name="submit" value="<?php echo _("Submit") ?>" onclick="return submit_form();" />

</div>
</form>
</td>
</tr>
</table>
