// Title: Tigra Tree Menu PRO
// URL: http://www.softcomplex.com/products/tigra_menu_tree_pro/
// Version: 1.0
// Date: 03-19-2003 (mm-dd-yyyy)
// Technical Support: support@softcomplex.com (specify product title and order ID)
// Notes: Registration needed to use this script legally.
// Visit official site for details.

function tree(A,B){this.a_tpl=B;this.a_config=A;this.o_root=this;this.a_index=[];this.a_nodes=[];this.o_selected=null;this.n_depth=-1;var C=new Image(),D=new Image();C.src=B['icon_e'];D.src=B['icon_l'];B['im_e']=C;B['im_l']=D;for(var i=0;i<128;i++)if(B['icon_'+i]){var F=new Image();B['im_'+i]=F;F.src=B['icon_'+i]}this.toggle=function(n_id){var G=this.a_index[n_id];G.open(G.n_state&8)};this.select=function(n_id){return this.a_index[n_id].select()};this.mover=function(n_id){var G=this.a_index[n_id];G.H();G.mover(true)};this.mout=function(n_id){var G=this.a_index[n_id];G.H(true);G.mout(true)};this.find_item=function(I){for(var i=0;i<this.a_index.length;i++)if(this.a_index[i].a_config[0]==I){return(this.a_index[i]);break}};this.J=false;this.K=function(){if(!B_DOM&&this.J)window.location=window.location};this.reset_state=function(){document.cookie='tree_'+this.o_root.n_id+'_state=';this.a_states=[]};this.a_children=[];for(var i=0;i<A.length;i++)this.a_children[this.a_children.length]=new L(this,i);B_DOM=Boolean(document.body&&document.body.innerHTML);this.n_id=TREES.length;TREES[this.n_id]=this;this.a_states=[];var M=RegExp('^\\s*(\\S+)\\s*=\\s*(\\S*)\\s*$'),N=document.cookie.split(';'),O,P,O='tree_'+this.o_root.n_id+'_state';for(var i=0;i<N.length;i++){if(!M.exec(N[i])||RegExp.$1!=O)continue;P=RegExp.$2;this.a_states=P.split('_');break}if(B['pre_init']){eval('var Q='+B['pre_init']+'(this);');if(!Q)return}for(var i=0;i<this.a_children.length;i++){this.a_children[i].R=S;document.write(this.a_children[i].R())}if(B['beforeInit'])eval(B['afterInit']+'(this);')}function L(o_parent,n_order){this.o_root=o_parent.o_root;this.n_depth=o_parent.n_depth+1;this.a_config=o_parent.a_config[n_order+(this.n_depth?3:0)];while(!this.a_config[this.a_config.length-1])this.a_config.length=this.a_config.length-1;this.n_id=this.o_root.a_index.length;this.o_root.a_index[this.n_id]=this;if(this.a_config.length<4)return;this.n_node_id=this.o_root.a_nodes.length;this.o_root.a_nodes[this.n_node_id]=this;for(var i=3;i<this.a_config.length;i++)new L(this,i-3)}function T(U,V){if(Boolean(this.n_state&8)!=Boolean(U))return;var W=(this.a_config[2]?this.a_config[2][U?'hc':'ho']:null);W=(W?W:this.o_root.a_tpl[U?'onItemClose':'onItemOpen']);if(W){eval('var Q='+W+'(this);');if(!Q)return}this.n_state^=8;this.J=true;this.state_lookup();this.H();this.save();if(B_DOM){var X=Y('c'+this.o_root.n_id+'_'+this.n_id);if(!X.innerHTML)X.innerHTML=this.Z();X.style.display=(U?'none':'block')}else if(!V)window.location=window.location}function a(b){var W=(this.a_config[2]?this.a_config[2][b?'hd':'hs']:null);W=(W?W:this.o_root.a_tpl[b?'onItemDeselect':'onItemSelect']);if(W){eval('var Q='+W+'(this);');if(!Q)return}if(!b){this.n_state&=~4}else{var c=this.o_root.o_selected;this.o_root.o_selected=this;if(c)c.select(true);this.n_state|=4}this.state_lookup();this.H();return Boolean(this.a_config[1])}function d(){var W=(this.a_config[2]?this.a_config[2]['hv']:null);W=(W?W:this.o_root.a_tpl['onItemMover']);if(W){eval('var Q='+W+'(this);');if(!Q)return}this.n_state|=64;this.state_lookup()}function e(){var W=(this.a_config[2]?this.a_config[2]['hu']:null);W=(W?W:this.o_root.a_tpl['onItemMout']);if(W){eval('var Q='+W+'(this);');if(!Q)return}this.n_state&=~64;this.state_lookup()}function f(g){window.setTimeout("window.status='"+(g?'':(this.a_config[2]&&this.a_config[2]['sb']?this.a_config[2]['sb']:this.a_config[0]+(this.a_config[1]?' ('+this.a_config[1]+')':'')))+"'",10)}function S(){var a_index=this.o_root.a_index,n_order=0,n_id=this.n_id,o_parent;while(true){n_id--;if(n_id<0)break;if(a_index[n_id].n_depth<this.n_depth){o_parent=a_index[n_id];break}if(a_index[n_id].n_depth==this.n_depth)n_order++}this.o_parent=o_parent?o_parent:this.o_root;this.n_order=n_order;this.state_lookup=h;this.mover=d;this.mout=e;this.select=a;this.H=f;if(this.a_config.length>3){n_id=this.n_id;this.a_children=[];while(true){n_id++;if(n_id==a_index.length)break;if(a_index[n_id].n_depth<=this.n_depth)break;if(a_index[n_id].n_depth==this.n_depth+1){a_index[n_id].R=S;this.a_children[this.a_children.length]=a_index[n_id]}}this.open=T;this.save=k;this.load=l;this.Z=m}else{this.open=function(){return};this.load=function(){return}}this.n_state=(this.n_depth?0:32)+(this.a_children?16:0)+(this.n_order==this.o_parent.a_children.length-1?1:0);var n=(this.o_root.a_tpl['style_icons']?' class="'+this.o_root.a_tpl['style_icons']+'"':''),o=[],p=this.o_parent,q=this.a_config[2];for(var i=this.n_depth;i>1;i--){o[i]='<img src="'+this.o_root.a_tpl[p.n_state&1?'icon_e':'icon_l']+'"'+n+' border="0">';p=p.o_parent}this.load();var r=this.state_lookup(true);return '<table cellpadding="0" cellspacing="0" border="0"><tr onmouseover="TREES['+this.o_root.n_id+'].mover('+this.n_id+')" onmouseout="TREES['+this.o_root.n_id+'].mout('+this.n_id+')"><td nowrap>'+o.join('')+(r[1]?(this.a_children?'<a href="javascript: TREES['+this.o_root.n_id+'].toggle('+this.n_id+')" onmouseover="TREES['+this.o_root.n_id+'].mover('+this.n_id+')" onmouseout="TREES['+this.o_root.n_id+'].mout('+this.n_id+')"><img src="'+r[1]+'" border="0" name="j'+this.o_root.n_id+'_'+this.n_id+'"'+n+'></a>':'<img src="'+r[1]+'" border="0"'+n+'>'):'')+(r[0]?'<a href="'+this.a_config[1]+'" target="'+(q&&q['tw']?q['tw']:this.o_root.a_tpl['target'])+'" title="'+(q&&q['tt']?q['tt']:'')+'" onclick="return TREES['+this.o_root.n_id+'].select('+this.n_id+')" ondblclick="TREES['+this.o_root.n_id+'].toggle('+this.n_id+')"><img src="'+r[0]+'" border="0" name="i'+this.o_root.n_id+'_'+this.n_id+'"'+n+'></a>':'')+'</td><td nowrap'+(r[2]?' class="'+r[2]+'"':'')+' id="t'+this.o_root.n_id+'_'+this.n_id+'"><a href="'+this.a_config[1]+'" target="'+(q&&q['tw']?q['tw']:this.o_root.a_tpl['target'])+'" title="'+(q&&q['tt']?q['tt']:'')+'" onclick="return TREES['+this.o_root.n_id+'].select('+this.n_id+')" ondblclick="TREES['+this.o_root.n_id+'].toggle('+this.n_id+')">'+this.a_config[0]+'</a></td></tr></table>'+(this.a_children?'<div id="c'+this.o_root.n_id+'_'+this.n_id+'" style="display:'+(this.n_state&8?'block">'+this.Z():'none">')+'</div>':'')}function m(){var s=[];for(var i=0;i<this.a_children.length;i++)s[i]=this.a_children[i].R();return s.join('')}function k(){var u=Math.floor(this.n_node_id/31);this.o_root.a_states[u]=(this.n_state&8?this.o_root.a_states[u]|(1<<(this.n_node_id%31)):this.o_root.a_states[u]&~(1<<(this.n_node_id%31)));document.cookie='tree_'+this.o_root.n_id+'_state='+this.o_root.a_states.join('_')}function l(){var W=(W?W:this.o_root.a_tpl['onItemLoad']);if(W){eval('var Q='+W+'(this);');if(!Q)return}if(this.a_config[2]&&typeof(this.a_config[2]['st'])=='number'){if(Boolean(this.a_config[2]['st']))this.n_state|=8;else this.n_state&=~8;return}if(!this.o_root.a_states.length){var v=this.o_root.a_children;for(var i=0;i<v.length;i++){v[i].n_state|=8;v[i].save()}return}var u=Math.floor(this.n_node_id/31);if(Boolean(this.o_root.a_states[u]&(1<<(this.n_node_id%31))))this.n_state|=8;else this.n_state&=~8}function h(w){var x=this.n_state&~3;var y=this.n_state&~68|2;var z=this.a_config[2]?this.a_config[2]['i'+(x&~48)]:0;if(!z)z=this.o_root.a_tpl['icon_'+x];if(!z)z=this.o_root.a_tpl['icon_'+(x&~64)];var AA=this.o_root.a_tpl['icon_'+y];var AB=this.a_config[2]?this.a_config[2]['s'+(x&~48)]:0;if(!AB)AB=this.o_root.a_tpl['style_'+x];if(!AB)AB=this.o_root.a_tpl['style_'+(x&~64)];if(w)return[z,AA,AB];var AC=document.images['j'+this.o_root.n_id+'_'+this.n_id];if(AC)AC.src=AA;AC=document.images['i'+this.o_root.n_id+'_'+this.n_id];if(AC)AC.src=z;AC=Y('t'+this.o_root.n_id+'_'+this.n_id);if(AC)AC.className=AB}var TREES=[],B_DOM;Y=document.all?function(AD){return document.all[AD]}:(document.getElementById?function(AD){return document.getElementById(AD)}:function(AD){return null});