include("lib.prototype");if(!modularjs.loaded["lib.onload"]){__onload__=false;addOnLoad=function(a){if(__onload__){a()}else{document.observe("dom:loaded",a)}};addOnLoad(function(){__onload__=true})}modularjs.loaded["lib.onload"]=true;var Flow={show:function(){setTimeout(function(){Flow.showDiagram(data[0],100)},100);setTimeout(Flow.showData,500)},showDiagram:function(d,h){var b=$("data");var g=d.processId;var e=d.activities;b.update(new Element("img",{id:"_iFlow"+h}));if(h==100){self["parent"+h]=d;self["level"+h]=h}if(d.image){$("_iFlow"+h).src="data:image/png;base64,"+d.image}else{$("_iFlow"+h).src="img/proc/img_disco/flow/"+g+".png"}self.parentProcess=d;var f=h+100;for(var a=0;a100){b.innerHTML+='
'}if(e[a].processId){b.innerHTML+='
'}else{b.innerHTML+='
'}}top.properties=d.properties[0];top.pid=g;self.clheight=b.offsetHeight+210;top.userinfo=d.userinfo[0]},showLevel:function(d,b){if(b){d=self["level"+d]}var a=self["parent"+d];Flow.showDiagram(a,d)},openDialog:function(){if(self.w){self.w.close()}w=window.open("frames.html","flowvars","width=1024,height=768,location=0,status=0,scrollbars=1,resizable=0");w.properties=top.properties;w.pid=top.pid},showData:function(){for(k in top.userinfo){v=top.userinfo[k][0];Flow.showTable(v,k=="ar0"?"varF1":"varF")}},showTable:function(a,b){$(b).insert(Flow.showArray(a))},prepareCell:function(b,a,e){var d=new Element(a||"td").update(b.replace(/_/g," "));if(e){d.colSpan=e;d.align="center"}return d},prepareImg:function(a,b){td=new Element("td",{align:"center",className:"img"});if(b){td.rowSpan=b}if(a){td.insert(new Element("img",{src:a,border:0}))}return td},showArray:function(a){var h=new Element("div");var e=new Element("table",{className:"tab"});h.insert(e);var b=new Element("tbody");e.insert(b);for(k in a){var f=new Element("tr",{className:"ti"});b.insert(f);f.insert(Flow.prepareCell(k,null,3));var g=a[k];c=0;for(i in g){if(g[i]==""){continue}c++;var d=new Element("tr",{className:c%2?"alt2":"alt"});if(c==1&&k.indexOf("Transaccion_Actual")==0){tdimg=Flow.prepareImg(Flow.getIconToShow(g.Respuesta));tdimg.rowSpan="100";d.insert(tdimg)}d.insert(Flow.prepareCell(i));d.insert(Flow.prepareCell(g[i]));if(c==1&&k.indexOf("Transaccion_Realizada")==0){tdimg=Flow.prepareImg(Flow.getIconToShow(g.Respuesta));tdimg.rowSpan="100";d.insert(tdimg)}b.insert(d)}}return h},getIconToShow:function(a){if(a=="OK"){return"img/bpm/ok.png"}else{if(a=="NO"){return"img/bpm/deny.png"}else{return"img/bpm/wait.png"}}}};addOnLoad(Flow.show);