<!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=<?php echo SYS_CHARSET ?>" />
<title>eifr.com</title>
<meta name="keywords" content="eifr.com" />
<meta name="description" content="eifr.com" />
<link rel="stylesheet" type="text/css" href="<?php echo SYS_FRONT_STYLE_PATH?>style/channel_tree.css" />
<script type="text/javascript" src="<?php echo SYS_FRONT_STYLE_PATH?>js/channel_tree.js"></script>
<script type="text/javascript" src="<?php echo SYS_FRONT_STYLE_PATH?>js/parse_url.js"></script>
<script language="javascript">
var img_path = '<?php echo SYS_FRONT_STYLE_PATH?>images/';

if(!window.top.ifr_tree)
{
	C_parseUrl.QueryString_Parse();
	window.top.location.href = "channel.php?id="+C_parseUrl.QueryString('id')+"&tpl=<?php echo $tpl ?>";
}

function doTree(sid)
{
	C_channelTree.showSubTree(sid,img_path);
}

function doFolder(sid,isintro)
{
	C_channelTree.showSubTree(sid,img_path);
	if(isintro)window.top.ifr_content.location.href = "channel_intro_ifr.php?id="+sid+"&tpl=<?php echo $tpl ?>";
}

function doDocument(sid)
{
	window.top.ifr_content.location.href = "article.php?id="+sid+"&act=book&tpl=<?php echo $tpl ?>";
}

function init(sid,is_toggle)
{
	if(is_toggle)
		C_channelTree.initSubTree(sid,img_path);
}
</script>
<base target="_self" />
</head>

<body onload="init('<?php echo $id ?>', <?php if(isset($is_toggle)) echo $is_toggle ?>)">
<ul id="menu" style="padding:10px;">
<?php
foreach($curChannelTree_array as $row){
?>
<li><a href="article.php?id=<?php echo $row['id'] ?>&act=book&tpl=<?php echo $tpl ?>" target="ifr_content"><img src="<?php echo SYS_FRONT_STYLE_PATH?>images/tree/document.gif">&nbsp;<?php echo $row['title'] ?></a></li>
<?php
}
foreach($subChannelTree_array as $row){
$is_intro = 0;
if($row['intro']!='') $is_intro = 1;
$cidlen = (strlen($row['id'])-strlen($id))/2;
$space_width = ($cidlen-1)*19;
$space_width .= "px";
$display_str = 'none';
if($cidlen==1) $display_str = '';
?>
<li id="f_<?php echo $row['id'] ?>" style="padding-left:<?php echo $space_width ?>; display:<?php echo $display_str ?>"><img id="fimg_<?php echo $row['id'] ?>" src="<?php echo SYS_FRONT_STYLE_PATH?>images/tree/folder.gif" onclick="doTree('<?php echo $row['id'] ?>')">&nbsp;<a href="javascript:doFolder('<?php echo $row['id'] ?>',$is_intro)"><?php echo $row['title'] ?></a><br/></li>
<?php 
$i = 0;
$dimg = "cross.gif";
$article_count = count($row['eifr_aritcle']);
foreach($row['eifr_aritcle'] as $row_arti){
$i++;
if($i==$article_count) $dimg = "end.gif";
?>
<li id="d_<?php echo $row['id'] ?>_<?php echo $row_arti['id'] ?>" style="padding-left:<?php echo $space_width ?>; display:none"><a href="javascript:doDocument('<?php echo $row_arti['id'] ?>')"><img id="dimg_<?php echo $row_arti['id'] ?>" src="<?php echo SYS_FRONT_STYLE_PATH?>images/tree/$dimg" >&nbsp;<?php echo $row_arti['title'] ?></a><br/></li>
<?php
}
}?>

</div>
</body>
</html>
