<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset={sys_charset}">
<title>template select</title>
<link href="{adminStylePath}style/common.css" rel="stylesheet" type="text/css">
<script language="javascript" src="{adminStylePath}js/common.js"></script>
<script>
var input_prefix = "";

function openerSelect(tmpValue,tmpTxt)
{	
	if(confirm("你确认选择\""+tmpTxt+"\"吗？"))
	{    			
		if(window.opener.document.getElementById('template_id') && window.opener.document.getElementById('template_id_show'))
		{
			document.getElementById('td_status').innerHTML = "成功选择["+tmpTxt+"]! <br />如果没有自动关闭当前窗口,请手动关闭.";
			window.opener.document.getElementById(input_prefix+'template_id').value=tmpValue;
			window.opener.document.getElementById(input_prefix+'template_id_show').value = tmpTxt;
			window.close();
		}
	}	
}	

function clearSelect()
{
	window.opener.document.getElementById(input_prefix+'template_id').value='';
	window.opener.document.getElementById(input_prefix+'template_id_show').value ='';
	window.close();
}

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

function init()
{
	
	QueryString_Parse();
	prefix_name = QueryString("prefix_name");
	if(prefix_name)
	{
		input_prefix = prefix_name;
	}

}

</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="8%" class="list_title_td">编号</td>
<td width="24%" class="list_title_td">标题</td>
<td width="25%" class="list_title_td">模板文件</td>
<td width="25%" class="list_title_td">程序文件</td>
<td width="18%" class="list_title_td">操作</td>
</tr>
<!-- BEGIN ListTemplate -->
<tr  class="{ListTemplate.tr_css}" {ListTemplate.tr_onmouse}>
<td width="8%">{ListTemplate.num}</td>
<td width="24%">{ListTemplate.title}</td>
<td width="25%">{ListTemplate.template_filename}</td>
<td width="25%">{ListTemplate.program_filename}</td>
<td width="18%">
	<input type='button' name='btn_select' value='选择' onclick="openerSelect('{ListTemplate.id}','{ListTemplate.title}')" >
	<input type='button' name='btn_preview' value='预览' onclick="winOpen('template_view.php?selectid={ListTemplate.id}')">
</td>
</tr>
<!-- END ListTemplate -->
</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" ><a href="javascript:clearSelect()">[---清空---]</a></span>&nbsp;&nbsp;
	<a href="javascript:closeWin()">[---关闭---]</a>&nbsp;&nbsp;
</td>
</tr>
</table> 
</body>
</html>
