var num;

function Region(pID, pName) {
	this.ID = pID;
	this.name = pName;
	this.children = new Array();
	this.childrenCount = 0;
	this.getID = getID;
	this.getName = getName;
	this.addChild = addChild;
	this.getChild = getChild;
	this.getChildrenCount = getChildrenCount;
}

function getID() {
	return this.ID;
}

function getName() {
	return this.name;
}

function addChild(child) {
	this.children[this.childrenCount] = child;
	this.childrenCount++;
}

function getChildrenCount() {
	return this.childrenCount;
}

function getChild(idx) {
	return this.children[idx];        
}

function goSpecialMessage(chn){
	this.document.forms[0].channel.value=chn;
	this.document.forms[0].action="../action/message";
	this.document.forms[0].submit();
}

function specialMessageNavigator(region){
	var cnt = 0;
	if (region!=null) cnt = region.getChildrenCount();
	var table="<table border=\"0\" width=\"170\" cellspacing=\"0\" cellpadding=\"0\"><tr><td><img src=\"../images/zuo1.gif\" width=\"170\" height=\"40\"></td></tr>";
	for (var i=0; i<cnt; i++) {
		if(region.getChild(i).getID()=="NBPD"||region.getChild(i).getID()=="NIL"||region.getChild(i).getID()=="FYPD") continue;
		if(i!=cnt-1) table+="<tr><td background=\"../images/zuo4.gif\" height=\"40\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"javascript:specialMessageTable(";
		else table+="<tr><td background=\"../images/tong.gif\" height=\"40\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"javascript:specialMessageTable(";
		table+=region.getChild(i).getID();
		table+=",_"+region.getChild(i).getID();
		table+=")\"><font color=\"#FFFFFF\" id=\"_";
		table+=region.getChild(i).getID();
		table+="\">";
		table+=region.getChild(i).getName();
		table+="</font></a></font></td></tr>";
	}	
	table+="<tr><td></td></tr><tr><td></td></tr></table>";
	nav.innerHTML=table;
}

function specialMessageTable(region,key) {
	var cnt = 0;
	var rootcnt = 0;
	if (region!=null) cnt = region.getChildrenCount();
	position1.innerHTML=region.getID();
	position2.innerHTML=region.getID();
	if (root!=null) rootcnt = root.getChildrenCount();
	for (var i=0; i<rootcnt; i++) {
		if(root.getChild(i).getID()=="NBPD"||root.getChild(i).getID()=="NIL"||root.getChild(i).getID()=="FYPD") continue;
		var _tmp=eval("_"+root.getChild(i).getID());
		if(_tmp) _tmp.style.color="#FFFFFF";
	}
	key.style.color="#FFCC00";
	var table="<table width=\"95%\" border=\"0\" cellpadding=\"5\"><tr><td height=\"18\"></td><td height=\"18\"></td></tr>";
	var bool=true;
	for (var i=0; i<cnt; i++) {
	    if(bool=!bool) table+="<tr><td width=\"4%\" bgcolor=\"#E2E8F3\"><p style=\"line-height: 150%\"><font color=\"#cc9999\" face=\"Wingdings 2\" style=\"font-size: 15pt\">&frac34;</font></td><td bgcolor=\"#E2E8F3\" align=\"left\"><p style=\"line-height: 150%\">";
	    else table+="<tr><td width=\"4%\" bgcolor=\"#C9D3E9\"><p style=\"line-height: 150%\"><font color=\"#cc9999\" face=\"Wingdings 2\" style=\"font-size: 15pt\">&frac34;</font></td><td bgcolor=\"#C9D3E9\" align=\"left\"><p style=\"line-height: 150%\">";
	    table+=region.getChild(i).getName();
	    table+="</td></tr>";
	}
        table+="<tr><td height=\"18\"></td><td height=\"18\" align=\"left\"></td></tr>";
	table+="</table>";
	detail.innerHTML=table;
}            

function setChangeHZ(v,n)
{
	if(n) num=n;
	for(var i=1;i<num+1;i++){
		eval("hz_first_"+i).style.display="none";  
		eval("hz_second_"+i).style.display="none"; 
	}
	eval("hz_first_"+v).style.display="";
	eval("hz_second_"+v).style.display="";
}


function setChangeNB(v)
{
	
}