Array.prototype.add=function(C){var B=true;for(var A=0;A<this.length;A++){if(this[A]==C){B=false;break}}if(B==true){this[this.length]=C}};Namespace.register("Ali.widget.node");Namespace.register("Ali.widget.tree");Namespace.register("Ali.widget.trees");Namespace.register("Ali.widget.navigation");function isComprise(A,B){if(A.indexOf(B)!=-1){return true}else{return false}}function getObjsByTNandCN(F,E,A){var D=new Array();var C=F.getElementsByTagName(E);for(var B=0;B<C.length;B++){if(C[B].className==A){D.add(C[B])}}return D}function getObjsByTNandCN2(F,E,A){var D=new Array();var C=F.getElementsByTagName(E);for(var B=0;B<C.length;B++){if(C[B].className.indexOf(A)!=-1){D.add(C[B])}}return D}function isFullObj(A){if(A.innerHTML!=null&&A.innerHTML!=""){return true}else{return false}}(function(){var B=new Array();var A=new Array();Ali.widget.navigation={init:function(E,C,D){B=getObjsByTNandCN2(D,"div","menu");A=getObjsByTNandCN2(D,"div","menutitleischeck")},closeAll:function(){for(var C=0;C<B.length;C++){if(getObjsByTNandCN2(B[C],"div","firstroot")[0]!=null){getObjsByTNandCN2(B[C],"div","firstroot")[0].style.display="none"}}for(var C=0;C<A.length;C++){A[C].className="menutitle_uncheck  menutitleischeck"}},open:function(E,C,D){this.init(E,C,D);this.closeAll();E.className="menutitle_check  menutitleischeck";if(getObjsByTNandCN2(C,"div","firstroot")[0]!=null){getObjsByTNandCN2(C,"div","firstroot")[0].style.display="block"}},comprise:function(C,D){if(C.indexOf(D)!=-1){return true}else{return false}}}})();(function(){Ali.widget.trees={load:function(E){var D=document.getElementById(E);var C=getObjsByTNandCN2(D,"div","firstroot");for(var B=0;B<C.length;B++){var A=new Ali.widget.tree(C[B]);A.init()}},closeOrOpen:function(A,B){if(A.style.display=="none"||A.style.display==""){A.style.display="block";B.getElementsByTagName("img")[0].src="http://img.zz91.com/esite/images/jian.gif"}else{A.style.display="none";B.getElementsByTagName("img")[0].src="http://img.zz91.com/esite/images/jia.gif"}},closeOrOpen2:function(A){},event:function(A){var B=YAHOO.util.Event.getTarget(A);while(B.id!="erectNav"){if(B.nodeName.toUpperCase()=="DIV"){if(isComprise(B.className,"closeoropen1")){Ali.widget.trees.closeOrOpen(getObjsByTNandCN(B.parentNode,"div","frlist")[0],B)}else{if(isComprise(B.className,"closeoropen2")){Ali.widget.trees.closeOrOpen(getObjsByTNandCN(B.parentNode,"div","list")[0],B)}}break}else{B=B.parentNode}}}}})();Ali.widget.node=function(A){this.obj=A;this.title=null;this.content=null;this.isopen=false;this.list=new Array()};Ali.widget.node.prototype={init:function(A){this.content=getObjsByTNandCN(this.obj,"div","list")[0];if(A=="open"){this.content.style.display="block"}else{this.content.style.display="none"}if(getObjsByTNandCN2(this.obj,"div","title").length>0){this.initTitle(getObjsByTNandCN2(this.obj,"div","title")[0])}},initTitle:function(A){if(isFullObj(A)){this.title=A;YAHOO.util.Event.on(this.title,"click",Ali.widget.trees.event)}}};Ali.widget.tree=function(A){this.obj=A;this.title=null;this.content=null;this.list=new Array();this.isopen=false};Ali.widget.tree.prototype={init:function(){if(getObjsByTNandCN2(this.obj,"div","frtitle").length>0){this.initTitle(getObjsByTNandCN2(this.obj,"div","frtitle")[0])}if(getObjsByTNandCN(this.obj,"div","frlist").length>0){this.initList(getObjsByTNandCN(this.obj,"div","frlist")[0])}},initTitle:function(A){if(isFullObj(A)){this.title=A;if(this.isopen){YAHOO.util.Event.on(this.title,"click",this.close)}else{YAHOO.util.Event.on(this.title,"click",this.open)}}},initList:function(C){if(isFullObj(C)){this.content=C;var B=getObjsByTNandCN(C,"div","root");for(var A=0;A<B.length;A++){var D=new Ali.widget.node(B[A]);if(A==0){D.init("open")}else{D.init("close")}}}}}
