ZtVWeb.MenuViewCtrl=function(form,id,name,x,y,w,h,font,font_size,font_weight,font_color,font_color_smenu,bg_color,overcolor,textovercolor,menu_type,tag_node,max_level,link_secondary,target_default,close_level,css,className,root_value,separator,separator_vert,sx_btn_image,dx_btn_image,sx_btnover_image,dx_btnover_image,arrow_image,bg_color_smenu,over_color_smenu,textover_color_smenu,btn_imageWidth,z_index,btn_image,btnover_image,anchor,emitter_name){this.form=form;this.id=id;this.name=name;this.font=LRTrim(font);this.bg_color=LRTrim(bg_color);this.max_level=max_level;this.link_secondary=LRTrim(link_secondary);this.target_default=LRTrim(target_default);this.close_level=LRTrim(close_level);this.css=LRTrim(css);this.className=LRTrim(className);this.font_color_smenu=LRTrim(font_color_smenu);this.textover_color_smenu=Lower(textover_color_smenu);this.bg_color_smenu=Lower(bg_color_smenu);this.over_color_smenu=Lower(over_color_smenu);this.arrow_image=LRTrim(arrow_image);this.btn_image=LRTrim(btn_image);this.btnover_image=LRTrim(btnover_image);this.sx_btn_image=LRTrim(sx_btn_image);this.sx_btnover_image=LRTrim(sx_btnover_image);this.dx_btn_image=LRTrim(dx_btn_image);this.dx_btnover_image=LRTrim(dx_btnover_image);this.separator=LRTrim(separator);this.separator_vert=LRTrim(separator_vert);this.root_value=root_value;this.btn_imageWidth=btn_imageWidth;this.z_index=0+z_index;this.tag_node=tag_node;this.menu_type=menu_type;if(menu_type=="true"||menu_type=="false"){this.menu_type=(eval(menu_type)?"horizontal":"vertical")}this.overcolor=Lower(overcolor);this.textovercolor=Lower(textovercolor);this.fontweight=LRTrim(font_weight);this.fontsize=font_size;this.font_color=LRTrim(font_color);this.emitter_name=emitter_name;this.Ctrl=document.getElementById(this.id);this.setCtrlPos(this.Ctrl,x,y,w,h,anchor,this.form.width,this.form.height);this.addToForm(this.form,this);this.isCssBased=(Empty(this.font)||this.fontsize==0||Empty(this.fontweight)||Empty(this.font_color)||Empty(this.font_color_smenu)||Empty(this.bg_color_smenu));this.selectedId="";this.selectedId2="";this.querynode=null;this.querynodesList=new Array();this.datasource=null;this.paramconsumers=new Array();this.dataconsumers=new Array();this.level_old=0;this.over=false;this.Value=function(){if(this.querynodesList.length!=0){this.querynode=this.querynodesList.shift();return this.querynode.nodeid}else{if(typeof(this.Tree.currentnode)!="undefined"){return this.Tree.currentnode.nodeid}}return""};this.tree=function(ctrl){this.ctrl=ctrl;this.allnodes=new Array();this.root=new tree_node(this,ctrl.root_value,-1,"");this.currentnode=this.root;this.getRoot=function(){return this.root};this.render=function(){var domObj=document.getElementById(this.ctrl.id);domObj.style.zIndex=this.ctrl.z_index;this.ctrl.form.Ctrl.style.zIndex=this.ctrl.z_index;this.root.opened=true;switch(this.ctrl.menu_type){case"vertical":domObj.innerHTML=this.root.viewVertical();break;case"horizontal":domObj.innerHTML=this.root.viewHorizontal();break;case"flat":domObj.innerHTML=this.root.viewFlat();break;case"horizontal2":domObj.innerHTML=this.root.viewHorizontal2();break;case"slide":domObj.innerHTML=this.root.viewSlide()}}};function tree_node(tree,nodeid,level,descr,childnum,nodeseq,link,target,icon,iconOver,expr,exprNot,parent,nodeFather){this.tree=tree;tree.allnodes.push(this);this.index=tree.allnodes.length-1;this.nodeseq=nodeseq;this.nodeid=nodeid;this.parent=parent;this.descr=descr;this.childnum=childnum;this.link=link;this.target=target;this.icon=icon;this.iconOver=iconOver;this.expr=expr;this.exprNot=exprNot;this.children=new Array();this.level=level;this.executequery=false;this.opened=false;this.nodeFather=nodeFather;this.setExecuteQuery=function(value){this.executequery=value};this.setOpened=function(value){this.opened=value};this.addChild=function(nodeid,level,descr,childnum,nodeseq,link,target,icon,iconOver,expr,exprNot,parent,nodeFather){var newnode=new tree_node(this.tree,nodeid,level,descr,childnum,nodeseq,link,target,icon,iconOver,expr,exprNot,parent,nodeFather);this.children.push(newnode);return newnode};this.getChildNum=function(){return this.children.length};this.selectNode=function(e){if(e.stopPropagation){e.stopPropagation()}else{e.cancelBubble=true}this.tree.currentnode=this;if(this.childnum=="0"||((this.level+1)>=this.tree.ctrl.max_level&&this.tree.ctrl.max_level>0)){this.tree.ctrl.over=false;this.tree.ctrl.onMenuClick()}else{this.tree.ctrl.over=true;if(this.tree.ctrl.menu_type=="horizontal2"&&this.level==0){this.tree.ctrl.deselect_all(true);this.tree.ctrl.highlightCurrentNode2()}if(this.executequery){this.opened=true;this.fillNode()}else{this.opened=!this.opened;this.view()}}if(this.tree.ctrl.menu_type=="flat"){if(parseInt(this.tree.ctrl.form.Ctrl.style.height)<window.document.getElementById(this.tree.ctrl.id+"_main_menu").offsetHeight){this.tree.ctrl.form.Ctrl.style.height=window.document.getElementById(this.tree.ctrl.id+"_main_menu").offsetHeight}else{if(window.document.getElementById(this.tree.ctrl.id+"_main_menu").offsetHeight<this.tree.ctrl.form.height){this.tree.ctrl.form.Ctrl.style.height=this.tree.ctrl.form.height}else{this.tree.ctrl.form.Ctrl.style.height=window.document.getElementById(this.tree.ctrl.id+"_main_menu").offsetHeight}}}};this.checkCondition=function(){var visualizer=true;if(this.expr.length>0||this.exprNot.length>0){try{visualizer=eval(this.tree.ctrl.form.formid+"."+this.tree.ctrl.name+"_Validate('"+this.expr+"','"+this.exprNot+"')")}catch(e){}}return visualizer};this.prepareCallBackSelectNode=function(){return this.tree.ctrl.form.formid+"."+this.tree.ctrl.name+".Tree.allnodes["+this.index+"].selectNode(event)"};this.prepareCallBackOverNode=function(){return this.tree.ctrl.form.formid+"."+this.tree.ctrl.name+".Tree.allnodes["+this.index+"].overNode()"};this.prepareCallBackSelectOut=function(){return this.tree.ctrl.form.formid+"."+this.tree.ctrl.name+".select_out(event)"};this.prepareCallBackOpenClose=function(index_menu){return this.tree.ctrl.form.formid+"."+this.tree.ctrl.name+".Tree.allnodes["+this.index+"].openClose("+index_menu+")"};this.prepareCallBackLinkSlideMenu=function(link,target,parentNode){return this.tree.ctrl.form.formid+"."+this.tree.ctrl.name+".Tree.allnodes["+this.index+"].linkSlideMenu('"+link+"','"+target+"','"+parentNode+"')"};this.prepareRollover=function(id){return this.tree.ctrl.form.formid+"."+this.tree.ctrl.name+".Tree.allnodes["+this.index+"].rollImage('"+id+"','"+iconOver+"')"};this.prepareRollout=function(id){return this.tree.ctrl.form.formid+"."+this.tree.ctrl.name+".Tree.allnodes["+this.index+"].rollImage('"+id+"','"+icon+"')"};this.rollImage=function(id,rollover){if(!Empty(rollover)){eval("document.getElementById('"+id+"').src='../"+rollover+"'")}if(this.tree.ctrl.menu_type!="flat"){eval(this.tree.ctrl.form.formid+"."+this.tree.ctrl.name+".Tree.allnodes["+this.index+"].overNode()")}if(this.tree.ctrl.menu_type!="flat"){this.tree.currentnode=this;this.tree.ctrl.highlightCurrentNode();if(this.tree.ctrl.over){if(this.executequery){this.fillNode()}}}};this.overNode=function(){this.tree.currentnode=this;this.tree.ctrl.highlightCurrentNode();if(this.tree.ctrl.over){if(this.executequery){this.fillNode()}else{this.view()}}};this.fillNode=function(){this.tree.ctrl.querynodesList.push(this);this.executequery=false;this.markLoading();setTimeout(this.tree.ctrl.form.formid+"."+this.tree.ctrl.name+".datasource.Query()",1)};this.getCtrlElement=function(){return document.getElementById(this.tree.ctrl.id+"_"+this.index)};this.getCtrlElementSubMenu=function(){if(this.tree.ctrl.menu_type=="flat"){return document.getElementById(this.tree.ctrl.id+"_"+this.index+"_sub")}else{if(this.tree.ctrl.menu_type=="horizontal2"){if(this.level==0){return document.getElementById(this.tree.ctrl.id+"_"+this.level+"_sec")}else{if(this.level==1){return document.getElementById(this.tree.ctrl.id+"_"+this.level+"_sub2")}else{return document.getElementById(this.tree.ctrl.id+"_"+this.level+"_sub")}}}else{return document.getElementById(this.tree.ctrl.id+"_"+this.level+"_sub")}}};this.markLoading=function(){var Selection;var top=0,left=0;var ctrl=this.getCtrlElementSubMenu();if(this.tree.ctrl.menu_type!="flat"){if(this.tree.ctrl.menu_type=="horizontal2"&&this.level==0){Selection=ctrl;top=0}else{Selection=document.getElementById(this.tree.ctrl.selectedId);top=Selection.offsetTop}left=Selection.offsetLeft}ctrl.innerHTML='<div id="__LOADING__" style="padding-top:'+top+";padding-left:"+left+';font-family:sans-serif;font-size:7pt;">Loading...</div>';ctrl.style.display="block"};this.view=function(){var ctrl=this.getCtrlElementSubMenu();var html="";if(this.children.length>0){if(this.tree.ctrl.menu_type=="flat"){var i=ctrl.parentNode.className.lastIndexOf("_");if(this.opened){if(ctrl.innerHTML.indexOf("__LOADING__")!=-1){ctrl.innerHTML=this.tree.ctrl.drawFlatItems(this,999,1);ctrl.parentNode.className=ctrl.parentNode.className.substr(0,i)+"_open";ctrl.style.display="block"}else{ctrl.parentNode.className=ctrl.parentNode.className.substr(0,i)+"_open";ctrl.style.display="block"}}else{ctrl.parentNode.className=ctrl.parentNode.className.substr(0,i)+"_close";ctrl.style.display="none"}}else{if(this.tree.ctrl.menu_type=="horizontal2"&&this.level==0){html=this.viewHorizontal();ctrl.innerHTML=html}else{if(document.getElementById(this.tree.ctrl.selectedId)!=null){if(!Empty(this.icon)){var Selection=document.getElementById(this.tree.ctrl.selectedId+"_icons")}else{var Selection=document.getElementById(this.tree.ctrl.selectedId)}if(document.getElementById(this.tree.ctrl.selectedId+"_sx")!=null){Selection=document.getElementById(this.tree.ctrl.selectedId+"_sx")}var top=Selection.offsetTop;var left=Selection.offsetLeft}if((this.tree.ctrl.menu_type=="horizontal"||this.tree.ctrl.menu_type=="horizontal2")&&left>0){html+="<table border=0 cellspacing=0 cellpadding=0><tr><td><div style='width:"+left+";z-index:"+this.tree.ctrl.z_index+"'></div><td>"}if(top>0&&this.level>=0){html+="<div style='font-size:0;margin:0px;border:0px;padding:0px;height:"+top+";z-index:"+this.tree.ctrl.z_index+"'></div>"}html+="<table border=0 cellspacing=0 cellpadding=0 style=''><tr><td valign=top>";html+="<table id='submenu_table' border=0 class='submenu_border' cellpadding=3 cellspacing=0>";for(var i=0;i<this.children.length;i++){var node=this.children[i];if(node.checkCondition()){if(!this.tree.ctrl.isCssBased){html+="<tr id='"+this.tree.ctrl.id+"_"+node.index+"' bgcolor='"+this.tree.ctrl.bg_color_smenu+"' onclick='"+node.prepareCallBackSelectNode()+"' style='font-family:"+this.tree.ctrl.font+";font-size:"+this.tree.ctrl.fontsize+";font-weight:"+this.tree.ctrl.fontweight+";color:"+this.tree.ctrl.font_color_smenu+";cursor:pointer'"}else{html+="<tr id='"+this.tree.ctrl.id+"_"+node.index+"' onclick='"+node.prepareCallBackSelectNode()+"' class='submenu_font'"}if(node.descr.indexOf("-----")==0){if(i<this.children.length-1){if(!Empty(this.tree.ctrl.css)){html+="><td class='icons_smenu'></td><td colspan=2  id='"+this.tree.ctrl.id+"_"+node.index+"_descr'><table cellpadding=0 cellspacing=0 class='submenu_sep_vert'><tr><td></td></tr></table></td>"}else{html+="><td class='icons_smenu'></td><td colspan=2  id='"+this.tree.ctrl.id+"_"+node.index+"_descr'><table cellpadding=0 cellspacing=0 class='submenu_sep_vert' style='height:1;width:100%;border-bottom:1px solid'><tr><td></td></tr></table></td>"}}}else{html+=" onmouseover='"+node.prepareCallBackOverNode()+"'>";if(!Empty(node.icon)){html+="<td class='icons_smenu' id='"+this.tree.ctrl.id+"_"+node.index+"_icons' ><a href='"+node.link+"' target='"+node.target+"'><img id='"+this.tree.ctrl.id+"_"+node.index+"_image' src='../"+node.icon+"' style='border:0' onmouseover="+node.prepareRollover(this.tree.ctrl.id+"_"+node.index+"_image")+" onmouseout="+node.prepareRollout(this.tree.ctrl.id+"_"+node.index+"_image")+"></a></td>"}else{html+="<td class='icons_smenu' id='"+this.tree.ctrl.id+"_"+node.index+"_icons'></td>"}var item=node.descr.replace(/\ /g,"&nbsp;");html+="<td id='"+this.tree.ctrl.id+"_"+node.index+"_descr' width='"+document.getElementById(this.tree.ctrl.selectedId+"_icons").offsetWidth+"' class='submenu_description'>"+item+"</td>";if(parseInt(node.childnum)>0){if(!Empty(this.tree.ctrl.arrow_image)){html+="<td><img id='"+this.tree.ctrl.id+"_"+node.index+"_img' src='"+this.tree.ctrl.arrow_image+"'></img></td>"}else{if(!Empty(this.tree.ctrl.css)){html+="<td><div id='"+this.tree.ctrl.id+"_"+node.index+"_img' class='menu_img_arrow'></div></td>"}}}else{html+="<td></td>"}html+="</tr>";if(i<this.children.length-1){if(node.parent!=this.children[i+1].parent){if(!this.tree.ctrl.isCssBased&&!Empty(this.tree.ctrl.bg_color_smenu)){html+="<tr id='"+this.tree.ctrl.id+"_"+node.index+"_smout' height='1px' onmouseout='"+node.prepareCallBackSelectOut()+"' bgcolor='"+this.tree.ctrl.bg_color_smenu+"'><td class='icons_smenu' colspan=3></td></tr>"}else{html+="<tr id='"+this.tree.ctrl.id+"_"+node.index+"_smout' height='1px' onmouseout='"+node.prepareCallBackSelectOut()+"' class='submenu_font'><td class='icons_smenu' colspan=3></td></tr>"}}}else{try{html+="<tr id='"+this.tree.ctrl.id+"_"+node.index+"_smout' height='1px' onmouseout='"+node.prepareCallBackSelectOut()+"'><td class='submenu_font' colspan=3></td></tr>"}catch(e){}}}}}var idlevel=this.tree.ctrl.id+"_"+LRTrim(Str(this.level+1))+"_sub";html+="</table></td><td valign=top id='"+idlevel+"'></td></tr></table>";if((menu_type=="horizontal"||menu_type=="horizontal2")&&(top>0)){html+="</tr></table>"}ctrl.innerHTML=html}}}else{ctrl.innerHTML=""}};this.viewVertical=function(){var isIE=navigator.appName.indexOf("Microsoft");if(isIE==-1){var html="<table id='"+this.tree.ctrl.id+"_main_menu' width="+(w)+" border=0 cellspacing=0 cellpadding=0><tr  width="+(w)+"><td valign=top  width="+(w)+"><table width="+(w)+" border=0  class='menu_border' cellpadding=0 cellspacing=0>";for(var i=0;i<this.children.length;i++){var node=this.children[i];if(node.checkCondition()){if(i==0){html+="<tr><td colspan='4' height=3 onmouseout='"+node.prepareCallBackSelectOut()+"'></td></tr>"}if(!Empty(this.tree.ctrl.btn_image)){html+="<tr id='"+this.tree.ctrl.id+"_"+node.index+"_back' height="+(h)+" onclick='"+node.prepareCallBackSelectNode()+";"+node.prepareCallBackLinkSlideMenu(node.link,node.target)+"' style='background:transparent;background-image:url("+this.tree.ctrl.btn_image+")'>"}else{html+="<tr id='"+this.tree.ctrl.id+"_"+node.index+"_back' height="+(h)+" onclick="+node.prepareCallBackSelectNode()+";"+node.prepareCallBackLinkSlideMenu(node.link,node.target)+" class='menu_img'>"}if(!Empty(this.tree.ctrl.sx_btn_image)){html+="<td cellpadding=0 cellspacing=0 width="+this.tree.ctrl.btn_imageWidth+" id='"+this.tree.ctrl.id+"_"+node.index+"_sx' align='right' style='padding-left:0px;padding-right:0px;border:0px;background-image:url("+this.tree.ctrl.sx_btn_image+")'></td>"}else{if(!Empty(this.tree.ctrl.css)){html+="<td cellpadding=0 cellspacing=0 id='"+this.tree.ctrl.id+"_"+node.index+"_sx' align='right' class='menu_img_sx' onmouseout='"+node.prepareCallBackSelectOut()+"'></td>"}else{html+="<span id='"+this.tree.ctrl.id+"_"+node.index+"_sx' width='0px'></span>"}}if(!Empty(this.tree.ctrl.field_Icons)){if(!Empty(node.icon)){html+="<td style='padding:0px; margin:0px;' class='icons_menu' id='"+this.tree.ctrl.id+"_"+node.index+"_icons' ><a href='"+node.link+"' target='"+node.target+"' onmouseover="+node.prepareRollover(this.tree.ctrl.id+"_"+node.index+"_image")+" onmouseout="+node.prepareRollout(this.tree.ctrl.id+"_"+node.index+"_image")+"><img id='"+this.tree.ctrl.id+"_"+node.index+"_image' src='../"+node.icon+"' style='border:0' ></a></td>"}else{html+="<td style='padding:0px; margin:0px;' class='icons_menu' id='"+this.tree.ctrl.id+"_"+node.index+"_icons' onmouseover="+node.prepareRollover(this.tree.ctrl.id+"_"+node.index+"_image")+" onmouseout="+node.prepareRollout(this.tree.ctrl.id+"_"+node.index+"_image")+"></td>"}}var item=node.descr;if(!Empty(node.link)&&node.link.indexOf("function")<0){if(!this.tree.ctrl.isCssBased){item="<a style='text-decoration:none' href='"+node.link+"' target='"+node.target+"' onclick='return false'><font id='"+this.tree.ctrl.id+"_"+node.index+"_descr_font' style='text-decoration:none' href='"+node.link+"' target='"+node.target+"' onclick='return false;'><font style='font-family:"+this.tree.ctrl.font+";font-size:"+this.tree.ctrl.fontsize+";font-weight:"+this.tree.ctrl.fontweight+";color:"+this.tree.ctrl.font_color+";cursor:hand;background:transparent'>"+node.descr+"</font></a>"}else{item="<a style='text-decoration:none' href='"+node.link+"' target='"+node.target+"' onclick='return false'><font id='"+this.tree.ctrl.id+"_"+node.index+"_descr_font' class='menu_font'>"+node.descr+"</font></a>"}}var posizioneIniz=item.indexOf("<font");if(posizioneIniz!=-1){var posizioneFinale=item.indexOf("menu_font'>");var strSinistra=item.substring(0,posizioneIniz-1);var strSinistra=strSinistra+" class='menu_vert'>";var strDestra=item.substring(posizioneFinale+11);item=strSinistra+""+strDestra}if(!this.tree.ctrl.isCssBased&&!Empty(this.tree.ctrl.bg_color)){html+="<td bgcolor='"+this.tree.ctrl.bg_color+"' id='"+this.tree.ctrl.id+"_"+node.index+"' style='font-family:"+this.tree.ctrl.font+";font-size:"+this.tree.ctrl.fontsize+";font-weight:"+this.tree.ctrl.fontweight+";color:"+this.tree.ctrl.font_color+"' onmouseover='"+node.prepareCallBackOverNode()+"'>";html+="<span style='padding-left:6px;padding-right:6px'>"+item+"</span></td>"}else{html+="<td id='"+this.tree.ctrl.id+"_"+node.index+"' class='menu_font' onmouseover='"+node.prepareCallBackOverNode()+"'>";html+="<span style='padding-left:6px;padding-right:6px'>"+item+"</span></td>"}html+="</td>";if(this.tree.ctrl.dx_btn_image!=""){html+="<td cellpadding=0 cellspacing=0 width="+this.tree.ctrl.btn_imageWidth+" id='"+this.tree.ctrl.id+"_"+node.index+"_dx' align='left' style='border:0px;background-image:url("+this.tree.ctrl.dx_btn_image+")'></td>"}else{if(this.tree.ctrl.css!=""){html+="<td id='"+this.tree.ctrl.id+"_"+node.index+"_dx' align='left' width='1px' class='menu_img_dx' onmouseout='"+node.prepareCallBackSelectOut()+"'></td>"}else{html+="<span id='"+this.tree.ctrl.id+"_"+node.index+"_dx' width='0px'></span>"}}html+="</tr>";if(i<this.children.length-1){if(node.parent==this.children[i+1].parent){if(!Empty(this.tree.ctrl.separator_vert)){html+="<tr><td colspan='4' align='center'><img src='"+this.tree.ctrl.separator_vert+"'></td></tr>"}else{if(!Empty(this.tree.ctrl.css)){html+="<tr><td colspan='4' class='menu_sep_vert'></td></tr>"}}}}else{html+="<tr><td colspan='4' height=3 onmouseout='"+node.prepareCallBackSelectOut()+"'></td></tr>"}}}var idlevel=this.tree.ctrl.id+"_"+LRTrim(Str(this.level+1))+"_sub";html+="</table></td><td valign=top id='"+idlevel+"'></td></tr></table>";return html}else{var html="<table id='"+this.tree.ctrl.id+"_main_menu' width="+(w)+" border=0 cellspacing=0 cellpadding=0><tr  width="+(w)+"><td valign=top  width="+(w)+"><table width="+(w)+" border=0  class='menu_border' cellpadding=0 cellspacing=0>";for(var i=0;i<this.children.length;i++){var node=this.children[i];if(node.checkCondition()){if(i==0){html+="<tr><td colspan='4' height=3 onmouseout='"+node.prepareCallBackSelectOut()+"'></td></tr>"}if(!Empty(this.tree.ctrl.btn_image)){html+="<tr id='"+this.tree.ctrl.id+"_"+node.index+"_back' height="+(h)+" onclick='"+node.prepareCallBackSelectNode()+";"+node.prepareCallBackLinkSlideMenu(node.link,node.target)+"' style='background:transparent;background-image:url("+this.tree.ctrl.btn_image+")'>"}else{html+="<tr id='"+this.tree.ctrl.id+"_"+node.index+"_back' height="+(h)+" onclick="+node.prepareCallBackSelectNode()+";"+node.prepareCallBackLinkSlideMenu(node.link,node.target)+" class='menu_img'>"}if(!Empty(this.tree.ctrl.sx_btn_image)){html+="<td cellpadding=0 cellspacing=0 width="+this.tree.ctrl.btn_imageWidth+" id='"+this.tree.ctrl.id+"_"+node.index+"_sx' align='right' style='padding-left:0px;padding-right:0px;border:0px;background-image:url("+this.tree.ctrl.sx_btn_image+")'></td>"}else{if(!Empty(this.tree.ctrl.css)){html+="<td cellpadding=0 cellspacing=0 id='"+this.tree.ctrl.id+"_"+node.index+"_sx' align='right' class='menu_img_sx'></td>"}else{html+="<span id='"+this.tree.ctrl.id+"_"+node.index+"_sx' width='0px'></span>"}}if(!Empty(this.tree.ctrl.field_Icons)){if(!Empty(node.icon)){html+="<td style='padding:0px; margin:0px;' class='icons_menu' id='"+this.tree.ctrl.id+"_"+node.index+"_icons' ><a href='"+node.link+"' target='"+node.target+"' onmouseover="+node.prepareRollover(this.tree.ctrl.id+"_"+node.index+"_image")+" onmouseout="+node.prepareRollout(this.tree.ctrl.id+"_"+node.index+"_image")+"><img id='"+this.tree.ctrl.id+"_"+node.index+"_image' src='../"+node.icon+"' style='border:0' ></a></td>"}else{html+="<td style='padding:0px; margin:0px;' class='icons_menu' id='"+this.tree.ctrl.id+"_"+node.index+"_icons' onmouseover="+node.prepareRollover(this.tree.ctrl.id+"_"+node.index+"_image")+" onmouseout="+node.prepareRollout(this.tree.ctrl.id+"_"+node.index+"_image")+"></td>"}}var item=node.descr;if(!Empty(node.link)&&node.link.indexOf("function")<0){if(!this.tree.ctrl.isCssBased){item="<a style='text-decoration:none' href='"+node.link+"' target='"+node.target+"' onclick='return false'><font id='"+this.tree.ctrl.id+"_"+node.index+"_descr_font' style='text-decoration:none' href='"+node.link+"' target='"+node.target+"' onclick='return false;'><font style='font-family:"+this.tree.ctrl.font+";font-size:"+this.tree.ctrl.fontsize+";font-weight:"+this.tree.ctrl.fontweight+";color:"+this.tree.ctrl.font_color+";cursor:hand;background:transparent'>"+node.descr+"</font></a>"}else{item="<a style='text-decoration:none' href='"+node.link+"' target='"+node.target+"' onclick='return false'><font id='"+this.tree.ctrl.id+"_"+node.index+"_descr_font' class='menu_font'>"+node.descr+"</font></a>"}}if(!this.tree.ctrl.isCssBased&&!Empty(this.tree.ctrl.bg_color)){html+="<td bgcolor='"+this.tree.ctrl.bg_color+"' id='"+this.tree.ctrl.id+"_"+node.index+"' style='font-family:"+this.tree.ctrl.font+";font-size:"+this.tree.ctrl.fontsize+";font-weight:"+this.tree.ctrl.fontweight+";color:"+this.tree.ctrl.font_color+"' onmouseover='"+node.prepareCallBackOverNode()+"'>";html+="<span style='padding-left:6px;padding-right:6px'>"+item+"</span></td>";html+="<td width='0px' bgcolor='"+this.tree.ctrl.bg_color+"' id='"+this.tree.ctrl.id+"_"+node.index+"_arr' onmouseover='"+node.prepareCallBackOverNode()+"'>"}else{html+="<td id='"+this.tree.ctrl.id+"_"+node.index+"' class='menu_font' onmouseover='"+node.prepareCallBackOverNode()+"'>";html+="<span style='padding-left:6px;padding-right:6px'>"+item+"</span></td>"}html+="</td>";if(this.tree.ctrl.dx_btn_image!=""){html+="<td cellpadding=0 cellspacing=0 width="+this.tree.ctrl.btn_imageWidth+" id='"+this.tree.ctrl.id+"_"+node.index+"_dx' align='left' style='border:0px;background-image:url("+this.tree.ctrl.dx_btn_image+")'></td>"}else{if(this.tree.ctrl.css!=""){html+="<td id='"+this.tree.ctrl.id+"_"+node.index+"_dx' align='left' width='1px' class='menu_img_dx'></td>"}else{html+="<span id='"+this.tree.ctrl.id+"_"+node.index+"_dx' width='0px'></span>"}}html+="</tr>";if(i<this.children.length-1){if(node.parent==this.children[i+1].parent){if(!Empty(this.tree.ctrl.separator_vert)){html+="<tr><td colspan='4' align='center'><img src='"+this.tree.ctrl.separator_vert+"'></td></tr>"}else{if(!Empty(this.tree.ctrl.css)){html+="<tr><td colspan='4' class='menu_sep_vert'></td></tr>"}}}}else{html+="<tr><td colspan='4' height=3 onmouseout='"+node.prepareCallBackSelectOut()+"'></td></tr>"}}}var idlevel=this.tree.ctrl.id+"_"+LRTrim(Str(this.level+1))+"_sub";html+="</table></td><td valign=top id='"+idlevel+"'></td></tr></table>";return html}};this.openClose=function(index_portlet,index_menu){if(this.children[index_menu].childnum!="0"){var old_style=window.document.getElementById(index_portlet.id+"_menu_"+index_menu+"_0").style.display}else{var old_style=""}for(i=0;i<this.children.length;i++){if(this.children[i].childnum!="0"){if((index_portlet.id+"_menu_"+index_menu+"_0")!=window.document.getElementById(index_portlet.id+"_menu_"+i+"_0").id){window.document.getElementById(index_portlet.id+"_menu_"+i+"_0").style.display="none"}}}if(old_style=="none"){if(this.children[index_menu].childnum!="0"){window.document.getElementById(index_portlet.id+"_menu_"+index_menu+"_0").style.display="block"}}else{if(this.children[index_menu].childnum!="0"){window.document.getElementById(index_portlet.id+"_menu_"+index_menu+"_0").style.display="none"}}if(parseInt(this.tree.ctrl.form.Ctrl.style.height)<window.document.getElementById(index_portlet.id+"_main_menu").offsetHeight){this.tree.ctrl.form.Ctrl.style.height=window.document.getElementById(index_portlet.id+"_main_menu").offsetHeight}else{if(window.document.getElementById(index_portlet.id+"_main_menu").offsetHeight<this.tree.ctrl.form.height){this.tree.ctrl.form.Ctrl.style.height=this.tree.ctrl.form.height}else{this.tree.ctrl.form.Ctrl.style.height=window.document.getElementById(index_portlet.id+"_main_menu").offsetHeight}}};this.linkSlideMenu=function(link,target,parentNode){if(link!="undefined"&&link!=""&&link!=null&&link!="../jsp/poba_hnotfound.jsp"&&this.tree.ctrl.menu_type!="horizontal"&&this.tree.ctrl.menu_type!="vertical"){var node_link=link;var frame=target;if(Substr(node_link,1,9)=="function:"){node_link=Strtran(node_link,"function:","");node_link='javascript:ZtVWeb.getPortlet("'+this.form.portletname+'").'+node_link}while(node_link.indexOf("|")>-1){node_link=node_link.replace("|",",")}if(node_link.indexOf("http://")!=0&&node_link.indexOf("https://")!=0&&!Empty(node_link)){node_link="../servlet/"+node_link}node_link=node_link.replace(/\s+$/g,"");if(Empty(frame)){frame=(!Empty(this.target_default))?this.target_default:"_self"}var width=frame.substring(frame.indexOf("|")+1,frame.lastIndexOf("|"));var height=frame.substr(frame.lastIndexOf("|")+1);if(parentNode!="undefined"){if(node_link.indexOf("?")>-1){node_link=node_link+"&p_openIndexMenu="+parentNode}else{node_link=node_link+"?p_openIndexMenu="+parentNode}}else{if(node_link.indexOf("?")>-1){node_link=node_link+"&p_openIndexMenu="+(this.tree.currentnode.nodeid-1)}else{node_link=node_link+"?p_openIndexMenu="+(this.tree.currentnode.nodeid-1)}}if(frame.indexOf("dialogwindow")==0){if((width.length>0)&&(height.length>0)){window.open(node_link,"","toolbar=no,scrollbars=no,resizable=yes,width="+width+",height="+height)}else{window.open(node_link,"","toolbar=no,scrollbars=no,resizable=yes")}}else{window.open(node_link,frame,"toolbar=no,scrollbars=no,resizable=yes")}}};this.drawSlide=function(node,i){var html="<div id='"+this.tree.ctrl.id+"_menu_"+i+"'><table cellpadding=0 cellspacing=0 border=0 width="+(w)+">";if(!Empty(this.tree.ctrl.btn_image)){html+="<tr id='"+this.tree.ctrl.id+"_"+node.index+"_back' height="+(h)+" style='background:transparent;background-image:url("+this.tree.ctrl.btn_image+")'>"}else{html+="<tr id='"+this.tree.ctrl.id+"_"+node.index+"_back' height="+(h)+" class='menu_img'>"}if(!Empty(this.tree.ctrl.sx_btn_image)){html+="<td cellpadding=0 cellspacing=0 width="+this.tree.ctrl.btn_imageWidth+" id='"+this.tree.ctrl.id+"_"+node.index+"_sx' align='right' style='padding-left:0px;padding-right:0px;border:0px;background-image:url("+this.tree.ctrl.sx_btn_image+")'></td>"}else{if(!Empty(this.tree.ctrl.css)){html+="<td cellpadding=0 cellspacing=0 id='"+this.tree.ctrl.id+"_"+node.index+"_sx' align='right' class='menu_img_sx'></td>"}else{html+="<span id='"+this.tree.ctrl.id+"_"+node.index+"_sx' width='0px'></span>"}}if(!Empty(this.tree.ctrl.field_Icons)){if(!Empty(node.icon)){html+="<td style='padding:0px; margin:0px;' class='icons_menu' id='"+this.tree.ctrl.id+"_"+node.index+"_icons' ><a href='javascript:void(0)' onclick="+this.prepareCallBackOpenClose(this.tree.ctrl.id+","+i)+";"+this.prepareCallBackLinkSlideMenu(node.link,node.target)+"><img id='"+this.tree.ctrl.id+"_"+node.index+"_image' src='../"+node.icon+"' style='border:0' onmouseover="+node.prepareRollover(this.tree.ctrl.id+"_"+node.index+"_image")+" onmouseout="+node.prepareRollout(this.tree.ctrl.id+"_"+node.index+"_image")+"></a></td>"}else{html+="<td style='padding:0px; margin:0px;' class='icons_menu' id='"+this.tree.ctrl.id+"_"+node.index+"_icons' ></td>"}}if(!this.tree.ctrl.isCssBased&&!Empty(this.tree.ctrl.bg_color)){html+="<td bgcolor='"+this.tree.ctrl.bg_color+"' id='"+this.tree.ctrl.id+"_"+node.index+"' style='font-family:"+this.tree.ctrl.font+";font-size:"+this.tree.ctrl.fontsize+";font-weight:"+this.tree.ctrl.fontweight+";color:"+this.tree.ctrl.font_color+"' onmouseover='"+node.prepareCallBackOverNode()+"'>";html+="<div style='padding-left:6px;padding-right:6pxtext-decoration:none' onclick="+this.prepareCallBackOpenClose(this.tree.ctrl.id+","+i)+";"+this.prepareCallBackLinkSlideMenu(node.link,node.target)+">";html+="<font id='"+this.tree.ctrl.id+"_"+node.index+"_descr_font' class='menu_font'>"+node.descr+"</font>";html+="</div></td>"}else{html+="<td id='"+this.tree.ctrl.id+"_"+node.index+"' class='menu_font' onmouseover='"+node.prepareCallBackOverNode()+"'>";html+="<div style='padding-left:6px;padding-right:6pxtext-decoration:none' onclick="+this.prepareCallBackOpenClose(this.tree.ctrl.id+","+i)+";"+this.prepareCallBackLinkSlideMenu(node.link,node.target)+">";html+="<font id='"+this.tree.ctrl.id+"_"+node.index+"_descr_font' class='menu_font'>"+node.descr+"</font>";html+="</div></td>"}if(this.tree.ctrl.dx_btn_image!=""){html+="<td cellpadding=0 cellspacing=0 width="+this.tree.ctrl.btn_imageWidth+" id='"+this.tree.ctrl.id+"_"+node.index+"_dx' align='left' style='border:0px;background-image:url("+this.tree.ctrl.dx_btn_image+")'></td>"}else{if(this.tree.ctrl.css!=""){html+="<td id='"+this.tree.ctrl.id+"_"+node.index+"_dx' align='left' width='1px' class='menu_img_dx'></td>"}else{html+="<div id='"+this.tree.ctrl.id+"_"+node.index+"_dx' width='0px'></div>"}}html+="</tr>";html+="</table></div>";return html};this.viewSlide=function(){var html="<table id='"+this.tree.ctrl.id+"_main_menu'  border=0 cellspacing=0 cellpadding=0 marginheight=0 marginwidth=0 topmargin=0 leftmargin=0 width="+(w)+" class='menu_border' onmouseout='"+this.prepareCallBackSelectOut()+"'><tr><td>";html+="<div class='menu_img_top'></div>";for(var i=0;i<this.children.length;i++){var node=this.children[i];if(node.childnum!="0"){html+=this.drawSlide(node,i);var openMenuIndex="";var id_portlet=id.substring(0,id.indexOf("_"));try{openMenuIndex=eval(id_portlet+"_p_openIndexMenu.value")}catch(e){}if(openMenuIndex!=""&&openMenuIndex==i){html+="<div id='"+this.tree.ctrl.id+"_menu_"+i+"_0' style='display:block'>"}else{html+="<div id='"+this.tree.ctrl.id+"_menu_"+i+"_0' style='display:none'>"}for(j=0;j<node.childnum;j++){html+="<div><table cellpadding=0 cellspacing=0 border=0 width="+(w)+"><tr>";try{if(!Empty(node.children[j].icon)){tml+="<td class='icons_smenu' id='"+this.tree.ctrl.id+"_"+node.children[j].index+"_icons' ><a href='javascript:void(0)' onclick="+this.prepareCallBackLinkSlideMenu(node.children[j].link,node.children[j].target,i)+"><img id='"+this.tree.ctrl.id+"_"+node.children[j].index+"_image' src='../"+node.children[j].icon+"' style='border:0' onmouseover="+node.children[j].prepareRollover(this.tree.ctrl.id+"_"+node.children[j].index+"_image")+" onmouseout="+node.children[j].prepareRollout(this.tree.ctrl.id+"_"+node.children[j].index+"_image")+"></a></td>"}else{html+="<td class='icons_smenu' id='"+this.tree.ctrl.id+"_"+node.children[j].index+"_icons'></td>"}}catch(e){}try{if(!this.tree.ctrl.isCssBased&&!Empty(this.tree.ctrl.bg_color)){html+="<td valign='middle' bgcolor='"+this.tree.ctrl.bg_color+"' id='"+this.tree.ctrl.id+"_"+node.children[j].index+"' style='font-family:"+this.tree.ctrl.font+";font-size:"+this.tree.ctrl.fontsize+";font-weight:"+this.tree.ctrl.fontweight+";color:"+this.tree.ctrl.font_color+"' onmouseover='"+node.children[j].prepareCallBackOverNode()+"'>";html+="<div style='padding-left:6px;padding-right:6pxtext-decoration:none' onclick="+this.prepareCallBackLinkSlideMenu(node.children[j].link,node.children[j].target,i)+">"+node.children[j].descr;html+="</div></td>"}else{html+="<td valign='middle' id='"+this.tree.ctrl.id+"_"+node.children[j].index+"' class='submenu_font' onmouseover='"+node.children[j].prepareCallBackOverNode()+"'>";html+="<div style='padding-left:6px;padding-right:6px;text-decoration:none' onclick="+this.prepareCallBackLinkSlideMenu(node.children[j].link,node.children[j].target,i)+">"+node.children[j].descr;html+="</div></td>"}}catch(e){}html+="</tr></table></div>";if(j<node.childnum-1){html+="<div class='submenu_sep_vert'></div>"}}html+="</div>"}else{html+=this.drawSlide(node,i)}if(i<this.children.length-1){html+="<div class='menu_sep_vert'></div>"}}html+="<div class='menu_img_bottom'></div>";html+="<td><tr></table>";return html};this.viewFlat=function(){var html="<div id='"+this.tree.ctrl.id+"_main_menu' class='menuFlat'>";html+="<div class='menuWrapper'>";var s="";s=this.tree.ctrl.drawFlatItems(this,1,1);if(s.length>0){html+="<div class='menuRootContainer'>";html+="<div class='menuContent'>";html+=s;html+="</div>";html+="</div>"}html+="<div class='menuWrapperContainer'>";for(var i=0;i<this.children.length;i++){if(this.children[i].childnum!="0"){html+="<div class='menuContainer'>";if(this.children[i].link!="undefined"&&this.children[i].link!=""&&this.children[i].link!=null&&this.children[i].link!="../jsp/poba_hnotfound.jsp"){html+="<a href='"+this.children[i].link+"' target='"+this.children[i].target+"'><h1>"+this.children[i].descr+"</h1>"}else{html+="<h1>"+this.children[i].descr+"</h1>"}html+="<div class='menuContent'>";html+=this.tree.ctrl.drawFlatItems(this.children[i],99999,1);html+="</div>";html+="</div>"}}html+="</div>";html+="</div>";html+="</div>";return html};this.viewHorizontal=function(){var html="<table border=0 cellspacing=0 cellpadding=0 marginheight=0 marginwidth=0 topmargin=0 leftmargin=0><tr><td><table border=0 marginheight=0 marginwidth=0 topmargin=0 leftmargin=0 class='menu_border' cellpadding=0 cellspacing=0><tr>";for(var i=0;i<this.children.length;i++){var node=this.children[i];if(node.checkCondition()&&node.descr.indexOf("-----")!=0){if(!Empty(this.tree.ctrl.sx_btn_image)){html+="<td height="+(h)+" width="+this.tree.ctrl.btn_imageWidth+" id='"+this.tree.ctrl.id+"_"+node.index+"_sx' align='bottom' style='border:0px;background-image:url("+this.tree.ctrl.sx_btn_image+")'></td>"}else{html+="<td height="+(h)+" id='"+this.tree.ctrl.id+"_"+node.index+"_sx' align='bottom' class='menu_img_sx'></td>"}if(!Empty(this.tree.ctrl.field_Icons)){if(!Empty(node.icon)){html+="<td height="+(h)+" class='icons_menu' id='"+this.tree.ctrl.id+"_"+node.index+"_icons' onclick='"+node.prepareCallBackSelectNode()+"'><a href='"+node.link+"' target='"+node.target+"' onclick='return false;' style='outline:none;-moz-outline:none;'><font id='"+this.tree.ctrl.id+"_"+node.index+"_icons_back' class='menu_font'><img id='"+this.tree.ctrl.id+"_"+node.index+"_image' src='../"+node.icon+"' style='border:0' onmouseover="+node.prepareRollover(this.tree.ctrl.id+"_"+node.index+"_image")+" onmouseout="+node.prepareRollout(this.tree.ctrl.id+"_"+node.index+"_image")+"></font></a></td>"}else{html+="<td height="+(h)+" class='icons_menu' id='"+this.tree.ctrl.id+"_"+node.index+"_icons'></td>"}}if(!this.tree.ctrl.isCssBased){html+="<td height="+(h)+" id='"+this.tree.ctrl.id+"_"+node.index+"' bgcolor='"+this.tree.ctrl.bg_color+"' onclick='"+node.prepareCallBackSelectNode()+"' style='font-family:"+this.tree.ctrl.font+";font-size:"+this.tree.ctrl.fontsize+";font-weight:"+this.tree.ctrl.fontweight+";color:"+this.tree.ctrl.font_color+";cursor:hand'>"}else{html+="<td height="+(h)+" id='"+this.tree.ctrl.id+"_"+node.index+"' onclick='"+node.prepareCallBackSelectNode()+"' class='menu_font'>"}if(!Empty(this.tree.ctrl.btn_image)){html+="<table id='"+this.tree.ctrl.id+"_"+node.index+"_back' cellspacing=0 cellpadding=0 margin=0 height="+(h)+" style='height:"+(h)+";background:transparent;background-image:url("+this.tree.ctrl.btn_image+");padding-left:3px;padding-right:3px'>"}else{html+="<table id='"+this.tree.ctrl.id+"_"+node.index+"_back' cellspacing=0 cellpadding=0 margin=0 height="+(h)+" class='menu_img'><tr>"}var item=node.descr;var ctrlmouse="onmouseover='"+node.prepareCallBackOverNode()+"' onmouseout='"+node.prepareCallBackSelectOut()+"'";if(!Empty(node.link)&&node.link.indexOf("function")<0){var ctrlmouse="";if(!this.tree.ctrl.isCssBased){item="<a onmouseover='"+node.prepareCallBackOverNode()+"' onmouseout='"+node.prepareCallBackSelectOut()+"' style='text-decoration:none' href='"+node.link+"' target='"+node.target+"' onclick='return false;'><font id='"+this.tree.ctrl.id+"_"+node.index+"_descr_font' style='font-family:"+this.tree.ctrl.font+";font-size:"+this.tree.ctrl.fontsize+";font-weight:"+this.tree.ctrl.fontweight+";color:"+this.tree.ctrl.font_color+";cursor:hand;background:transparent'>"+node.descr+"</font></a>"}else{item="<a onmouseover='"+node.prepareCallBackOverNode()+"' onmouseout='"+node.prepareCallBackSelectOut()+"' style='text-decoration:none' href='"+node.link+"' target='"+node.target+"' onclick='return false;'><font id='"+this.tree.ctrl.id+"_"+node.index+"_descr_font' class='menu_font'>"+node.descr+"</font></a>"}}if(!this.tree.ctrl.isCssBased){html+="<td "+ctrlmouse+" id='"+this.tree.ctrl.id+"_"+node.index+"_descr' valign=middle style='font-family:"+this.tree.ctrl.font+";font-size:"+this.tree.ctrl.fontsize+";font-weight:"+this.tree.ctrl.fontweight+";color:"+this.tree.ctrl.font_color+";cursor:hand;background:transparent' onclick="+this.prepareCallBackLinkSlideMenu(node.link,node.target)+">"+item+"</td></tr></table>"}else{html+="<td "+ctrlmouse+" id='"+this.tree.ctrl.id+"_"+node.index+"_descr' valign=middle class='menu_font' style='background:transparent' onclick="+this.prepareCallBackLinkSlideMenu(node.link,node.target)+">"+item+"</td></tr></table>"}html+="</td>";if(!Empty(this.tree.ctrl.dx_btn_image)){html+="<td height="+(h)+" width="+this.tree.ctrl.btn_imageWidth+" id='"+this.tree.ctrl.id+"_"+node.index+"_dx' align='bottom' style='border:0px;background-image:url("+this.tree.ctrl.dx_btn_image+")'></td>"}else{html+="<td height="+(h)+" id='"+this.tree.ctrl.id+"_"+node.index+"_dx' align='bottom' class='menu_img_dx'></td>"}if(i<this.children.length-1){if(node.parent==this.children[i+1].parent){if(this.tree.ctrl.separator!=""){html+="<td height="+(h)+"><img src='"+this.tree.ctrl.separator+"'></img></td>"}else{if(this.tree.ctrl.css!=""){html+="<td height="+(h)+" class='menu_sep'></td>"}}}}}}var idlevel=this.tree.ctrl.id+"_"+LRTrim(Str(this.level+1))+"_sub";html+="</tr></table></td></tr><tr><td id='"+idlevel+"'></td></tr></table>";return html};this.viewHorizontal2=function(){var idlevel=this.tree.ctrl.id+"_"+LRTrim(Str(this.level+1))+"_prin";var html="<div id='"+idlevel+"' class=menu_prin><table width="+(w)+" border=0 cellpadding=0 cellspacing=0 marginheight=0 marginwidth=0 topmargin=0 leftmargin=0><tr>";for(var i=0;i<this.children.length;i++){var node=this.children[i];if(node.checkCondition()&&node.descr.indexOf("-----")!=0&&(0+node.childnum)>0){if(!Empty(this.tree.ctrl.sx_btn_image)){html+="<td height="+(h)+" width="+this.tree.ctrl.btn_imageWidth+" id='"+this.tree.ctrl.id+"_"+node.index+"_sx'  style='border:0px;background-image:url("+this.tree.ctrl.sx_btn_image+")'></td>"}else{html+="<td height="+(h)+" id='"+this.tree.ctrl.id+"_"+node.index+"_sx' class='menuPrin_img_sx'></td>"}var item=node.descr;if(!Empty(node.link)&&node.link.indexOf("function")<0){item="<a style='text-decoration:none' class='menuPrin_font_link' href='"+node.link+"' target='"+node.target+"' onclick='return false;'>"+node.descr+"</a>"}if(!this.tree.ctrl.isCssBased){html+="<td onclick='"+node.prepareCallBackSelectNode()+"' onmousedown="+this.prepareCallBackLinkSlideMenu(node.link,node.target)+" height="+(h)+" id='"+this.tree.ctrl.id+"_"+node.index+"_descr' valign=middle style='font-family:"+this.tree.ctrl.font+";font-size:"+this.tree.ctrl.fontsize+";font-weight:"+this.tree.ctrl.fontweight+";color:"+this.tree.ctrl.font_color+";cursor:hand;'>"+item+"</td>"}else{html+="<td onclick='"+node.prepareCallBackSelectNode()+"' onmousedown="+this.prepareCallBackLinkSlideMenu(node.link,node.target)+" height="+(h)+" id='"+this.tree.ctrl.id+"_"+node.index+"_descr' valign=middle class='menuPrin_font'>"+item+"</td>"}if(!Empty(this.tree.ctrl.dx_btn_image)){html+="<td height="+(h)+" width="+this.tree.ctrl.btn_imageWidth+" id='"+this.tree.ctrl.id+"_"+node.index+"_dx' style='border:0px;background-image:url("+this.tree.ctrl.dx_btn_image+")'></td>"}else{html+="<td height="+(h)+" id='"+this.tree.ctrl.id+"_"+node.index+"_dx' class='menuPrin_img_dx'></td>"}}if(i<this.children.length-1){if(node.parent==this.children[i+1].parent){if(this.tree.ctrl.separator!=""){html+="<td height="+(h)+"><img src='"+this.tree.ctrl.separator+"'></img></td>"}else{if(this.tree.ctrl.css!=""){html+="<td height="+(h)+" class='menuPrin_sep'></td>"}}}}}html+="</td></tr></table></div>";idlevel=this.tree.ctrl.id+"_"+LRTrim(Str(this.level+1))+"_sec";html+="<div id='"+idlevel+"' class='menu_sec'>";html+="</div>";idlevel=this.tree.ctrl.id+"_"+LRTrim(Str(this.children[0].level+1))+"_sub2";html+="<div style='padding:0px; margin:0px; border:0px;' id='"+idlevel+"'>";html+="</div>";return html}}function resize_portlet_height(){if((menu_type=="vertical")||(menu_type=="slide")||(menu_type=="flat")){id_portlet=id.substring(0,id.indexOf("_"));id_portlet_menu=id+"_main_menu";height_portlet=parseInt(window.document.getElementById(id_portlet).style.height);try{if(height_portlet<window.document.getElementById(id_portlet_menu).offsetHeight){window.document.getElementById(id_portlet).style.height=window.document.getElementById(id_portlet_menu).offsetHeight}}catch(e){}}}var isIE=navigator.appName.indexOf("Microsoft");if(isIE!=-1){window.attachEvent("onload",resize_portlet_height)}else{addEvent(window,"load",resize_portlet_height)}this.getPath=function(node){var current=node;var pathNode=new Array();while(typeof(current.nodeFather)!="undefined"){pathNode.push(current);current=current.nodeFather}pathNode.reverse();return pathNode};this.select_out=function(event){this.deselect_all(false)};this.onmousedown=function(event){this.deselect_all(false)};this.openTree=function(node){var openMenuIndex="";var id_portlet=id.substring(0,id.indexOf("_"));try{openMenuIndex=eval(id_portlet+"_p_openIndexMenu.value")}catch(e){}if(openMenuIndex!=""&&openMenuIndex==node.nodeid){node.setOpened(true);var app_id="block"}else{node.setOpened(false);var app_id="none";if(node.childnum>0){for(var j=0;j<node.childnum;j++){app_id=this.openTree(node.children[j])}}}return app_id};this.drawFlatItems=function(node,max_level,level){var shtml="";for(var i=0;i<node.children.length;i++){if(node.children[i].childnum=="0"){if(node.children[i].checkCondition()){shtml+="<li class='itemMenu' onclick='"+node.children[i].prepareCallBackSelectNode()+"'>";if(!Empty(node.children[i].icon)){shtml+="<a href='"+node.children[i].link+"' target='"+node.children[i].target+"'><font id='"+node.children[i].index+"_icons_back'><img id='"+id+"_"+node.children[i].index+"_image' src='../"+node.children[i].icon+"' style='border:0' onmouseover="+node.children[i].prepareRollover(id+"_"+node.children[i].index+"_image")+" onmouseout="+node.children[i].prepareRollout(id+"_"+node.children[i].index+"_image")+"></font></a>"}shtml+="<a href='"+node.children[i].link+"' target='"+node.children[i].target+"' onclick='return false'>"+node.children[i].descr+"</a></li>"}}else{if(max_level>1){var styleDisplay=this.openTree(node.children[i]);if(styleDisplay=="block"){var classItem="subMenu_open";var valOpened=true}else{var classItem="subMenu_close";var valOpened=false}shtml+="<li class='"+classItem+"' onclick='"+node.children[i].prepareCallBackSelectNode()+"'><a href='javascript:void(0)' onclick='return false'>"+node.children[i].descr+"</a>";shtml+="<div style='display:"+styleDisplay+"' id='"+this.id+"_"+node.children[i].index+"_sub'>"+this.drawFlatItems(node.children[i],max_level-1,level+1)+"</div>";shtml+="</li>"}}}return(shtml.length>0?("<ul>"+shtml+"</ul>"):"")};this.highlightCurrentNode=function(){if(this.selectedId!=""){var oldSelId=this.selectedId;var deCtrl=document.getElementById(oldSelId);if(this.level_old==0||(this.level_old==1&&this.menu_type=="horizontal2")){try{if(!Empty(this.btn_image)){document.getElementById(deCtrl.id+"_back").style.background="url("+this.btn_image+")"}else{document.getElementById(deCtrl.id+"_back").className="menu_img"}}catch(e){}try{if(!Empty(this.sx_btn_image)){document.getElementById(deCtrl.id+"_sx").style.background="url("+this.sx_btn_image+")"}else{document.getElementById(deCtrl.id+"_sx").className="menu_img_sx"}}catch(e){}try{if(!Empty(this.dx_btn_image)){document.getElementById(deCtrl.id+"_dx").style.background="url("+this.dx_btn_image+")"}else{document.getElementById(deCtrl.id+"_dx").className="menu_img_dx"}}catch(e){}try{document.getElementById(deCtrl.id+"_icons").className="icons_menu"}catch(e){}try{document.getElementById(deCtrl.id+"_icons_back").className="menu_font"}catch(e){}try{if(!Empty(this.font_color)&&!Empty(this.bg_color)){deCtrl.style.color=this.font_color;document.getElementById(deCtrl.id+"_descr").style.color=this.font_color;deCtrl.style.backgroundColor=""}else{deCtrl.className="menu_font";if(this.menu_type=="horizontal"||this.menu_type=="horizontal2"){document.getElementById(deCtrl.id+"_descr").className="menu_font";document.getElementById(deCtrl.id+"_descr_font").className="menu_font"}}}catch(e){}if(this.menu_type=="slide"){try{document.getElementById(deCtrl.id+"_descr_font").className="menu_font"}catch(e){}}try{if(this.menu_type=="vertical"){if(!Empty(document.getElementById(deCtrl.id+"_arr"))){document.getElementById(this.selectedId+"_arr").className="menu_font";document.getElementById(deCtrl.id+"_descr_font").className="menu_font"}else{document.getElementById(deCtrl.id+"_arr").style.backgroundColor="";document.getElementById(deCtrl.id+"_descr_font").style.backgroundColor=""}}}catch(e){}}else{try{if(!Empty(this.font_color_smenu)){deCtrl.style.color=this.tree.ctrl.font_color_smenu;deCtrl.style.backgroundColor=""}else{deCtrl.className="submenu_font"}try{document.getElementById(deCtrl.id+"_descr_font").className="menu_font"}catch(e){}try{document.getElementById(deCtrl.id+"_icons").className="icons_smenu"}catch(e){}}catch(e){}}this.selectedId=""}this.level_old=this.Tree.currentnode.level;this.selectedId=this.id+"_"+this.Tree.currentnode.index;var Selection=document.getElementById(this.selectedId);var SelectionBack=document.getElementById(this.selectedId+"_back");var SelectionSx=document.getElementById(this.selectedId+"_sx");var SelectionDx=document.getElementById(this.selectedId+"_dx");var SelectionArr=document.getElementById(this.selectedId+"_arr");var SelectionDescr=document.getElementById(this.selectedId+"_descr");var SelectionDescrFont=document.getElementById(this.selectedId+"_descr_font");var SelectionSmOut=document.getElementById(this.selectedId+"_smout");var SelectionIcons=document.getElementById(this.selectedId+"_icons");var SelectionIconsBack=document.getElementById(this.selectedId+"_icons_back");if(this.Tree.currentnode.level==0||(this.menu_type=="horizontal2"&&this.Tree.currentnode.level==1)){if(!Empty(this.overcolor)&&!Empty(this.textovercolor)){Selection.style.backgroundColor=this.overcolor;Selection.style.color=this.textovercolor;SelectionDescr.style.color=this.textovercolor;SelectionDescrFont.style.color=this.textovercolor}else{Selection.className="menu_font_over";if(this.menu_type=="horizontal"||this.menu_type=="horizontal2"){SelectionDescr.className="menu_font_over";try{SelectionDescrFont.className="menu_font_over"}catch(e){}}}if(this.menu_type=="vertical"){if(!Empty(this.overcolor)&&!Empty(this.textovercolor)){try{SelectionDescrFont.style.backgroundColor=this.overcolor;SelectionDescrFont.style.color=this.textover_color}catch(e){}}else{try{SelectionDescrFont.className="menu_font_over"}catch(e){}}}if(this.menu_type=="slide"){try{SelectionDescrFont.className="menu_font_over"}catch(e){}}if(!Empty(this.btnover_image)){SelectionBack.style.background="url("+this.btnover_image+")"}else{SelectionBack.className="menu_img_over"}if(this.sx_btnover_image!=""){SelectionSx.style.background="url("+this.sx_btnover_image+")"}else{SelectionSx.className="menu_img_sx_over"}if(this.dx_btnover_image!=""){SelectionDx.style.background="url("+this.dx_btnover_image+")"}else{SelectionDx.className="menu_img_dx_over"}if(SelectionIcons!=null){SelectionIcons.className="icons_menu_over"}if(SelectionIconsBack!=null){SelectionIconsBack.className="menu_font_over"}}else{if(!Empty(this.over_color_smenu)&&!Empty(this.textover_color_smenu)){Selection.style.backgroundColor=this.over_color_smenu;Selection.style.color=this.textover_color_smenu}else{Selection.className="submenu_font_over";try{document.getElementById(Selection.id+"_descr_font").className="menu_font_over"}catch(e){}try{document.getElementById(Selection.id+"_icons").className="icons_smenu_over"}catch(e){}try{document.getElementById(Selection.id+"_icons_back").className="menu_font_over"}catch(e){}}}};this.highlightCurrentNode2=function(){if(this.selectedId2!=""){var oldSelId=this.selectedId2;try{if(!Empty(this.sx_btn_image)){document.getElementById(oldSelId+"_sx").style.background="url("+this.sx_btn_image+")"}else{document.getElementById(oldSelId+"_sx").className="menuPrin_img_sx"}}catch(e){}try{if(!Empty(this.dx_btn_image)){document.getElementById(oldSelId+"_dx").style.background="url("+this.dx_btn_image+")"}else{document.getElementById(oldSelId+"_dx").className="menuPrin_img_dx"}}catch(e){}try{if(!Empty(this.font_color)&&!Empty(this.bg_color)){document.getElementById(oldSelId+"_descr").style.color=this.font_color;document.getElementById(oldSelId+"_descr").style.backgroundColor=""}else{document.getElementById(oldSelId+"_descr").className="menuPrin_font"}}catch(e){}}this.selectedId2=this.id+"_"+this.Tree.currentnode.index;var SelectionSx=document.getElementById(this.selectedId2+"_sx");var SelectionDx=document.getElementById(this.selectedId2+"_dx");var SelectionDescr=document.getElementById(this.selectedId2+"_descr");if(!Empty(this.overcolor)&&!Empty(this.textovercolor)){SelectionDescr.style.color=this.textovercolor}else{SelectionDescr.className="menuPrin_font_over"}if(this.sx_btnover_image!=""){SelectionSx.style.background="url("+this.sx_btnover_image+")"}else{SelectionSx.className="menuPrin_img_sx_over"}if(this.dx_btnover_image!=""){SelectionDx.style.background="url("+this.dx_btnover_image+")"}else{SelectionDx.className="menuPrin_img_dx_over"}};this.onMenuClick=function(){if(Empty(this.Tree.currentnode.link)&&!Empty(this.link_secondary)){var submenu_name=this.Tree.currentnode.descr;var submenu_id=this.Tree.currentnode.nodeid;window.open(LRTrim(this.link_secondary)+"&start_uid="+submenu_id+"&start="+submenu_name,this.target_default)}else{var node_link=this.Tree.currentnode.link;var frame=this.Tree.currentnode.target;if(Substr(node_link,1,9)=="function:"){node_link=Strtran(node_link,"function:","");node_link='javascript:ZtVWeb.getPortlet("'+this.form.portletname+'").'+node_link}while(node_link.indexOf("|")>-1){node_link=node_link.replace("|",",")}if(node_link.indexOf("http://")!=0&&node_link.indexOf("https://")!=0&&!Empty(node_link)){node_link="../servlet/"+node_link}node_link=node_link.replace(/\s+$/g,"");if(Empty(frame)){frame=(!Empty(this.target_default))?this.target_default:"_self"}var width=frame.substring(frame.indexOf("|")+1,frame.lastIndexOf("|"));var height=frame.substr(frame.lastIndexOf("|")+1);if(menu_type=="flat"){if(node_link.indexOf("?")>-1){node_link=node_link+"&p_openIndexMenu="+this.Tree.currentnode.parent}else{node_link=node_link+"?p_openIndexMenu="+this.Tree.currentnode.parent}}if(frame.indexOf("dialogwindow")==0){if((width.length>0)&&(height.length>0)){window.open(node_link,"","toolbar=no,scrollbars=no,resizable=yes,width="+width+",height="+height)}else{window.open(node_link,"","toolbar=no,scrollbars=no,resizable=yes")}}else{window.open(node_link,frame,"toolbar=no,scrollbars=no,resizable=yes")}}this.deselect_all(false);if(!Empty(this.emitter_name)&&this.Tree.currentnode.target!="_blank"){var path=this.getPath(this.Tree.currentnode);var parmsObj={path:path,append:false};this.form.raiseEvent(this.emitter_name,parmsObj)}};this.deselect_all=function(click_portlet){var deCtrl;if(this.menu_type!="flat"){var idNode=this.id+"_"+this.Tree.currentnode.index;deCtrl=document.getElementById(idNode);try{if(!Empty(this.btn_image)){document.getElementById(deCtrl.id+"_back").style.background="url("+this.btn_image+")"}else{document.getElementById(deCtrl.id+"_back").className="menu_img"}}catch(e){}try{if(!Empty(this.sx_btn_image)){document.getElementById(deCtrl.id+"_sx").style.background="url("+this.sx_btn_image+")"}else{document.getElementById(deCtrl.id+"_sx").className="menu_img_sx"}}catch(e){}try{if(!Empty(this.dx_btn_image)){document.getElementById(deCtrl.id+"_dx").style.background="url("+this.dx_btn_image+")"}else{document.getElementById(deCtrl.id+"_dx").className="menu_img_dx"}}catch(e){}try{document.getElementById(deCtrl.id+"_icons").className="icons_menu"}catch(e){}try{document.getElementById(deCtrl.id+"_icons_back").className="menu_font"}catch(e){}try{if(!Empty(this.font_color)&&!Empty(this.overcolor)){deCtrl.style.color=this.font_color;document.getElementById(deCtrl.id+"_descr").style.color=this.font_color;deCtrl.style.backgroundColor=""}else{deCtrl.className="menu_font";if(this.menu_type=="horizontal"){document.getElementById(deCtrl.id+"_descr").className="menu_font";try{document.getElementById(deCtrl.id+"_descr_font").className="menu_font"}catch(e){}}}}catch(e){}try{if(this.menu_type=="vertical"&&deCtrl.id!=this.selectedId){document.getElementById(deCtrl.id+"_arr").style.backgroundColor="";try{document.getElementById(this.selectedId+"_descr_font").className="menu_font"}catch(e){}}else{if(!Empty(document.getElementById(this.selectedId+"_arr"))){document.getElementById(this.selectedId+"_arr").className="menu_font"}try{document.getElementById(this.selectedId+"_descr_font").className="menu_font"}catch(e){}}}catch(e){}if(this.menu_type=="slide"){try{document.getElementById(deCtrl.id+"_descr_font").className="menu_font"}catch(e){}if(this.Tree.currentnode.level!=0){try{deCtrl.className="submenu_font"}catch(e){}}}try{document.getElementById(deCtrl.id+"_icons").className="icons_menu"}catch(e){}if(this.Tree.currentnode.level!=0||click_portlet){var submenu=(this.menu_type!="horizontal2")?"sub":"sub2";var index=(this.menu_type!="horizontal2")?(this.Tree.root.level+1):(this.Tree.root.level+2);deCtrl=document.getElementById(this.id+"_"+index+"_"+submenu);if(this.menu_type!="slide"){deCtrl.innerHTML=""}}}};this.NavXML=function(pNode,pLevel,pNodeXML,pNodeID,pParentID){var level=pLevel;var nodeID,parentID;var node,NodeID,NodeName,NodeChild,NodeParent,Icons,Frame,NodeLink;nodeID=pNodeID;parentID=pParentID;for(var i=0;i<pNodeXML.childNodes.length;i++){var nodechild=pNodeXML.childNodes.item(i);if(i==0){level++}if(nodechild.nodeName==this.tag_node){var index=nodeID;nodeID++;NodeID=getTagValue(nodechild,this.field_NodeID);NodeName=getTagValue(nodechild,this.field_NodeDescr);NodeChild=getTagValue(nodechild,this.field_ChildCount);NodeParent=parentID;if(!Empty(this.field_Icons)){var value=getTagValue(nodechild,this.field_Icons);if(value.indexOf(".")>0){Icons=value}else{Icons=""}}var oLink=new ItemLink(getTagValue(nodechild,this.field_NodeLink));NodeLink=oLink.link+(oLink.parameters.length>0?"?"+oLink.parameters:"");Frame=oLink.target;if(Frame.length==0){Frame=this.target_default}node=pNode.addChild(NodeID,level,NodeName,NodeChild,"",NodeLink,Frame,Icons,"","",NodeParent,pNode);returnID=this.NavXML(node,level,nodechild,nodeID,NodeID);nodeID=returnID}}if((pNode.childnum!="0"&&pNode.children.length==0)||pNode.childnum==null){pNode.setExecuteQuery(true)}returnID=nodeID;return returnID};this.getNodesChildSQL=function(pNodeID){var idxFieldNodeParent=this.datasource.getFldIdx(this.field_NodeParent);var Nodes=new Array();var i=0;while(i<this.datasource.nRecs&&this.datasource.Data[i][idxFieldNodeParent]!=pNodeID){i++}while(i<this.datasource.nRecs&&this.datasource.Data[i][idxFieldNodeParent]==pNodeID){Nodes.push(this.datasource.Data[i]);i++}return Nodes};this.NavSQL=function(pNode,pLevel){var level=pLevel;var IconsArray,IconsOver;var node,NodeID,NodeName,NodeChild,NodeSeq,NodeParent,Icons,Expr,ExprNot,Frame,NodeLink;var idxFieldNodeID=this.datasource.getFldIdx(this.field_NodeID);var idxFieldNodeName=this.datasource.getFldIdx(this.field_NodeDescr);var idxFieldChildNum=this.datasource.getFldIdx(this.field_ChildCount);var idxFieldNodeSeq=this.datasource.getFldIdx(this.field_NodeSeq);var idxFieldNodeParent=this.datasource.getFldIdx(this.field_NodeParent);var idxFieldIcons=this.datasource.getFldIdx(this.field_Icons);var idxFieldExpr=this.datasource.getFldIdx(this.field_Expr);var idxFieldExprNot=this.datasource.getFldIdx(this.field_ExprNot);var idxFieldFrame=this.datasource.getFldIdx(this.field_Frame);var idxFieldNodeLink=this.datasource.getFldIdx(this.field_NodeLink);var NodesChild=this.getNodesChildSQL(pNode.nodeid);for(var i=0;i<NodesChild.length;i++){if(i==0){level++}NodeID=Trim(NodesChild[i][idxFieldNodeID]);NodeName=Trim(NodesChild[i][idxFieldNodeName]);if(idxFieldChildNum!=-1){NodeChild=Trim(NodesChild[i][idxFieldChildNum])}NodeSeq=Trim(NodesChild[i][idxFieldNodeSeq]);NodeParent=Trim(NodesChild[i][idxFieldNodeParent]);IconsArray=Trim(NodesChild[i][idxFieldIcons]).split("|");if(IconsArray[0]!=""){Icons=LRTrim(IconsArray[0])}else{Icons=""}if(IconsArray[1]!=""){IconsOver=LRTrim(IconsArray[1])}else{IconsOver=""}Expr=Trim(NodesChild[i][idxFieldExpr]);ExprNot=Trim(NodesChild[i][idxFieldExprNot]);Frame=Trim(NodesChild[i][idxFieldFrame]);if(Frame.length==0){Frame=this.target_default}NodeLink=Trim(NodesChild[i][idxFieldNodeLink]);node=pNode.addChild(NodeID,level,NodeName,NodeChild,NodeSeq,NodeLink,Frame,Icons,IconsOver,Expr,ExprNot,NodeParent,pNode);this.NavSQL(node,level)}if((pNode.childnum!="0"&&pNode.children.length==0)||pNode.childnum==null){pNode.setExecuteQuery(true)}};this.FillData=function(data){this.datasource=data;var root=(this.querynode!=null?this.querynode:this.Tree.getRoot());if(typeof(this.datasource.Data)!="undefined"){this.NavSQL(root,root.level)}else{var xmlDoc=this.datasource.xmlDoc;var nodeXMLRoot=xmlDoc.documentElement.selectSingleNode(this.datasource.root);this.Tree.descr=getTagValue(nodeXMLRoot,this.field_NodeDescr);this.NavXML(root,root.level,nodeXMLRoot,0,-1)}if(this.querynode==null){this.Tree.render()}else{if(this.querynode.nodeid==this.Tree.currentnode.nodeid){this.querynode.view()}}};this.setRowsCols=function(NodeID,ChildCount,NodeDescr,NodeSeq,NodeParent,Icons,Expr,ExprNot,Frame,NodeLink){this.field_NodeID=NodeID;this.field_ChildCount=ChildCount;this.field_NodeDescr=NodeDescr;this.field_NodeSeq=NodeSeq;this.field_NodeParent=NodeParent;this.field_Icons=Icons;this.field_Expr=Expr;this.field_ExprNot=ExprNot;this.field_Frame=Frame;this.field_NodeLink=NodeLink};this.addParmConsumer=function(ctrl){this.paramconsumers[this.paramconsumers.length]=ctrl};this.addDataConsumer=function(ctrl,fld){this.dataconsumers[this.dataconsumers.length]=new Array(ctrl,fld)};this.FindNodeByID=function(nodeid){var tmpnode,i;for(i=0;i<this.Tree.allnodes.length;i++){tmpnode=this.Tree.allnodes[i];if(tmpnode!=null&&tmpnode.nodeid==nodeid){return tmpnode}}return null};this.getParam=function(fld){if(typeof(this.Tree.currentnode)!="undefined"){if(fld==this.field_NodeID){return this.Tree.currentnode.nodeid}else{if(fld==this.field_NodeDescr){return this.Tree.currentnode.descr}else{return""}}}return""};this.Tree=new this.tree(this);this.Ctrl_mousedown=function(e){if(typeof(e)=="undefined"){e=window.event}try{if(navigator.userAgent.toLowerCase().indexOf("gecko")!=-1){el=e.target}else{el=e.srcElement}}catch(e){}try{if(el.id.indexOf(name)==-1){this.over=false;this.deselect_all(true)}}catch(e){}};this.addObserver("Ctrl",this);this.form.Ctrl.onmousedown=new Function("e",this.form.formid+"."+this.name+'.dispatchEvent("mousedown",e)')};ZtVWeb.MenuViewCtrl.prototype=new ZtVWeb.StdControl;function ItemLink(d){this.link="";this.target="";this.parameters="";var a=d.split("?");if(a.length>0){this.link=a[0]}if(a.length>1){var c=a[1].split("&");for(var b=0;b<c.length;b++){if(c[b].indexOf("target=")>=0){this.target=c[b].substr(7)}else{this.parameters+=(this.parameters.length==0?"":"&")+c[b]}}}}function getTagValue(a,b){try{return LRTrim(a.selectSingleNode(b).firstChild.nodeValue)}catch(c){return""}};
