{?set jieqi_blocks_module = "article"?}
{?set jieqi_blocks_config = "authorblocks"?}
<script type="text/javascript">
var customprice = '{?$customprice?}';
function frmnewdraft_validate(){
  if(document.frmnewdraft.chaptername.value == ""){
    alert("请输入章节标题");
    document.frmnewdraft.chaptername.focus();
    return false;
  }
}
//统计输入字数
function show_inputwords(txt){
	txt = $_(txt);
	var words = (arguments.length > 1) ? $_(arguments[1]) : $_(txt.id + '_words');
	words.innerHTML = txt.value.replace(/[\x00-\x08\x0e-\x1f\x21-\xff]+/gi, 'w').replace(/\s/g, '').length;
}
//显示默认字数
addEvent(window, 'load', function(){show_inputwords('chaptercontent');});
</script>
<script type="text/javascript" src="{?$jieqi_url?}/scripts/attaches.js"></script>
<form name="frmnewdraft" id="frmnewdraft" action="{?$jieqi_modules['article']['url']?}/newdraft.php?do=submit" method="post" onsubmit="return frmnewdraft_validate();" enctype="multipart/form-data">
<table width="100%" class="grid" cellspacing="1" align="center">
<caption>新建草稿</caption>
<tr valign="middle" align="left">
	<td class="tdl" width='20%'>草稿类型：</td>
	<td class="tdr">
	<label class="radio"><input type="radio" name='isvip' value='0' checked="checked" onclick="document.getElementById('selarticle').style.display='block';document.getElementById('selobook').style.display='none';if(customprice == '1') document.getElementById('sprice').style.display='none';" />免费章节</label> &nbsp; 
	<label class="radio"><input type="radio" name='isvip' value='1' onclick="document.getElementById('selarticle').style.display='none';document.getElementById('selobook').style.display='block';if(customprice == '1') document.getElementById('sprice').style.display='';" />VIP章节</label> &nbsp; 
	</td>
  </tr>
<tr valign="middle" align="left">
  <td class="tdl">小说名称：</td>
  <td class="tdr">
		<div id="selarticle" style="display:block;">
		<select class='select'  size='1' name='articleid' id='articleid'>
		<option value='0'>--请选择--</option>
		{?section name=i loop=$articlerows?}
		<option value='{?$articlerows[i].articleid?}'>{?$articlerows[i].articlename?}</option>
		{?/section?}
		</select>
		</div>
		<div id="selobook" style="display:none;">
		<select class='select'  size='1' name='obookid' id='obookid'>
		<option value='0'>--请选择--</option>
		{?section name=i loop=$obookrows?}
		<option value='{?$obookrows[i].obookid?}'>{?$obookrows[i].obookname?}</option>
		{?/section?}
		</select>
		</div>
  </td>
</tr>
<tr valign="middle" align="left">
  <td class="tdl">章节标题：</td>
  <td class="tdr"><input type="text" class="text" name="chaptername" id="chaptername" size="50" maxlength="50" value="" /></td>
</tr>
{?if $customprice > 0?}
<tr valign="middle" align="left" id="sprice" style="display:none;">
	<td class="tdl">本章定价：</td>
	<td class="tdr"><input type="text" class="text" name="saleprice" id="saleprice" size="10" maxlength="10" value="" /><span class="hot">{?$egoldname?}(留空则自动按字数计价)</span></td>
</tr>
{?/if?}
{?if $authtypeset > 0?}
<tr valign="middle" align="left">
  <td class="tdl">小说排版：</td>
  <td class="tdr">
  <label class="radio"><input type="radio" name="typeset" value="1" checked="checked" />自动排版</label>
  <label class="radio"><input type="radio" name="typeset" value="0" />无需排版</label>
  </td>
</tr>
{?/if?}
{?if $uptiming > 0?}
<tr valign="middle" align="left">
	<td class="tdl">是否定时发表：</td>
	<td class="tdr">
	<label class="radio"><input type="radio" name="uptiming" value="0" checked="checked" onclick="document.getElementById('pubtime').style.display='none';" />否</label> &nbsp; 
	<label class="radio"><input type="radio" name="uptiming" value="1" onclick="document.getElementById('pubtime').style.display='';" />是</label> &nbsp; 
	</td>
</tr>
<tr valign="middle" align="left" id="pubtime" style="display:none;">
	<td class="tdl">定时发表时间：</td>
	<td class="tdr">
	<input type="text" class="text" name="pubyear" id="pubyear" size="4" maxlength="4" value="{?$jieqi_time|date:'Y'?}" />年<input type="text" class="text" name="pubmonth" id="pubmonth" size="2" maxlength="2" value="{?$jieqi_time|date:'m'?}" />月<input type="text" class="text" name="pubday" id="pubday" size="2" maxlength="2" value="{?$jieqi_time|date:'d'?}" />日<input type="text" class="text" name="pubhour" id="pubhour" size="2" maxlength="2" value="" />时<input type="text" class="text" name="pubminute" id="pubminute" size="2" maxlength="2" value="" />分
	</td>
</tr>
{?/if?}
<tr valign="middle" align="left">
  <td class="tdl">章节内容：<br />已输入 <span class="hot" id="chaptercontent_words">0</span> 字</td>
  <td class="tdr"><textarea class="textarea" name="chaptercontent" id="chaptercontent" rows="25" cols="80" onkeyup="show_inputwords(this);" oninput="show_inputwords(this);" onpropertychange="show_inputwords(this);"></textarea></td>
</tr>
{?if $canupload == true && $maxattachnum > 0?}
<tr valign="middle" align="left">
  <td class="tdl">附件限制：</td>
  <td class="tdr">文件类型：{?$attachtype?}, 图片最大：{?$maximagesize?}K, 文件最大：{?$maxfilesize?}K</td>
</tr>
<tr valign="middle" align="left">
  <td class="tdl">附件上传：</td>
  <td class="tdr">
  <input type="file" class="file" name="attachfile[]" id="attachfile" onchange="Attaches.addFile('attachfile', 'attachdiv', true);" /><button type="button" class="filebutton" onclick="if(document.all){document.getElementById('attachfile').outerHTML += '';}else{document.getElementById('attachfile').value = '';}">清空</button>
  <div id="attachdiv"></div>
  </td>
</tr>
{?/if?}
<tr valign="middle" align="left">
  <td class="tdl">&nbsp;<input type="hidden" name="act" value="newdraft" />{?$jieqi_token_input?}</td>
  <td class="tdr"><button type="submit" class="button" name="submit">提 交</button></td>
</tr>
</table>
</form>