<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<link href="css/admin.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" language="javascript" src="js/jquery.js"></script>
<script type="text/javascript" language="javascript">
<!--
RowCount = 0;
$(function(){
	$.each( $('.table_content'),function(){
		$(this).bind('mouseover',function(){$(this).css('background-color','#d9e8fd');});
		$(this).bind('mouseout',function(){$(this).css('background-color','#e6f2fe');});
	});
	get_category(<!--Kw[$Category]-->);
	<!--Kw[if $stype !='editok']-->
	AddRow();
	<!--Kw[/if]-->
	$('#submit').bind('click',function(){
		$.each( $('.sites_content'),function(){
			this.childNodes.item(3).childNodes.item(1).value=this.childNodes.item(3).childNodes.item(0).contentWindow.document.getElementById('name').innerHTML;
		});
	/*	var name = document.getElementById('eifr').contentWindow.document.getElementById('name').innerHTML;
		document.getElementById('EntryImg').value=name;*/
		document.getElementById('form1').submit();
	});
});
function get_category( id )
{
	$.get("get_category2.php","id="+id,function(data){$('#category').html(data)});
}

function simOptionClick4IE(){    
    var evt=window.event  ;    
    var selectObj=evt?evt.srcElement:null;    
    if (evt && selectObj &&  evt.offsetY && evt.button!=2    
        && (evt.offsetY > selectObj.offsetHeight || evt.offsetY<0 ) ) {    
            var oldIdx = selectObj.selectedIndex;    
   
            setTimeout(function(){    
                var option=selectObj.options[selectObj.selectedIndex];    
                get_category( selectObj.options.value )    
            }, 60);    
    }    
}    


function AddRow()
{
	$('#SelectCategory').before('<tr style="height:80px;" class="table_content sites_content"><td><input name="Name[]" type="text" size="25" /></td><td><input name="Link[]" type="text" value="http://" size="25" /></td><td><textarea name="Describe[]" style="width:150px; height:80px;"><!--Kw[$sites[c].Describe]--></textarea></td><td><iframe name="eifr" allowtransparency="true" frameborder="0" height="80" width="100%" id="eifr" marginheight="0" marginwidth="0" scrolling="no" src="upload.php?name=<!--Kw[$sites[c].EntryImg]-->"></iframe><input name="EntryImg[]" type="hidden" value="<!--Kw[$sites[c].EntryImg]-->"/></td><td><input type="radio" name="Recommend['+RowCount+']" value="0" />是 <input type="radio" name="Recommend['+RowCount+']" value="1" checked="checked" />否</td><td><input name="Order[]" type="text" size="6" maxlength="6" value="<!--Kw[$sites[c].Order]-->" /></td></tr>');
	$.each( $('.table_content'),function(){
		$(this).bind('mouseover',function(){$(this).css('background-color','#d9e8fd');});
		$(this).bind('mouseout',function(){$(this).css('background-color','#e6f2fe');});
	});
	RowCount++;
}

-->
</script>
</head>

<body>
<table width="100%" border="0" cellspacing="0">
  <tr height="184">
    <td align="left" valign="top" class="table_bg"><div class="boxtitle"><!--Kw[$title]--></div>
      <form action="bat_sites.php?type=<!--Kw[$stype]-->&id=<!--Kw[$id]-->" method="post" name="form1" id="form1">
        <table width="100%" border="0">
          <tr class="table_title">
            <td width="15%">网站名称</td>
            <td width="15%">链接地址</td>
            <td width="15%">描述</td>
            <td width="20%">LOGO</td>
            <td width="10%">在首页？</td>
            <td width="10%">排序</td>
          </tr>
          <!--Kw[new name='i' value=0]-->
          <!--Kw[section name='c' loop=$sites]-->
          <tr style="height:80px;" class="table_content sites_content">
            <td><input name="Name[]" type="text" size="25" value="<!--Kw[$sites[c].Name]-->" /></td>
            <td><input name="Link[]" type="text"  size="25" value="<!--Kw[$sites[c].Link]-->" /></td>
            <td><textarea name="Describe[]" style="width:150px; height:80px;"><!--Kw[$sites[c].Describe]--></textarea></td>
            <td><iframe name="eifr" allowtransparency="true" frameborder="0" height="80" width="100%" id="eifr" marginheight="0" marginwidth="0" scrolling="no" src="upload.php?name=<!--Kw[$sites[c].EntryImg]-->"></iframe><input name="EntryImg[]" type="hidden" value="<!--Kw[$sites[c].EntryImg]-->"/></td>
            <td><input type="radio" name="IsInIndex[<!--Kw[$i]-->]" value="1" <!--Kw[if $sites[c].IsInIndex==1]--> checked="checked"<!--Kw[/if]--> />
              是
              <input type="radio" name="IsInIndex[<!--Kw[$i]-->]" value="0" <!--Kw[if $sites[c].IsInIndex==0]--> checked="checked"<!--Kw[/if]--> />
              否</td>
            <td>
            	<input name="Order[]" type="text" size="6" maxlength="6" value="<!--Kw[$sites[c].Order]-->" />
                <input name="ID[]" type="hidden" value="<!--Kw[$sites[c].ID]-->" />
            </td>
          </tr>
          <!--Kw[new name='i' value=$i+1]-->
          <!--Kw[/section]-->
          <tr id="SelectCategory" class="table_content">
            <td colspan="4">
            <!--Kw[if $stype !='editok']-->
            	选择分类：<span id="category"></span>
            <!--Kw[/if]-->
            </td>
            <td colspan="2">
            	<span style="float:right" id="submit" class="button">提交</span>
				<!--Kw[if $stype !='editok']--><span style="float:right" class="button" onclick="AddRow()">添加</span><!--Kw[/if]-->
            </td>
          </tr>
        </table>
    </form></td>
  </tr>
</table>
</body>
</html>
