function Node(c,f,a,b,i,g,h,d,e){this.id=c;this.pid=f;this.name=a;this.url=b;this.title=i;this.target=g;this.icon=h;this.iconOpen=d;this._io=e||false;this._is=false;this._ls=false;this._hc=false;this._ai=0;this._p}function dTree(b){this.config={target:null,folderLinks:true,useSelection:true,useCookies:true,useLines:true,useIcons:true,useStatusText:false,closeSameLevel:false,inOrder:false};var a="js/img/";this.icon={root:a+"base.gif",folder:a+"folder.gif",folderOpen:a+"folderopen.gif",node:a+"page.gif",empty:a+"empty.gif",line:a+"line.gif",join:a+"join.gif",joinBottom:a+"joinbottom.gif",plus:a+"plus.gif",plusBottom:a+"plusbottom.gif",minus:a+"minus.gif",minusBottom:a+"minusbottom.gif",nlPlus:a+"nolines_plus.gif",nlMinus:a+"nolines_minus.gif"};this.obj=b;this.aNodes=[];this.aIndent=[];this.root=new Node(-1);this.selectedNode=null;this.selectedFound=false;this.completed=false}dTree.prototype.add=function(c,f,a,b,i,g,h,d,e){this.aNodes[this.aNodes.length]=new Node(c,f,a,b,i,g,h,d,e)};dTree.prototype.chStat=function(a){this.complete=a};dTree.prototype.openAll=function(){this.oAll(true)};dTree.prototype.closeAll=function(){this.oAll(false)};dTree.prototype.toString=function(){var a='<div class="dtree">\n';if(document.getElementById){if(this.config.useCookies){this.selectedNode=this.getSelected()}a+=this.addNode(this.root)}else{a+="Browser not supported."}a+="</div>";if(!this.selectedFound){this.selectedNode=null}this.completed=true;return a};dTree.prototype.addNode=function(a){var b="";var d=0;if(this.config.inOrder){d=a._ai}for(d;d<this.aNodes.length;d++){if(this.aNodes[d].pid==a.id){var c=this.aNodes[d];c._p=a;c._ai=d;this.setCS(c);if(!c.target&&this.config.target){c.target=this.config.target}if(c._hc&&!c._io&&this.config.useCookies){c._io=this.isOpen(c.id)}if(!this.config.folderLinks&&c._hc){c.url=null}if(this.config.useSelection&&c.id==this.selectedNode&&!this.selectedFound){c._is=true;this.selectedNode=d;this.selectedFound=true}b+=this.node(c,d);if(c._ls){break}}}return b};dTree.prototype.node=function(a,c){var b='<div class="dTreeNode">'+this.indent(a,c);if(this.config.useIcons){if(!a.icon){a.icon=(this.root.id==a.pid)?this.icon.root:((a._hc)?this.icon.folder:this.icon.node)}if(!a.iconOpen){a.iconOpen=(a._hc)?this.icon.folderOpen:this.icon.node}if(this.root.id==a.pid){a.icon=this.icon.root;a.iconOpen=this.icon.root}b+='<img id="i'+this.obj+c+'" src="'+((a._io)?a.iconOpen:a.icon)+'" alt="" />'}if(a.url){b+='<a id="s'+this.obj+c+'" class="'+((this.config.useSelection)?((a._is?"nodeSel":"node")):"node")+'" href="'+a.url+'"';if(a.title){b+=' title="'+a.title+'"'}if(a.target){b+=' target="'+a.target+'"'}if(this.config.useStatusText){b+=" onmouseover=\"window.status='"+a.name+"';return true;\" onmouseout=\"window.status='';return true;\" "}if(this.config.useSelection&&((a._hc&&this.config.folderLinks)||!a._hc)){b+=' onclick="'+this.obj+".s("+c+');"'}b+=">"}else{if((!this.config.folderLinks||!a.url)&&a._hc&&a.pid!=this.root.id){b+='<a href="javascript: '+this.obj+".o("+c+');" class="node">'}}b+=a.name;if(a.url||((!this.config.folderLinks||!a.url)&&a._hc)){b+="</a>"}b+="</div>";if(a._hc){b+='<div id="d'+this.obj+c+'" class="clip" style="display:'+((this.root.id==a.pid||a._io)?"block":"none")+';">';b+=this.addNode(a);b+="</div>"}this.aIndent.pop();return b};dTree.prototype.indent=function(a,c){var b="";if(this.root.id!=a.pid){for(var d=0;d<this.aIndent.length;d++){b+='<img src="'+((this.aIndent[d]==1&&this.config.useLines)?this.icon.line:this.icon.empty)+'" alt="" />'}(a._ls)?this.aIndent.push(0):this.aIndent.push(1);if(a._hc){b+='<a href="javascript: '+this.obj+".o("+c+');"><img id="j'+this.obj+c+'" src="';if(!this.config.useLines){b+=(a._io)?this.icon.nlMinus:this.icon.nlPlus}else{b+=((a._io)?((a._ls&&this.config.useLines)?this.icon.minusBottom:this.icon.minus):((a._ls&&this.config.useLines)?this.icon.plusBottom:this.icon.plus))}b+='" alt="" /></a>'}else{b+='<img src="'+((this.config.useLines)?((a._ls)?this.icon.joinBottom:this.icon.join):this.icon.empty)+'" alt="" />'}}return b};dTree.prototype.setCS=function(a){var b;for(var c=0;c<this.aNodes.length;c++){if(this.aNodes[c].pid==a.id){a._hc=true}if(this.aNodes[c].pid==a.pid){b=this.aNodes[c].id}}if(b==a.id){a._ls=true}};dTree.prototype.isFolder=function(a){return(this.aNodes[this.getNum(a)]._hc)?true:false};dTree.prototype.isRootFolder=function(a){return(this.aNodes[this.getNum(a)].pid==0)?true:false};dTree.prototype.getName=function(a){return this.aNodes[this.getNum(a)].name};dTree.prototype.getSelected=function(){var a=this.getCookie("cs"+this.obj);return(a)?a:null};dTree.prototype.getSelectedId=function(){var a=this.getCookie("cs"+this.obj);return(a)?a._ai:null};dTree.prototype.getNum=function(b){var a=null;for(var c=0;c<this.aNodes.length;c++){if(this.aNodes[c].id==b){a=c;break}}return a};dTree.prototype.s=function(b){if(!this.config.useSelection){return}var a=this.aNodes[b];if(a._hc&&!this.config.folderLinks){return}if(this.selectedNode!=b){if(this.selectedNode||this.selectedNode==0){document.getElementById("s"+this.obj+this.selectedNode).className="node"}document.getElementById("s"+this.obj+b).className="nodeSel";this.selectedNode=b;if(this.config.useCookies){this.setCookie("cs"+this.obj,a.id)}}};dTree.prototype.o=function(b){var a=this.aNodes[b];this.nodeStatus(!a._io,b,a._ls);a._io=!a._io;if(this.config.closeSameLevel){this.closeLevel(a)}if(this.config.useCookies){this.updateCookie()}};dTree.prototype.oAll=function(a){for(var b=0;b<this.aNodes.length;b++){if(this.aNodes[b]._hc&&this.aNodes[b].pid!=this.root.id){this.nodeStatus(a,b,this.aNodes[b]._ls);this.aNodes[b]._io=a}}if(this.config.useCookies){this.updateCookie()}};dTree.prototype.openTo=function(b,a,c){if(!c){for(var e=0;e<this.aNodes.length;e++){if(this.aNodes[e].id==b){b=e;break}}}var d=this.aNodes[b];if(d.pid==this.root.id||!d._p){return}d._io=true;d._is=a;if(this.completed&&d._hc){this.nodeStatus(true,d._ai,d._ls)}if(this.completed&&a){this.s(d._ai)}else{if(a){this._sn=d._ai}}if(this.config.closeSameLevel){this.closeLevel(d)}if(this.config.useCookies){this.updateCookie()}this.openTo(d._p._ai,false,true)};dTree.prototype.closeLevel=function(a){for(var b=0;b<this.aNodes.length;b++){if(this.aNodes[b].pid==a.pid&&this.aNodes[b].id!=a.id&&this.aNodes[b]._hc){this.nodeStatus(false,b,this.aNodes[b]._ls);this.aNodes[b]._io=false;this.closeAllChildren(this.aNodes[b])}}};dTree.prototype.closeAllChildren=function(a){for(var b=0;b<this.aNodes.length;b++){if(this.aNodes[b].pid==a.id&&this.aNodes[b]._hc){if(this.aNodes[b]._io){this.nodeStatus(false,b,this.aNodes[b]._ls)}this.aNodes[b]._io=false;this.closeAllChildren(this.aNodes[b])}}};dTree.prototype.nodeStatus=function(h,d,b){var j=document.getElementById("d"+this.obj+d);var i=document.getElementById("j"+this.obj+d);if(this.config.useIcons){var g=document.getElementById("i"+this.obj+d);g.src=(h)?this.aNodes[d].iconOpen:this.aNodes[d].icon}var f=(b)?this.icon.minusBottom:this.icon.minus;var e=(b)?this.icon.plusBottom:this.icon.plus;var c=(h)?this.icon.nlMinus:this.icon.nlPlus;var a=(h)?f:e;i.src=(this.config.useLines)?a:c;j.style.display=(h)?"block":"none"};dTree.prototype.updateCookie=function(){var a="";for(var b=0;b<this.aNodes.length;b++){if(this.aNodes[b]._io&&this.aNodes[b].pid!=this.root.id){if(a){a+="."}a+=this.aNodes[b].id}}this.setCookie("co"+this.obj,a)};dTree.prototype.delCookie=function(c){var a=new Date();var b=new Date(a.getTime()-1000*60*60*24);this.setCookie(c,"",b)};dTree.prototype.setCookie=function(f,e,a,d,b,c){document.cookie=escape(f)+"="+escape(e)+(a?"; expires="+a.toGMTString():"")+(d?"; path="+d:"")+(b?"; domain="+b:"")+(c?"; secure":"")};dTree.prototype.updateDescrCookie=function(a){if(!this.config.useSelection){return}if(this.config.useCookies){this.setCookie("cd"+this.obj,a)}};dTree.prototype.updateTypeCookie=function(a){if(!this.config.useSelection){return}if(this.config.useCookies){this.setCookie("ct"+this.obj,a)}};dTree.prototype.getCookie=function(e){var d="";var b=document.cookie.indexOf(escape(e)+"=");if(b!=-1){var c=b+(escape(e)+"=").length;var a=document.cookie.indexOf(";",c);if(a!=-1){d=unescape(document.cookie.substring(c,a))}else{d=unescape(document.cookie.substring(c))}}return(d)};dTree.prototype.getCartArrCookie=function(d){var c=this.getCookie(d);if(c!="undefined"&&c!=""){var b=c.split(".");for(var a=0;a<b.length;a++){b[a]=parseInt(b[a])}return b}return false};dTree.prototype.getQCookie=function(b){var a=this.getCartArrCookie("cca");var c=this.getCartArrCookie("cqa");for(key in a){if(a[key]==b){return c[key]}}return false};dTree.prototype.addCartCookie=function(b,d){var f=this.getCookie("cca");var e=this.getCookie("cqa");if(f!="undefined"&&f!=""){var i=this.getCartArrCookie("cca");var h=this.getCartArrCookie("cqa")}var g=-1;var j=true;if(f!="undefined"&&f!=""){for(var c=0;c<i.length;c++){if(i[c]==b){g=c;j=false;break}}}if(j){if(f!="undefined"&&f!=""){f=f+"."+b;e=e+"."+d}else{f=b;e=d}this.setCookie("cca",f)}else{h[g]+=parseInt(d);var a=h[0];if(h.length>1){for(var c=1;c<h.length;c++){a=a+"."+h[c]}}e=a}this.setCookie("cqa",e)};dTree.prototype.delCartCookie=function(a){var d=this.getCookie("cca");var c=this.getCookie("cqa");var h=this.getCartArrCookie("cca");var g=this.getCartArrCookie("cqa");var e=-1;for(var b=0;b<h.length;b++){if(h[b]==a){e=b;break}}if(e>=0){h.splice(e,1);g.splice(e,1);var i=h[0];var f=g[0];if(h.length>1){for(var b=1;b<h.length;b++){i=i+"."+h[b];f=f+"."+g[b]}}d=i;c=f;this.setCookie("cca",d);this.setCookie("cqa",c);return true}return false};dTree.prototype.isOpen=function(c){var b=this.getCookie("co"+this.obj).split(".");for(var a=0;a<b.length;a++){if(b[a]==c){return true}}return false};if(!Array.prototype.push){Array.prototype.push=function array_push(){for(var a=0;a<arguments.length;a++){this[this.length]=arguments[a]}return this.length}}if(!Array.prototype.pop){Array.prototype.pop=function array_pop(){lastElement=this[this.length-1];this.length=Math.max(this.length-1,0);return lastElement}};