<?php
$tags1=$tags2=$tags3=$tags4='';
foreach ($tags as $row) {
      if($row->CS_CID==1){
           $tags1.='"'.$row->CS_Name.'",';
      }elseif($row->CS_CID==2){
           $tags2.='"'.$row->CS_Name.'",';
      }elseif($row->CS_CID==3){
           $tags3.='"'.$row->CS_Name.'",';
      }elseif($row->CS_CID==4){
           $tags4.='"'.$row->CS_Name.'",';
      }
}
$tags1=$tags1."]";$tags2=$tags2."]";$tags3=$tags3."]";$tags4=$tags4."]";
$tags1=str_replace(",]","",$tags1);$tags2=str_replace(",]","",$tags2);$tags3=str_replace(",]","",$tags3);$tags4=str_replace(",]","",$tags4);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "/www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="/www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk" />
<title>选择标签</title>
<link href="<?=base_url()?>csdj/admin/images/tags.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?=base_url()?>csdj/admin/js/jquery.js"></script>
<script type="text/javascript" src="<?=base_url()?>csdj/admin/js/tags.js"></script>
</head>
<body>
<script type="text/javascript">
	var tagarray=Array(
		Array("按年代",<?php echo $tags1?>),Array("按曲风",<?php echo $tags2?>),Array("按心情",<?php echo $tags3?>),Array("按地域",<?php echo $tags4?>)	);
	var html='<div class="popDiyTags-form form-box"><div class="popDiyTags-title"><div class="fl"><h4 class="selected-index">你已经选择了 <span class="red">0</span> 个标签<em>（最多选择5个）</em></h4><ul class="selected-list selected-list01"></ul></div><a class="btn btnTure" href="javascript:void(0);"><span class="btn-wrap"><span class="btn-inner"><span class="btn-txt">添加并返回</span></span></span></a></div>';
	for(var i=0;i<tagarray.length;i++){
		html+='<dl class="popDiyTags-list clearfix">';
		html+='<dt>'+tagarray[i][0]+'</dt>';
		for(var j=1;j<tagarray[i].length;j++){
			html+='<dd><a href="#">'+tagarray[i][j]+'</a></dd>';
		}
		html+="</dl>";
	}
	html+='<div class="popDiyTags-title"><div class="fl"><h4 class="selected-index">你已经选择了 <span class="red">0</span> 个标签<em>（最多选择5个）</em></h4><ul class="selected-list selected-list02"></ul></div><a class="btn btnTure" href="javascript:void(0);"><span class="btn-wrap"><span class="btn-inner"><span class="btn-txt">添加并返回</span></span></span></a></div></div></div>';

	document.writeln(html);

	function ReturnValue(reimg){
		parent.document.getElementById('<?=$f?>').value=reimg;
		parent.Dialog.close();
	}
</script>
</body>
</html>
