<?php include 'header.tpl.php';?>
<script>
function winMeJc(){
	dialog_show("adsjc","监测链接","click.php?objid=id_ads_linkurl&dialog_id=winadsjc");
}
</script>
<div class="pMenu">
<li><a href="javascript:frmExecute('');">管理</a></li>
<li><a href="javascript:frmExecute('add');">添加</a></li>
<li class="sel"><a href="javascript:frmExecute('edit');">编辑</a></li>
<li class="info"><a href="javascript:inc_show_help(218);" style="color:#ff0000">帮助</a></li>
</div>
<div class="pSearchDiv" id="objSearch" style="display:none">
<table class="sTab">
<tr><td>位置：	<select name="s_position"><option value="">不限</option><?php echo $this_s_position;?></select>　状态：<select name="s_state"><option value="-101">不限</option><option value="1" <?php if($get_s_state==1) echo " selected";?>>正常</option><option value="0" <?php if($get_s_state==0) echo " selected";?>>关闭</option><option value="-1" <?php if($get_s_state==-1) echo " selected";?>>定时</option><option value="-2" <?php if($get_s_state==-2) echo " selected";?>>过期</option></select>
　关键字：<input type="text" name="s_name" value="<?php echo $get_s_name?>">　<input type="button" name="s_btnok" value="查找" class="pBtn" onclick="frmExecute('')"> 　<input type="button" name="s_btnok" value="清空" class="pBtn" onclick="meSearchClear();frmExecute('');"></td><tr>
</table>
</div>
<div>
<table class='pEditTable'>
<tr class='pTabTitRow'>
	<td class='pTabTitCol' colspan="2"></td></tr>
<tr><td class="pTabColName">类　型：</td><td class="pTabColVal">
	<select name="ads_type" onchange="changeType(this.value)">
	<option value="pic" <?php if($arr_ads["ads_type"]=="pic")echo "selected"?>>图片</option>
	<option value="swf" <?php if($arr_ads["ads_type"]=="swf")echo "selected"?>>Flash</option>
	<option value="txt" <?php if($arr_ads["ads_type"]=="txt")echo "selected"?>>文本</option>
	</select>
	</td></tr>
<tr><td class="pTabColName">位　置：</td><td class="pTabColVal">
	<select name="ads_position"><option value=""></option><?php echo $arr_ads["position"];?></select>
	</td></tr>
<tr><td class="pTabColName">标　题：</td><td class="pTabColVal"><input type="input" name="ads_title" value="<?echo $arr_ads["ads_title"]?>" size=50></td></tr>
<tr><td class="pTabColName">开放时间：</td><td class="pTabColVal"><input type="text" name="ads_startdate" value="<?php echo $arr_ads["startdate"];?>" onfocus="setday(this);"> 到 <input type="text" name="ads_enddate" value="<?php echo $arr_ads["enddate"];?>" onfocus="setday(this);"></td></tr>
<tr><td class="pTabColName">状　态：</td><td class="pTabColVal"><input type="radio" name="ads_state" value="1" checked>正常&nbsp;<input type="radio" name="ads_state" value="0"<?php if($arr_ads["ads_state"]=="0") echo "checked"?>>关闭</td>
</tr>

<tr><td class="pTabColName">内　容：</td><td class="pTabColVal" id="objval"></td></tr>
<tr id="objparam"><td class="pTabColName">参　数：</td><td class="pTabColVal"><input type="text" name="ads_param[]" value="<?echo $arr_ads["ads_param"][0]?>" size=5> 宽　<input type="text" name="ads_param[]" value="<?echo $arr_ads["ads_param"][1]?>" size=5> 高</td></tr>
<tr id="objlinkurl"><td class="pTabColName">链　接：</td><td class="pTabColVal"><input type="input" name="ads_linkurl" value="<?echo $arr_ads["ads_linkurl"]?>" id="id_ads_linkurl" size=50>&nbsp;<a href="javascript:winMeJc();">获取监测</a></td></tr>


<tr><td colspan=2 class="pTabSubmit"><input type="button" name="dosubmit" value="保存" class="pSubmit" onclick="frmExecute('save')"></td></tr>
</table>
<script>
function changeType(msgval)
{
	obj=document.getElementById("objval");
	obj2=document.getElementById("objparam");
	obj3=document.getElementById("objlinkurl");
	if(msgval=="txt")
	{
		obj.innerHTML="<textarea name='ads_val' id='ads_val' style='width:400px;height:120px' onpropertychange='this.style.posHeight=this.scrollHeight+2'><?echo $arr_ads["ads_val"]?></textarea>";
		areabox_autoheight("ads_val");
		obj2.style.visibility="hidden";
	}else{
		obj.innerHTML='<input type="input" name="ads_val" value="<?echo $arr_ads["ads_val"]?>" size=50>&nbsp;<input type="button" name="btnpic" value="选择" style="border:1px #000000 solid" onclick="dialog_winPic(\'ads_val\');"><br><iframe name="frm_upload_pic" src="<?php echo WEB_URL;?>/plus/dialog/upload_attatch.php?obj_id=ads_val" width="230px" height="60px" frameborder=0 scrolling="no"></iframe>';
		obj2.style.visibility="visible";
	}
	if(msgval!="txt")
	{
		obj3.style.visibility="visible";
	}else
	{
		obj3.style.visibility="hidden";
	}
}
changeType("<?php echo $arr_ads["ads_type"]?>");

</script>
</div>
<?php include 'footer.tpl.php';?>		