<!--
<?php
print <<<EOT
-->
<SCRIPT LANGUAGE="JavaScript">
 <!--
function upfile(url,name,size,label){
	document.getElementById(label).value=url;
	//ay=name.Split(".");
	//alert(narray);
	arr=name.split('.');
	document.getElementById("name_"+label).value=arr[0];
}
function sub(form){
	if(get_obj('batch_one').checked==true&&get_obj('title').value==''){
		alert("圖片主題不能為空");
		form.title.focus();
		return false;
	}
	if(form.fid.value==''||form.fid.value=='0'){
		alert("請選擇一個欄目");
		form.fid.focus();
		return false;
	}
}
 //-->
 </SCRIPT>
<table width="98%" border="0" cellspacing="1" cellpadding="3" class="tablewidth" bordercolor="#CCCCCC">
  <form id="form8" name="form8" method="post" action="index.php?lfj=$lfj&action=$job" onsubmit="return sub(this);">
    <tr   class="head" align="left"> 
      <td colspan="2" height="25">快速發圖</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="14%">系統分類:</td>
      <td width="86%">$sort_fid</td>
    </tr>
    <tr bgcolor="#FFFFFF" id="title_tr" style="display:none;">
      <td width="14%">圖片主題名稱:</td>
      <td width="86%">
        <input type="text" name="title" id="title" size="30">
      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="14%">默認上傳兩張圖片。<br>
        你可以設置更多。<br>
        增加 
        <input type="text" size="3" name=nums value="2">
        項 
        <input type="button" name="Submit2" value="增加" onClick=showinput()>
      </td>
      <td width="86%"> <span class='t'>標題</span>: 
        <input type="text" name="namedb[]" size="30" id="name_urla">
        地址: 
        <input type="text" name="photodb[]" size="40" id="urla">
        [<a href='javascript:' onclick='window.open("upfile.php?label=urla","","width=350,height=50,top=200,left=400")'><font color="#FF0000">點擊上傳圖片</font></a>]<br>
        <span class='t'>標題</span>: 
        <input type="text" name="namedb[]" size="30" id="name_urlb">
        地址: 
        <input type="text" name="photodb[]" size="40" id="urlb">
        [<a href='javascript:' onClick='window.open("upfile.php?label=urlb","","width=350,height=50,top=200,left=400")'><font color="#FF0000">點擊上傳圖片</font></a>]<br>
        <div id="input"></div>
      </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="14%">是否定義為組圖</td>
      <td width="86%"> 
        <input type="radio" name="batch" value="1" id="batch_one" onclick="posttype('one')">
        組圖(同一篇文章,一張圖佔一頁) 
        <input type="radio" name="batch" value="0" checked onclick="posttype('more')">
        非組圖(指一張圖一篇文章)</td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td width="14%" height="28">&nbsp;</td>
      <td width="86%" height="28"> 
        <input type="submit" name="Submit" value="提交">
        <script>
totalnum=0;
function showinput(){
	var str=input.innerHTML;
	var num=2;
	num=document.form8.nums.value;
	for(var i=1;i<=num;i++){
		totalnum=totalnum+i;
		str+=' <span class=t>標題</span>: <input type="text" name="namedb[]" size="30" id="name_url'+totalnum+'">  地址: <input type=text name=photodb[] size=40 id=url'+totalnum+'> [<a href=\'javascript:\' onClick=\'window.open("upfile.php?label=url'+totalnum+'","","width=350,height=50,top=200,left=400")\'><font color="#FF0000">點擊上傳圖片</font></a>]<br>';
	}
	input.innerHTML=str;
	set_name();
}

function posttype(t){
	if(t=='more'){
		get_obj("title_tr").style.display='none';
	}else{
		get_obj("title_tr").style.display='';
	}
	set_name();
}
function set_name(){
	obj=document.body.getElementsByTagName("span");
	for(var i=0;i< obj.length;i++ ){
		if(obj[i].className=='t')
		{
			if(get_obj('batch_one').checked==true){
				obj[i].innerHTML="介紹";
			}else{
				obj[i].innerHTML="標題";
			}
			
		}
	}
}
</script>
        <input type="hidden" name="postdb[bak_id]" value="$bak_id">
      </td>
    </tr>
  </form>
</table>
<!--
EOT;
?>
-->