YAHOO.widget.TreeView=function(id){if(id){this.init(id);}};YAHOO.widget.TreeView.nodeCount=0;YAHOO.widget.TreeView.prototype={id:null,_el:null,_nodes:null,locked:false,_expandAnim:null,_collapseAnim:null,_animCount:0,maxAnim:2,setExpandAnim:function(_8){if(YAHOO.widget.TVAnim.isValid(_8)){this._expandAnim=_8;}},setCollapseAnim:function(_9){if(YAHOO.widget.TVAnim.isValid(_9)){this._collapseAnim=_9;}},animateExpand:function(el){if(this._expandAnim&&this._animCount<this.maxAnim){var _b=this;var a=YAHOO.widget.TVAnim.getAnim(this._expandAnim,el,function(){_b.expandComplete();});if(a){++this._animCount;a.animate();}return true;}return false;},animateCollapse:function(el){if(this._collapseAnim&&this._animCount<this.maxAnim){var _e=this;var a=YAHOO.widget.TVAnim.getAnim(this._collapseAnim,el,function(){_e.collapseComplete();});if(a){++this._animCount;a.animate();}return true;}return false;},expandComplete:function(){--this._animCount;},collapseComplete:function(){--this._animCount;},init:function(id){this.id=id;if("string"!==typeof id){this._el=id;this.id=this.generateId(id);}this._nodes=[];YAHOO.widget.TreeView.trees[this.id]=this;this.root=new YAHOO.widget.RootNode(this);},draw:function(){var _11=this.root.getHtml();this.getEl().innerHTML=_11;this.firstDraw=false;},getEl:function(){if(!this._el){this._el=document.getElementById(this.id);}return this._el;},regNode:function(_12){this._nodes[_12.index]=_12;},getRoot:function(){return this.root;},setDynamicLoad:function(_13,_14){this.root.setDynamicLoad(_13,_14);},expandAll:function(){if(!this.locked){this.root.expandAll();}},collapseAll:function(){if(!this.locked){this.root.collapseAll();}},getNodeByIndex:function(_15){var n=this._nodes[_15];return (n)?n:null;},getNodeByProperty:function(_17,_18){for(var i in this._nodes){var n=this._nodes[i];if(n.data&&_18==n.data[_17]){return n;}}return null;},getNodesByProperty:function(_1b,_1c){var _1d=[];for(var i in this._nodes){var n=this._nodes[i];if(n.data&&_1c==n.data[_1b]){_1d.push(n);}}return (_1d.length)?_1d:null;},removeNode:function(_20,_21){if(_20.isRoot()){return false;}var p=_20.parent;if(p.parent){p=p.parent;}this._deleteNode(_20);if(_21&&p&&p.childrenRendered){p.refresh();}return true;},removeChildren:function(_23){while(_23.children.length){this._deleteNode(_23.children[0]);}_23.childrenRendered=false;_23.dynamicLoadComplete=false;_23.expand();_23.collapse();},_deleteNode:function(_24){this.removeChildren(_24);this.popNode(_24);},popNode:function(_25){var p=_25.parent;var a=[];for(var i=0,len=p.children.length;i<len;++i){if(p.children[i]!=_25){a[a.length]=p.children[i];}}p.children=a;p.childrenRendered=false;if(_25.previousSibling){_25.previousSibling.nextSibling=_25.nextSibling;}if(_25.nextSibling){_25.nextSibling.previousSibling=_25.previousSibling;}delete this._nodes[_25.index];},toString:function(){return "TreeView "+this.id;},generateId:function(el){var id=el.id;if(!id){id="yui-tv-auto-id-"+YAHOO.widget.TreeView.counter;YAHOO.widget.TreeView.counter++;}return id;},onExpand:function(_2b){},onCollapse:function(_2c){}};YAHOO.widget.TreeView.trees=[];YAHOO.widget.TreeView.counter=0;YAHOO.widget.TreeView.getTree=function(_2d){var t=YAHOO.widget.TreeView.trees[_2d];return (t)?t:null;};YAHOO.widget.TreeView.getNode=function(_2f,_30){var t=YAHOO.widget.TreeView.getTree(_2f);return (t)?t.getNodeByIndex(_30):null;};YAHOO.widget.TreeView.addHandler=function(el,_33,fn,_35){_35=(_35)?true:false;if(el.addEventListener){el.addEventListener(_33,fn,_35);}else{if(el.attachEvent){el.attachEvent("on"+_33,fn);}else{el["on"+_33]=fn;}}};YAHOO.widget.TreeView.preload=function(_36){_36=_36||"ygtv";var _37=["tn","tm","tmh","tp","tph","ln","lm","lmh","lp","lph","loading"];var sb=[];for(var i=0;i<_37.length;++i){sb[sb.length]="<span class=\""+_36+_37[i]+"\">&#160;</span>";}var f=document.createElement("DIV");var s=f.style;s.position="absolute";s.top="-1000px";s.left="-1000px";f.innerHTML=sb.join("");document.body.appendChild(f);};YAHOO.widget.TreeView.addHandler(window,"load",YAHOO.widget.TreeView.preload);YAHOO.widget.Node=function(_3c,_3d,_3e){if(_3c){this.init(_3c,_3d,_3e);}};YAHOO.widget.Node.prototype={index:0,children:null,tree:null,data:null,parent:null,depth:-1,href:null,target:"_self",expanded:false,multiExpand:true,renderHidden:true,childrenRendered:false,dynamicLoadComplete:false,previousSibling:null,nextSibling:null,_dynLoad:false,dataLoader:null,isLoading:false,hasIcon:true,iconMode:0,_type:"Node",init:function(_3f,_40,_41){this.data=_3f;this.children=[];this.index=YAHOO.widget.TreeView.nodeCount;++YAHOO.widget.TreeView.nodeCount;this.expanded=_41;if(_40){_40.appendChild(this);}},applyParent:function(_42){if(!_42){return false;}this.tree=_42.tree;this.parent=_42;this.depth=_42.depth+1;if(!this.href){this.href="javascript:"+this.getToggleLink();}if(!this.multiExpand){this.multiExpand=_42.multiExpand;}this.tree.regNode(this);_42.childrenRendered=false;for(var i=0,len=this.children.length;i<len;++i){this.children[i].applyParent(this);}return true;},appendChild:function(_44){if(this.hasChildren()){var sib=this.children[this.children.length-1];sib.nextSibling=_44;_44.previousSibling=sib;}this.children[this.children.length]=_44;_44.applyParent(this);return _44;},appendTo:function(_46){return _46.appendChild(this);},insertBefore:function(_47){var p=_47.parent;if(p){if(this.tree){this.tree.popNode(this);}var _49=_47.isChildOf(p);p.children.splice(_49,0,this);if(_47.previousSibling){_47.previousSibling.nextSibling=this;}this.previousSibling=_47.previousSibling;this.nextSibling=_47;_47.previousSibling=this;this.applyParent(p);}return this;},insertAfter:function(_4a){var p=_4a.parent;if(p){if(this.tree){this.tree.popNode(this);}var _4c=_4a.isChildOf(p);if(!_4a.nextSibling){return this.appendTo(p);}p.children.splice(_4c+1,0,this);_4a.nextSibling.previousSibling=this;this.previousSibling=_4a;this.nextSibling=_4a.nextSibling;_4a.nextSibling=this;this.applyParent(p);}return this;},isChildOf:function(_4d){if(_4d&&_4d.children){for(var i=0,len=_4d.children.length;i<len;++i){if(_4d.children[i]===this){return i;}}}return -1;},getSiblings:function(){return this.parent.children;},showChildren:function(){if(!this.tree.animateExpand(this.getChildrenEl())){if(this.hasChildren()){this.getChildrenEl().style.display="";}}},hideChildren:function(){if(!this.tree.animateCollapse(this.getChildrenEl())){this.getChildrenEl().style.display="none";}},getElId:function(){return "ygtv"+this.index;},getChildrenElId:function(){return "ygtvc"+this.index;},getToggleElId:function(){return "ygtvt"+this.index;},getEl:function(){return document.getElementById(this.getElId());},getChildrenEl:function(){return document.getElementById(this.getChildrenElId());},getToggleEl:function(){return document.getElementById(this.getToggleElId());},getToggleLink:function(){return "YAHOO.widget.TreeView.getNode('"+this.tree.id+"',"+this.index+").toggle()";},collapse:function(){if(!this.expanded){return;}var ret=this.tree.onCollapse(this);if("undefined"!=typeof ret&&!ret){return;}if(!this.getEl()){this.expanded=false;return;}this.hideChildren();this.expanded=false;if(this.hasIcon){this.getToggleEl().className=this.getStyle();}},expand:function(){if(this.expanded){return;}var ret=this.tree.onExpand(this);if("undefined"!=typeof ret&&!ret){return;}if(!this.getEl()){this.expanded=true;return;}if(!this.childrenRendered){this.getChildrenEl().innerHTML=this.renderChildren();}else{}this.expanded=true;if(this.hasIcon){this.getToggleEl().className=this.getStyle();}if(this.isLoading){this.expanded=false;return;}if(!this.multiExpand){var _51=this.getSiblings();for(var i=0;i<_51.length;++i){if(_51[i]!=this&&_51[i].expanded){_51[i].collapse();}}}this.showChildren();},getStyle:function(){if(this.isLoading){return "ygtvloading";}else{var loc=(this.nextSibling)?"t":"l";var _54="n";if(this.hasChildren(true)||(this.isDynamic()&&!this.getIconMode())){_54=(this.expanded)?"m":"p";}return "ygtv"+loc+_54;}},getHoverStyle:function(){var s=this.getStyle();if(this.hasChildren(true)&&!this.isLoading){s+="h";}return s;},expandAll:function(){for(var i=0;i<this.children.length;++i){var c=this.children[i];if(c.isDynamic()){alert("Not supported (lazy load + expand all)");break;}else{if(!c.multiExpand){alert("Not supported (no multi-expand + expand all)");break;}else{c.expand();c.expandAll();}}}},collapseAll:function(){for(var i=0;i<this.children.length;++i){this.children[i].collapse();this.children[i].collapseAll();}},setDynamicLoad:function(_59,_5a){if(_59){this.dataLoader=_59;this._dynLoad=true;}else{this.dataLoader=null;this._dynLoad=false;}if(_5a){this.iconMode=_5a;}},isRoot:function(){return (this==this.tree.root);},isDynamic:function(){var _5b=(!this.isRoot()&&(this._dynLoad||this.tree.root._dynLoad));return _5b;},getIconMode:function(){return (this.iconMode||this.tree.root.iconMode);},hasChildren:function(_5c){return (this.children.length>0||(_5c&&this.isDynamic()&&!this.dynamicLoadComplete));},toggle:function(){if(!this.tree.locked&&(this.hasChildren(true)||this.isDynamic())){if(this.expanded){this.collapse();}else{this.expand();}}},getHtml:function(){var sb=[];sb[sb.length]="<div class=\"ygtvitem\" id=\""+this.getElId()+"\">";sb[sb.length]=this.getNodeHtml();sb[sb.length]=this.getChildrenHtml();sb[sb.length]="</div>";return sb.join("");},getChildrenHtml:function(){var sb=[];sb[sb.length]="<div class=\"ygtvchildren\"";sb[sb.length]=" id=\""+this.getChildrenElId()+"\"";if(!this.expanded){sb[sb.length]=" style=\"display:none;\"";}sb[sb.length]=">";if((this.hasChildren(true)&&this.expanded)||(this.renderHidden&&!this.isDynamic())){sb[sb.length]=this.renderChildren();}sb[sb.length]="</div>";return sb.join("");},renderChildren:function(){var _5f=this;if(this.isDynamic()&&!this.dynamicLoadComplete){this.isLoading=true;this.tree.locked=true;if(this.dataLoader){setTimeout(function(){_5f.dataLoader(_5f,function(){_5f.loadComplete();});},10);}else{if(this.tree.root.dataLoader){setTimeout(function(){_5f.tree.root.dataLoader(_5f,function(){_5f.loadComplete();});},10);}else{return "Error: data loader not found or not specified.";}}return "";}else{return this.completeRender();}},completeRender:function(){var sb=[];for(var i=0;i<this.children.length;++i){this.children[i].childrenRendered=false;sb[sb.length]=this.children[i].getHtml();}this.childrenRendered=true;return sb.join("");},loadComplete:function(){this.getChildrenEl().innerHTML=this.completeRender();this.dynamicLoadComplete=true;this.isLoading=false;this.expand();this.tree.locked=false;},getAncestor:function(_62){if(_62>=this.depth||_62<0){return null;}var p=this.parent;while(p.depth>_62){p=p.parent;}return p;},getDepthStyle:function(_64){return (this.getAncestor(_64).nextSibling)?"ygtvdepthcell":"ygtvblankdepthcell";},getNodeHtml:function(){return "";},refresh:function(){this.getChildrenEl().innerHTML=this.completeRender();if(this.hasIcon){var el=this.getToggleEl();if(el){el.className=this.getStyle();}}},toString:function(){return "Node ("+this.index+")";}};YAHOO.widget.RootNode=function(_66){this.init(null,null,true);this.tree=_66;};YAHOO.widget.RootNode.prototype=new YAHOO.widget.Node();YAHOO.widget.RootNode.prototype.getNodeHtml=function(){return "";};YAHOO.widget.RootNode.prototype.toString=function(){return "RootNode";};YAHOO.widget.RootNode.prototype.loadComplete=function(){this.tree.draw();};YAHOO.widget.TextNode=function(_67,_68,_69){if(_67){this.init(_67,_68,_69);this.setUpLabel(_67);}};YAHOO.widget.TextNode.prototype=new YAHOO.widget.Node();YAHOO.widget.TextNode.prototype.labelStyle="ygtvlabel";YAHOO.widget.TextNode.prototype.labelElId=null;YAHOO.widget.TextNode.prototype.label=null;YAHOO.widget.TextNode.prototype.setUpLabel=function(_6a){if(typeof _6a=="string"){_6a={label:_6a};}this.label=_6a.label;if(_6a.href){this.href=_6a.href;}if(_6a.target){this.target=_6a.target;}if(_6a.style){this.labelStyle=_6a.style;}this.labelElId="ygtvlabelel"+this.index;};YAHOO.widget.TextNode.prototype.getLabelEl=function(){return document.getElementById(this.labelElId);};YAHOO.widget.TextNode.prototype.getNodeHtml=function(){var sb=[];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)+"\">&#160;</td>";}var _6c="YAHOO.widget.TreeView.getNode('"+this.tree.id+"',"+this.index+")";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]=_6c+".getHoverStyle()\"";sb[sb.length]=" onmouseout=\"this.className=";sb[sb.length]=_6c+".getStyle()\"";}sb[sb.length]=" onclick=\"javascript:"+this.getToggleLink()+"\">";sb[sb.length]="&#160;";sb[sb.length]="</td>";sb[sb.length]="<td>";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+"\"";sb[sb.length]=" onclick=\"return "+_6c+".onLabelClick("+_6c+")\"";if(this.hasChildren(true)){sb[sb.length]=" onmouseover=\"document.getElementById('";sb[sb.length]=this.getToggleElId()+"').className=";sb[sb.length]=_6c+".getHoverStyle()\"";sb[sb.length]=" onmouseout=\"document.getElementById('";sb[sb.length]=this.getToggleElId()+"').className=";sb[sb.length]=_6c+".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("");};YAHOO.widget.TextNode.prototype.onLabelClick=function(me){};YAHOO.widget.TextNode.prototype.toString=function(){return "TextNode ("+this.index+") "+this.label;};YAHOO.widget.MenuNode=function(_6e,_6f,_70){if(_6e){this.init(_6e,_6f,_70);this.setUpLabel(_6e);}this.multiExpand=false;};YAHOO.widget.MenuNode.prototype=new YAHOO.widget.TextNode();YAHOO.widget.MenuNode.prototype.toString=function(){return "MenuNode ("+this.index+") "+this.label;};YAHOO.widget.HTMLNode=function(_71,_72,_73,_74){if(_71){this.init(_71,_72,_73);this.initContent(_71,_74);}};YAHOO.widget.HTMLNode.prototype=new YAHOO.widget.Node();YAHOO.widget.HTMLNode.prototype.contentStyle="ygtvhtml";YAHOO.widget.HTMLNode.prototype.contentElId=null;YAHOO.widget.HTMLNode.prototype.content=null;YAHOO.widget.HTMLNode.prototype.initContent=function(_75,_76){if(typeof _75=="string"){_75={html:_75};}this.html=_75.html;this.contentElId="ygtvcontentel"+this.index;this.hasIcon=_76;};YAHOO.widget.HTMLNode.prototype.getContentEl=function(){return document.getElementById(this.contentElId);};YAHOO.widget.HTMLNode.prototype.getNodeHtml=function(){var sb=[];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)+"\">&#160;</td>";}if(this.hasIcon){sb[sb.length]="<td";sb[sb.length]=" id=\""+this.getToggleElId()+"\"";sb[sb.length]=" class=\""+this.getStyle()+"\"";sb[sb.length]=" onclick=\"javascript:"+this.getToggleLink()+"\"";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]=">&#160;</td>";}sb[sb.length]="<td";sb[sb.length]=" id=\""+this.contentElId+"\"";sb[sb.length]=" class=\""+this.contentStyle+"\"";sb[sb.length]=" >";sb[sb.length]=this.html;sb[sb.length]="</td>";sb[sb.length]="</tr>";sb[sb.length]="</table>";return sb.join("");};YAHOO.widget.HTMLNode.prototype.toString=function(){return "HTMLNode ("+this.index+")";};YAHOO.widget.TVAnim=function(){return {FADE_IN:"TVFadeIn",FADE_OUT:"TVFadeOut",getAnim:function(_78,el,_7a){if(YAHOO.widget[_78]){return new YAHOO.widget[_78](el,_7a);}else{return null;}},isValid:function(_7b){return (YAHOO.widget[_7b]);}};}();YAHOO.widget.TVFadeIn=function(el,_7d){this.el=el;this.callback=_7d;};YAHOO.widget.TVFadeIn.prototype={animate:function(){var _7e=this;var s=this.el.style;s.opacity=0.1;s.filter="alpha(opacity=10)";s.display="";var dur=0.4;var a=new YAHOO.util.Anim(this.el,{opacity:{from:0.1,to:1,unit:""}},dur);a.onComplete.subscribe(function(){_7e.onComplete();});a.animate();},onComplete:function(){this.callback();},toString:function(){return "TVFadeIn";}};YAHOO.widget.TVFadeOut=function(el,_83){this.el=el;this.callback=_83;};YAHOO.widget.TVFadeOut.prototype={animate:function(){var _84=this;var dur=0.4;var a=new YAHOO.util.Anim(this.el,{opacity:{from:1,to:0.1,unit:""}},dur);a.onComplete.subscribe(function(){_84.onComplete();});a.animate();},onComplete:function(){var s=this.el.style;s.display="none";s.filter="alpha(opacity=100)";this.callback();},toString:function(){return "TVFadeOut";}};