<form method="post" name="shares" action="<?php echo Horde::applicationUrl('calendars.php') ?>" onsubmit="return checkSubmit();">
<input type="hidden" name="actionID" value="<?php echo SHARE_SAVE ?>" />

<table border="0" align="center" width="100%" cellspacing="0" cellpadding="0">
<tr><td class="header" align="left"><b><?php echo _("Calendar") ?></b></td></tr>
<tr><td class="item"><table border="0" cellpadding="3">

<tr valign="top"><td class="item">
<?php echo _("Your calendars:") ?><br />
<select name="share" class="fixed" onchange="javascript:newChoice()">
  <option value="-1"><?php echo _("Select a calendar") ?></option>
<?php foreach ($personal_calendars as $id => $cal): ?>
  <option value="<?php echo $id ?>"><?php echo $cal->getShareName() ?></option>
<?php endforeach; ?>
</select>
</td></tr>

<tr><td class="item"><table border="0">

<tr valign="top"><td class="item">

<input type="hidden" name="edit_share" value="<?php echo !empty($to_edit) ? $to_edit : '' ?>" />
<?php echo _("Calendar's name:") ?><br />
<input name="id" size="30" maxlength="60" class="fixed" <?php echo !empty($to_edit) ? 'value="' . $toedit->getId() . '" ' : '' ?> /><br />

<?php if (!$prefs->isLocked('description')): ?>
<?php echo _("Description:") ?><br />
<span class="fixed">
<textarea wrap="hard" name="description" rows="6" cols="80" class="fixed"><?php echo !empty($to_edit) ? $toedit->getDescription() : '' ?></textarea><br />
</span>
<?php endif; ?>

<?php echo _("Calendar's Type:") ?><br />
<select name="type" class="fixed" onchange="javascript:newType()">
  <option value="0"><?php echo _("Private") ?></option>
  <option value="1"><?php echo _("Shared") ?></option>
</select>
<input type="button" name="accesslist" class="button" onclick="open_share_edit_win(editURL.replace(/%40ID%40/, document.shares.edit_share.value));" value="" style="visibility: hidden" />
<br />

</td></tr></table></td></tr>
<tr>
  <td valign="middle">
    <table border="0" width="100%" cellpadding="0">
    <tr>
      <td>
        <input type="submit" name="save" class="button" onclick="document.shares.actionID.value = <?php echo SHARE_SAVE ?>; return true" value="<?php echo $actionID == SHARE_EDIT ? _("Change") : _("Create") ?>" />
        <input type="submit" name="delete" class="button" onclick="document.shares.actionID.value = <?php echo SHARE_DELETE ?>" value="<?php echo _("Delete") ?>" />
        <input type="submit" name="new" class="button" onclick="clearForm(); document.shares.save.value = '<?php echo _("Create") ?>';" value="<?php echo _("Reset") ?>" />
        <input type="submit" name="back" class="button" onclick="cancelSubmit = true; document.location.href = '<?php echo Horde::applicationUrl('prefs.php?group=share', true) ?>'" value="<?php echo _("Back to Calendar Options") ?>" />
      </td>
    </tr>
    </table>

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