<script type="text/javascript">
//<![CDATA[
function enablearchive(obj) {
    var f = obj.form;           // all elements have their parent form in "form"
    var disable = obj.checked;  // Disable when checked
    if (f.elements["archiveflag"].checked==true && f.elements["storycode11"].checked==false) {
        f.elements["storycode10"].checked=true;
    }
    f.elements["storycode10"].disabled=!disable;
    f.elements["storycode11"].disabled=!disable;
    f.elements["expire_month"].disabled=!disable;
    f.elements["expire_day"].disabled=!disable;
    f.elements["expire_year"].disabled=!disable;
    f.elements["expire_hour"].disabled=!disable;
    f.elements["expire_minute"].disabled=!disable;
    f.elements["expire_ampm"].disabled=!disable;
}
//]]>
</script>
                            <form name="frmstory" action="{site_admin_url}/story.php" method="post" enctype="multipart/form-data">
                                <table cellspacing="0" cellpadding="3" width="100%">
                                    <tr>
                                        <td class="alignright" style="width:100px;">{lang_author}:</td>
                                        <td>{story_author}<input type="hidden" name="uid" value="{story_uid}"{xhtml}></td>
                                    </tr>
                                    <tr>
                                        <td class="alignright" style="vertical-align:top;">{lang_date}:</td>
                                        <td>
                                          <span dir="ltr">
                                            <select name="publish_month">
                                                {publish_month_options}
                                            </select>
                                            /
                                            <select name="publish_day">
                                                {publish_day_options}
                                            </select>
                                            /
                                            <select name="publish_year">
                                                {publish_year_options}
                                            </select>&nbsp;&nbsp;
                                            <select name="publish_hour">
                                                {publish_hour_options}
                                            </select>
                                            :
                                            <select name="publish_minute">
                                                {publish_minute_options}
                                            </select>
                                            {publishampm_selection}
                                            <input type="hidden" name="publish_second" value="{publish_second}"{xhtml}>
                                          </span><br{xhtml}>
                                          {publish_date_explanation}
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="alignright">{lang_title}:</td>
                                        <td><input type="text" size="48" maxlength="128" name="title" value="{story_title}"{xhtml}></td>
                                    </tr>
                                    <tr>
                                        <td class="alignright">{lang_topic}:</td>
                                        <td>
                                            <select name="tid">
                                                {topic_options}
                                            </select>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="alignright">{lang_show_topic_icon}:</td>
                                        <td>
                                            <input type="checkbox" name="show_topic_icon" {show_topic_icon_checked}{xhtml}>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="alignright">{lang_draft}:</td>
                                        <td><input type="checkbox" name="draft_flag" {is_checked}{xhtml}></td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            <table cellspacing="0" cellpadding="3" width="100%">
                                                <tr>
                                                    <td colspan="3" style="padding-left:20px;">{lang_archivetitle}</td>
                                                </tr>
                                                <tr>
                                                    <td class="alignright" style="padding-right:5px; width:20%">{lang_option}:</td>
                                                    <td style="width:20%">{lang_enabled}:<input type="checkbox" name="archiveflag" value="1" {is_checked2} onclick="enablearchive(this);"{xhtml}></td>
                                                    <td class="alignleft">
                                                        <label for="storycode10">
                                                            <input type="radio" name="statuscode" id="storycode10" value="10" {is_checked3}{xhtml}>{lang_optionarchive}
                                                        </label>&nbsp;
                                                        <label for="storycode11">
                                                            <input type="radio" name="statuscode" id="storycode11" value="11" {is_checked4}{xhtml}>{lang_optiondelete}
                                                        </label>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td class="alignright" style="vertical-align:top;padding-right:5px;">{lang_date}:</td>
                                                    <td colspan="2">
                                                      <span dir="ltr">
                                                        <select id="expire_month" name="expire_month">
                                                            {expire_month_options}
                                                        </select>
                                                        /
                                                        <select name="expire_day">
                                                            {expire_day_options}
                                                        </select>
                                                        /
                                                        <select name="expire_year">
                                                            {expire_year_options}
                                                        </select>&nbsp;&nbsp;
                                                        <select name="expire_hour">
                                                            {expire_hour_options}
                                                        </select>
                                                        :
                                                        <select name="expire_minute">
                                                            {expire_minute_options}
                                                        </select>
                                                        {expireampm_selection}
                                                        <input type="hidden" name="expire_second" value="{expire_second}"{xhtml}>
                                                      </span><br{xhtml}>
                                                    </td>
                                                </tr>
                                            </table>
                                         </td>
                                    </tr>
                                    <tr>
                                        <td class="alignright" style="vertical-align:top;">{lang_mode}:</td>
                                        <td style="vertical-align:top;">
                                            {featured_options}
                                            <select name="frontpage">
                                                {frontpage_options}
                                            </select><div style="padding-top:5px;">
                                            <select name="commentcode">
                                                {comment_options}
                                            </select>
                                            <select name="trackbackcode">
                                                {trackback_options}
                                            </select>
                                            </div>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="alignright" style="vertical-align:top;">{lang_sid}:</td>
                                        <td><input type="text" dir="ltr" size="40" maxlength="40" name="sid" value="{story_id}"{xhtml}></td>
                                    </tr>
                                    <tr>
                                        <td class="alignright" style="vertical-align:top;">{lang_introtext}:</td>
                                        <td><textarea name="introtext" cols="45" rows="12" style="width:100%">{story_introtext}</textarea></td>
                                    </tr>
                                    <tr>
                                        <td class="alignright" style="vertical-align:top;">{lang_bodytext}:</td>
                                        <td><textarea name="bodytext" cols="45" rows="20" style="width:100%">{story_bodytext}</textarea></td>
                                    </tr>
                                    <tr>
                                        <td class="alignright" style="vertical-align:top;"><b>{lang_postmode}:</b></td>
                                        <td style="vertical-align:top;">
                                            <select name="postmode">
                                                {post_options}
                                            </select>
                                            <br{xhtml}>
                                            {lang_allowed_html}
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="alignright" style="vertical-align:top;"><b>{lang_images}:</b></td>
                                        <td style="vertical-align:top;">
                                            {saved_images}
                                            {image_form_elements}
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="alignright">{lang_hits}:</td>
                                        <td>
                                            <table cellspacing="0" cellpadding="0" width="100%">
                                                <tr>
                                                    <td class="alignleft">
                                                        <input type="hidden" name="hits" value="{story_hits}"{xhtml}>{story_hits}
                                                        <input type="hidden" name="comments" value="{story_comments}"{xhtml}>
                                                        <input type="hidden" name="trackbacks" value="{story_trackbacks}"{xhtml}>
                                                        <input type="hidden" name="numemails" value="{story_emails}"{xhtml}>
                                                        <input type="hidden" name="owner_id" value="{owner_id}"{xhtml}>
                                                    </td>
                                                    <td>{lang_comments}:{story_comments}</td>
                                                    <td>{lang_trackbacks}:{story_trackbacks}</td>
                                                    <td class="alignright">{lang_emails}:{story_emails}</td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2"><hr{xhtml}></td>
                                    </tr>
                                    <tr>
                                        <td colspan="2"><b>{lang_accessrights}</b></td>
                                    </tr>
                                    <tr>
                                        <td class="alignright">{lang_owner}:</td>
                                        <td>{owner_name}</td>
                                    </tr>
                                    <tr>
                                        <td class="alignright">{lang_group}:</td>
                                        <td>
                                            {group_dropdown}
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">&nbsp;</td>
                                    </tr>
                                    <tr>
                                        <td colspan="2"><b>{lang_permissions}</b>:</td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">{lang_perm_key}</td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            {permissions_editor}
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">{permissions_msg}</td>
                                    </tr>
                                    <tr><td colspan="2">&nbsp;</td></tr>
                                    <tr>
                                        <td colspan="2">
                                            <input type="submit" value="{lang_save}" name="mode"{xhtml}>
                                            <input type="submit" value="{lang_preview}" name="mode"{xhtml}>
                                            <input type="submit" value="{lang_cancel}" name="mode"{xhtml}>
                                            {delete_option}
                                            {submission_option}
                                            <input type="hidden" name="old_sid" value="{old_story_id}"{xhtml}>
                                            <input type="hidden" name="editopt" value="default"{xhtml}>
                                            <input type="hidden" name="hour_mode" value="{hour_mode}"{xhtml}>
                                            <input type="hidden" name="{gltoken_name}" value="{gltoken}"{xhtml}>
                                        </td>
                                    </tr>
                                </table>
                            </form>
<script type="text/javascript">
<!-- This code will only be executed by a browser that supports Javascript -->
var jstest = {showarchivedisabled};
if (jstest) {
    document.frmstory.expire_month.disabled=true;
    document.frmstory.expire_day.disabled=true;
    document.frmstory.expire_year.disabled=true;
    document.frmstory.expire_hour.disabled=true;
    document.frmstory.expire_minute.disabled=true;
    document.frmstory.expire_ampm.disabled=true;
    document.frmstory.storycode10.disabled=true;
    document.frmstory.storycode11.disabled=true;
}
</script>
