YAHOO.widget.NodeGroup=function(){
this.nodes=[];
this.selection=null;
};
YAHOO.widget.NodeGroup.prototype.add=function(_1){
if(_1==null){
return;
}
this.nodes.push(_1);
if(_1.checked){
if(this.selection==null){
this.selection=_1;
}else{
_1.uncheck();
}
}
_1.group=this;
};
YAHOO.widget.NodeGroup.prototype.setSelected=function(_2,b){
if(b&&_2!=null&&_2!=this.selection){
var _4=this.selection;
this.selection=_2;
if(_4!=null){
_4.checked=false;
_4.uncheck();
}
_2.check();
}
};
YAHOO.widget.CheckNode=function(_5,_6,_7,_8){
if(_6){
this.init(_5,_6,_7);
this.setUpLabel(_5);
_8?this.setCheckState(2):this.setCheckState(0);
this.checked=_8;
}
};
YAHOO.widget.CheckNode.prototype=new YAHOO.widget.TextNode();
YAHOO.widget.CheckNode.prototype.checked=false;
YAHOO.widget.CheckNode.prototype.checkState=0;
YAHOO.widget.CheckNode.prototype.getCheckElId=function(){
return "ygtvcheck"+this.index;
};
YAHOO.widget.CheckNode.prototype.getCheckEl=function(){
return document.getElementById(this.getCheckElId());
};
YAHOO.widget.CheckNode.prototype.getCheckStyle=function(){
return "ygtvcheck"+this.checkState;
};
YAHOO.widget.CheckNode.prototype.getCheckLink=function(){
return "YAHOO.widget.TreeView.getNode('"+this.tree.id+"',"+this.index+").checkClick()";
};
YAHOO.widget.CheckNode.prototype.checkClick=function(){
if(this.checkState===0){
this.check();
}else{
this.uncheck();
}
};
YAHOO.widget.CheckNode.prototype.updateParent=function(){
this.selectionChanged();
};
YAHOO.widget.CheckNode.prototype.highlightElement=function(_9,_a){
if($(_9.getElId())){
$(_9.getElId()).className=_a;
}else{
this.highlightElement(_9.parent,_a);
}
};
YAHOO.widget.CheckNode.prototype.selectionChanged=function(_b,_c){
};
YAHOO.widget.CheckNode.prototype.updateCheckHtml=function(){
if(this.parent&&this.parent.childrenRendered){
this.getCheckEl().className=this.getCheckStyle();
}
};
YAHOO.widget.CheckNode.prototype.setCheckState=function(_d){
this.checkState=_d;
this.checked=(_d>0);
};
YAHOO.widget.CheckNode.prototype.check=function(){
this.setCheckState(2);
this.updateCheckHtml();
this.updateParent();
this.layer.checked=true;
if(this.parent.checked||this.parent.data==null){
mapProperties.legend=this.layer;
callMapRefresh();
}
};
YAHOO.widget.CheckNode.prototype.uncheck=function(){
this.setCheckState(0);
this.updateCheckHtml();
this.updateParent();
this.layer.checked=false;
if(this.parent.checked||this.parent.data==null){
mapProperties.legend=this.layer;
callMapRefresh();
}
};
YAHOO.widget.CheckNode.prototype.getNodeHtml=function(){
var sb=new Array();
sb[sb.length]="<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
sb[sb.length]="<tr>";
for(i=0;i<this.depth;++i){
sb[sb.length]="<td class=\""+this.getDepthStyle(i)+"\">&nbsp;</td>";
}
sb[sb.length]="<td";
sb[sb.length]=" id=\""+this.getToggleElId()+"\"";
sb[sb.length]=" class=\""+this.getStyle()+"\"";
if(this.hasChildren(true)){
sb[sb.length]=" onmouseover=\"this.className=";
sb[sb.length]="YAHOO.widget.TreeView.getNode('";
sb[sb.length]=this.tree.id+"',"+this.index+").getHoverStyle()\"";
sb[sb.length]=" onmouseout=\"this.className=";
sb[sb.length]="YAHOO.widget.TreeView.getNode('";
sb[sb.length]=this.tree.id+"',"+this.index+").getStyle()\"";
}
sb[sb.length]=" onclick=\"javascript:"+this.getToggleLink()+"\">&nbsp;";
sb[sb.length]="</td>";
sb[sb.length]="<td";
sb[sb.length]=" id=\""+this.getCheckElId()+"\"";
sb[sb.length]=" class=\""+this.getCheckStyle()+"\"";
sb[sb.length]=" onclick=\"javascript:"+this.getCheckLink()+"\">";
sb[sb.length]="&nbsp;</td>";
sb[sb.length]="<td style:\"white-space: nowrap;\">";
sb[sb.length]="<a";
sb[sb.length]=" id=\""+this.labelElId+"\"";
sb[sb.length]=" class=\""+this.labelStyle+"\"";
sb[sb.length]=" href=\""+this.href+"\"";
sb[sb.length]=" target=\""+this.target+"\"";
if(this.hasChildren(true)){
sb[sb.length]=" onmouseover=\"document.getElementById('";
sb[sb.length]=this.getToggleElId()+"').className=";
sb[sb.length]="YAHOO.widget.TreeView.getNode('";
sb[sb.length]=this.tree.id+"',"+this.index+").getHoverStyle()\"";
sb[sb.length]=" onmouseout=\"document.getElementById('";
sb[sb.length]=this.getToggleElId()+"').className=";
sb[sb.length]="YAHOO.widget.TreeView.getNode('";
sb[sb.length]=this.tree.id+"',"+this.index+").getStyle()\"";
}
sb[sb.length]=" >";
sb[sb.length]=this.label;
sb[sb.length]="</a>";
sb[sb.length]="</td>";
sb[sb.length]="</tr>";
sb[sb.length]="</table>";
return sb.join("");
};


