<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset={sys_charset}">
<title>channel select</title>
<link href="{adminStylePath}style/common.css" rel="stylesheet" type="text/css">
<script language="javascript" src="{adminStylePath}js/common.js"></script>
<script>
var act = null;
var tempO = { form_input:null,tmpValue:null,tmpTxt:null };

function getAllTitle(tmpValue,tmpTxt)
{
	var str = '';
	for(var i=2; i<tmpValue.length; i=i+2)
	{
		str += getTitle(tmpValue.substring(0,i));
	}
	str += tmpTxt;
	return str;
}

function getTitle(tmpValue)
{
	var str = '';
	str = document.getElementById('td_'+tmpValue).title + ' -> ';
	return str;
}

function submitOpener() 
{ 
	if(window.opener.document.getElementById(tempO.form_input) && window.opener.document.getElementById(tempO.form_input+'_show'))
	{
		if(document.getElementById('td_status')) document.getElementById('td_status').innerHTML = "成功选择["+tempO.tmpTxt+"]! <br />如果没有自动关闭当前窗口,请手动关闭.";
		window.opener.document.getElementById(tempO.form_input).value=tempO.tmpValue;
		window.opener.document.getElementById(tempO.form_input+'_show').value = tempO.tmpTxt;
		window.close();
	}
}

function returnChannelValue(tmpValue,tmpTxt)
{
	if(act=="insert")
	{
		tmpTxt = getAllTitle(tmpValue,tmpTxt);
		window.opener.referencebrowser_setReference('user_channel_channelid_list',tmpValue,tmpTxt,1);
	}
	else
	{
		submitOpener();
	}
}

function clearSelect()
{
	window.opener.document.getElementById('user_channel_channelid').value='';
	window.opener.document.getElementById('user_channel_channelid_show').value ='选择频道';
	window.close();
}

function closeWin()
{
	window.close();
}

function init()
{
	QueryString_Parse();
	act = QueryString("act");
	if(act=="insert")
	{
		var inputO =  document.getElementsByTagName("input");
		if(inputO.length>0)
		{			
	  	for(i=0; i<inputO.length; i++)
	  	{
	  		if(inputO[i].name.toLowerCase()=="btn_handle")
	  		{
		  		inputO[i].value = "插入";
			}
	  	}
		  
	  }
		
	}
	else
	{
		document.getElementById('span_clear').style.display="";
	}
}

</script>
</head>

<body onload="init()" leftmargin="0" topmargin="0">

<div class="line_space"><img src="{adminStylePath}images/blank.gif"></div>
<div class="select_window_div">
<table class="list_tb" cellpadding="0" cellspacing="0">
<tr class="list_title_tr_bg">
<td width="30" class="list_title_td">&nbsp;</td>
<td width="50" class="list_title_td">编号</td>
<td width="260" class="list_title_td">分类名</td>
<td width="50" class="list_title_td">状态</td>
<td width="50" class="list_title_td">属性</td>
<td width="110" class="list_title_td">所属用户</td>
<td width="50" class="list_title_td">操作</td>
</tr>
<!-- BEGIN ListChannel -->
<tr  {ListChannel.tr_id} class="{ListChannel.tr_css}" {ListChannel.tr_onmouse} {ListChannel.tr_style}>
<td class="{ListChannel.td_css}" {ListChannel.td_onmouse}>&nbsp;{ListChannel.show_arrow}</td>
<td class="{ListChannel.td_css}" {ListChannel.td_onmouse} title="ID={ListChannel.channelid}">{ListChannel.num}</td>
<td id="td_{ListChannel.channelid}" title="{ListChannel.title_info}" class="{ListChannel.td_css}" {ListChannel.td_onmouse}>{ListChannel.title}</td>
<td class="{ListChannel.td_css}" {ListChannel.td_onmouse}>{ListChannel.status}</td>
<td class="{ListChannel.td_css}" {ListChannel.td_onmouse}>{ListChannel.flag}</td>
<td class="{ListChannel.td_css}" {ListChannel.td_onmouse}>&nbsp;{ListChannel.username}</td>
<td class="{ListChannel.td_css}" {ListChannel.td_onmouse}><input type="button" name="btn_handle" value="选择" onclick="returnChannelValue('{ListChannel.channelid}','{ListChannel.title_info}')"; {ListChannel.is_disabled}></td>
</tr>
<!-- END ListChannel -->
</table>               
</div>
<table class="select_window_bottom" width="100%" cellpadding="0" cellspacing="0">
<tr>
<td width="300"  id="td_status" class="select_window_bottom_left">&nbsp;</td>
<td align="right">
	<span id="span_clear" style="display:none"><a href="javascript:clearSelect()">[---清空---]</a></span>&nbsp;&nbsp;
	<a href="javascript:closeWin()">[---关闭---]</a>&nbsp;&nbsp;
</td>
</tr>
</table> 
</body>
</html>
