{template header}
<div class="subtable nav" style="width: {TABLEWIDTH}">
<a href="$indexname">$bbname</a> &raquo; {lang supe_import_forum}
</div><br>

<script language="JavaScript">
function validate(theform) {
	if (!theform.importsubmit.disabled && !theform.fid.value) {
		alert('{lang xs_pls_choose_forum_you_want}');
		return false;
	}
	theform.importsubmit.disabled = true;
	return true;
}

var threadtypes = new Array();
$js_threadtypes
var threadtypesrequired = new Array();
$js_threadtypesrequired

function selectthreadtype(fid) {
	if(!fid) {
		return;
	}
	var threadtype = threadtypes[fid];
	typeidtbody = $('tbody1');

	//note 如果有原结点，删除原结点
	if(typeidtbody.firstChild) {
		typeidtbody.firstChild.removeNode(true);
	}

	//note 如果有主题分类，创建新结点
	if(threadtype != '') {
		tr1 = document.createElement('tr');
		td1 = document.createElement('td');
		td1.setAttribute('className', 'altbg1');
		td1.innerHTML = '<span class="bold">{lang admin_type}:</span>';
		td2 = document.createElement('td');
		td2.setAttribute('className', 'altbg2');
		var html = '<select name="typeid">';
		if(threadtypesrequired[fid] == '') {
			html += '<option value="0"></option>';
		}
		for(k in threadtype) {
			html += '<option value="'+k+'">' + threadtype[k] + '</option>';
		}

		html += '</select>';
		td2.innerHTML = html;
		tr1.appendChild(td1);
		tr1.appendChild(td2);
		typeidtbody.appendChild(tr1);
	}
}
</script>

<form method="post" name="input" action="post.php?action=import&extra=$extra&importsubmit=yes&itemid=$itemid" $enctype onSubmit="return validate(this)">
<input type="hidden" name="formhash" value="{FORMHASH}">

<table cellspacing="{INNERBORDERWIDTH}" cellpadding="{TABLESPACE}" width="{TABLEWIDTH}" align="center" class="tableborder">
<tr><td colspan="2" class="header">{lang supe_choose_forum}
</td></tr>

<tr>
<td class="altbg1 bold" width="40%">{lang username}:</td>
<td class="altbg2" width="60%">$discuz_userss <span class="smalltxt">[<a href="$link_logout">{lang member_logout}</a>]</span></td>
</tr>

<!--{if $seccodecheck}-->
	<tr>
	<td class="altbg1">{lang seccode}:</td>
	<td class="altbg2"><input type="text" name="seccodeverify" size="12" maxlength="4" id="seccodeverify" onBlur="checkseccode()"> <img id="seccode" style="cursor:pointer" onclick="this.src='seccode.php?update=' + Math.random()" src="seccode.php" class="absmiddle" alt="" /></div><div class="notice" id="checkseccode"> <span class="smalltxt">{lang secode_refresh}</span>
	<script type="text/javascript">$('seccode').src = 'seccode.php?update=' + Math.random()</script></td>
	</tr>
<!--{/if}-->

<tr>
<td class="altbg1"><span class="bold">{lang supe_target_forum}:</span></td>
<td class="altbg2">
<select name="fid" id="fid" onchange="selectthreadtype(this.options[this.options.selectedIndex].value)">
$forumselect
</select>
</td>
</tr>

<tbody id="tbody1">
</tbody>

<tr><td colspan="2" align="left" class="altbg1">{lang supesite_import_comment}</td></tr>
</table>
<br><center><input class="button" type="submit" name="importsubmit" value="{lang submit}" tabindex="5"></center>
</form>

<script type="text/javascript">
	options1 = $('fid').options;
	var len = options1.length;
	for(var i=0; i < len; i++) {
		if(options1[i].value != '') {
			options1[i].selected = true;
			selectthreadtype(options1[i].value);
			break;
		}
	}
</script>
{template footer}