/**
 * 多面板控制<br>
 * 需要结合相应的html内容使用
 */
 var ztId;
var TabPanel = {
	$ : function(id) {
		if (id)
			return document.getElementById(id);
		return null;
	},
	/**
	 * 初始化
	 */
	init : function() {

	},
	activeItem : function(obj, css1, css2) {
		var t1 = obj;
		var css = t1.className || "";
		// 当前已经是选中的面板了
		if (css.indexOf(css1) > -1)
			return true;
		else {
			// 清除其它选中，并设置当前为选中
			var tr = t1.parentElement.parentElement;
			var len = tr.cells.length;
			for (var i = 0;i < len; i++) {
				var t2 = tr.cells[i].childNodes[0];
				if (t2.tagName == "TABLE" && t2.className
						&& t2.className.indexOf(css1) > -1) {
					t2.className = (t2.className.replace(css1, '') + " " + css2);
					this.visibleDiv(t2.divId, false);
				}
			}
			t1.className = css.replace(css2, '') + " " + css1;
			// 显示DIV
			this.visibleDiv(t1.divId, true);
		}
		if(t1.id!=undefined){
		  // alert(t1.id);
		  document.all.channelMore.href=rootPath+"/channelMore_ChannelPageUI.action?categoryId="+t1.id;
		 // alert("document.all.more.src="+document.all.channelMore.href);
		}
		return true;
	},
	/**
	 * 控制是否显示DIV
	 */
	visibleDiv : function(id, flag) {
		var obj = this.$(id);
		if (obj == null)
			return;
		var css = obj.className || "";
		obj.className = css.replace(!flag ? "tp_div_v" : "tp_div_h", '')
				.replace(/\s$/g, '')
				+ " " + (flag ? "tp_div_v" : "tp_div_h");
	}

};

