if(typeof shStatus=="undefined"){var shStatus={};shStatus.hPrintr={};shStatus.timeout={display:1E4,render:200,fade:500};shStatus.classes={};shStatus.oPage=null;shStatus.oCntr=null;shStatus.debug={cntr:null,elements:null};shStatus.elements=[];shStatus.messages=[];shStatus.is_rendering=0;shStatus.empty_count=0;shStatus.render_timeout=null;shStatus.overlay=[]}
shStatus.repos=function(){if(this.oCntr){var a=bfCss.getCss(".status_position","vertical-align")||"bottom",b=bfCss.getCss(".status_position","text-align")||"right";this.oCntr.style.left=b=="left"?"0px":"";this.oCntr.style.right=b=="right"?"0px":"";this.oCntr.style.top=a=="top"?"0px":"";this.oCntr.style.bottom=a=="bottom"?"0px":"";if(b=="center"){a=$(window).width();b=$(this.oCntr).outerWidth();this.oCntr.style.left=Math.round((a-b)/2)+"px"}}};
shStatus.init=function(){this.oPage=document.body;var a=bfPage.createElement("div",{className:"",style:{width:"35%",position:"fixed",zIndex:"99"}});this.oPage.appendChild(a);this.oCntr=a;this.repos();for(var b in _init_status){a=_init_status[b];this.add(a.typ,a.msg)}_init_status=undefined};
shStatus.add=function(a,b,e,g,c){g=typeof g=="undefined"?null:g;c=typeof c=="undefined"?null:c;var f=0,h="";if(a=="ok")f=1;if(typeof b=="string"){for(;h=b.match(/\$[a-zA-Z-0-9\._-]+/);){var d=String(h);if(typeof e=="object"&&typeof e[d.substr(1)]!="undefined")b=b.replace(h,bfModules.getFldDscr(sActDialog,e[d.substr(1)],"frm"));else if(d.substr(1,4)=="tab."){d=d.split(".");d=String(d[1]);b=b.replace(h,bfModules.getFldDscr(sActDialog,d,"tab"))}else{f="";if(c!=null)f=bfModules.getFldDscr(sActDialog,
c+"."+d.substr(1),"frm");if(f.length==0||c!=null&&f==c+"."+d.substr(1))f=bfModules.getFldDscr(sActDialog,d.substr(1),"frm");b=b.replace(h,f)}f=1}this.messages.push({typ:a,msg:b,auto_hide:f,lang:g});this.is_rendering||this.render()}else{a=0;for(d in shStatus.hPrintr)if(parseInt(d)>=a)a=parseInt(d)+1;shStatus.hPrintr[a]=b;b=bfPage.createTbl({className:"table_plain status_notice",cols:2,width:["50%","50%"],style:{width:"100%"},fixed_layout:1,tpl_rows:1});b.className="table_plain status_notice smallfont";
b.id="status_printr_"+a;this.debug.cntr==null&&this.initDebug();this.debug.elements.style.display="";this.debug.elements.appendChild(b);b.tHead.rows[1].cells[0].className="autocut";b.tHead.rows[1].cells[1].className="autocut";shStatus.addPrintrTree(a)}};
shStatus.render=function(){this.is_rendering=1;if(this.messages.length>0){this.renderEntry(this.messages[0]);this.messages.splice(0,1);this.empty_count=0}if(this.messages.length==0){this.empty_count++;if(this.empty_count>3){this.is_rendering=0;this.render_timeout=null}else this.render_timeout=setTimeout(shStatus.render.createDelegate(this),this.timeout.render)}else this.render_timeout=setTimeout(shStatus.render.createDelegate(this),this.timeout.render)};
shStatus.renderEntry=function(a){var b=bfPage.createElement("div",{className:"hand",style:{display:"none"}});b.innerHTML="lang"in a&&a.lang!=null?'<table class="table_plain status_'+a.typ+'"><tr><td width="1%" class="td_left_padding"><img src="'+_iconset+"lang/"+a.lang+'.png"></td><td width="98%" class="smallfont status_td">'+a.msg+'</td><td width="1%"><img src="'+_scheme+"../pix/main/status_del_"+a.typ+'.gif" class="ico16"></td></tr></table>':'<table class="table_plain status_'+a.typ+'"><tr><td width="99%" class="smallfont status_td">'+
a.msg+'</td><td width="1%"><img src="'+_scheme+"../pix/main/status_del_"+a.typ+'.gif" class="ico16"></td></tr></table>';this.oCntr.appendChild(b);if(this.timeout.fade)$(b).fadeIn(this.timeout.fade,"swing");else b.style.display="";jsHelper.setEvent(b,"onclick","shStatus.removeEntry(this)");a.auto_hide&&setTimeout(shStatus.removeEntry.createDelegate(this,[b]),this.timeout.display)};
shStatus.removeEntry=function(a){if("parentNode"in a&&a.parentNode&&a.className.indexOf("_fade_out")<0){jsHelper.setClass(a,1,"_fade_out");$(a).fadeOut(this.timeout.fade,"swing",function(){a.parentNode.removeChild(a)})}};shStatus.reset=function(){if(this.render_timeout!=null){clearTimeout(this.render_timeout);this.is_rendering=0;this.messages=[]}for(var a=0;a<this.oCntr.childNodes.length;a++)this.removeEntry(this.oCntr.childNodes[a])};shStatus.addPrintr=function(a){shStatus.add("notice",a)};
shStatus.addPrintrTree=function(a,b,e,g){b=b||"";e=e||"";g=g||null;var c=jsHelper.getObj("shStatus||hPrintr||"+a+e,"||"),f=jsHelper.getTBody(document.getElementById("status_printr_"+a)),h=$(".selTpl",f.parentNode)[0].cloneNode(true);if(f.childNodes.length==0){bfPage.tblFixedLayout("status_printr_"+a);shTree.sActTbl="status_printr_"+a;shTree.setData("bNoRecycle",1);shTree.setData("bNoSession",1)}for(var d in c){var j=h.cloneNode(true);jsHelper.setClass(j,0,"selTpl");j.style.display="";var n=(b.length>
0?b:"/status_sprintr_"+a+"/")+d.replace(/\//g,"_")+"/";j.id=n;if(typeof c[d]=="object"&&c[d]!=null&&typeof c[d].length!="undefined")var i=d,k="",l=c[d].length>0?1:0,m="obj/dtyp_array.gif";else if(typeof c[d]=="object"&&c[d]!=null){i=d;k="";l=!jsHelper.objIsEmpty(c[d])?1:0;m="obj/dtyp_hash.gif"}else{i=d;k=c[d]!=null?c[d].toString().replace(/</g,"&lt;"):"null";l=0;m="obj/entry"+(c[d]!=null?"":"_red")+".gif"}i={new_row:j,tbody:f,parent_path:b.length>0?b:"/",x_ico:m,label:i};if(l)i.fct_load_childs="shStatus.addPrintrTree("+
a+",'"+n+"','"+e.replace(/'/g,"\\'")+"||"+d+"',this)";shTree.rowInsertCmpl(i);j.cells[1].innerHTML=k}b.length>0&&shTree.switchNode(g)};
shStatus.initDebug=function(){this.debug.cntr=bfPage.createElement("div",{style:{width:"45%",position:"fixed",left:"0px",bottom:"0px",zIndex:"99"}});this.oPage.appendChild(this.debug.cntr);this.debug.cntr.innerHTML='<table class="table_plain smallfont bold" style="width:100%"><tr class="tr_td_left_padding status_notice"><td width="99%">Debug</td><td width="1%"><img src="'+_scheme+'../pix/main/status_del_notice.gif" class="ico16 hand" onclick="shStatus.resetDebug()"></td></tr></table>';this.debug.elements=
bfPage.createElement("div",{className:"scroll",style:{width:"100%",height:"300px"}});this.debug.cntr.appendChild(this.debug.elements)};shStatus.resetDebug=function(){for(;this.debug.elements.childNodes.length;)this.debug.elements.removeChild(this.debug.elements.firstChild);this.debug.elements.style.display="none"};
shStatus.resetForm=function(a){a=document[a];for(var b=0;b<a.elements.length;b++)a.elements[b].className.indexOf("_mirl")>=0?jQuery.data(a.elements[b],"mirlObj").markError(0):jsHelper.setClass(a.elements[b],0,"form_error")};shStatus.moveMessages=function(){};
shStatus.reposOverlay=function(a){if("all"in a&&a.all)var b=this.overlay;else{var e="index"in a?a.index:null;if(e==null){var g=a.obj||null;for(a=0;a<this.overlay.length;a++)if(this.overlay[a].obj==g){e=a;break}}if(e!=null)b=[this.overlay[e]]}for(a=0;a<b.length;a++){if(b[a].cntr){e=0;g=Math.round(b[a].cntr.innerHeight()/2)-Math.round(b[a].layer.outerHeight()/2)}else{g=b[a].obj.offset();e=g.left+b[a].obj.outerWidth()-0;g=g.top+Math.round(b[a].obj.outerHeight()/2-b[a].layer.outerHeight()/2)}b[a].layer.css({top:g+
"px",left:e+"px"})}};shStatus.rmvOverlay=function(a){var b="index"in a?a.index:null;if(b==null){a=a.obj||null;if(a.outerHeight)a=a[0];for(var e=0;e<this.overlay.length;e++)if(this.overlay[e].obj[0]==a){b=e;break}}if(b!=null){this.overlay[b].layer.remove();this.overlay.splice(b,1)}};
shStatus.addOverlay=function(a){var b=a.obj||null,e=a.cntr||null,g=a.type||"err";a=a.msg||"";if(b){if(b.nodeName)b=$(b);if(e){if(e.nodeName)e=$(e);var c=e.css("position");c!="relative"&&c!="absolute"&&e.css({position:"relative",top:"0px"})}for(c=0;c<this.overlay.length;c++)if(this.overlay[c].obj==b[0]){this.rmvOverlay({index:c});break}c=$(bfPage.createElement("div",{style:{position:"absolute",zIndex:"99",width:"300px"}}));c.appendTo(e?e:document.body);var f=bfPage.createTbl({add_head:0,rows:1,style:{width:"100%"}});
jsHelper.setClass(f,1,"status_"+g);c.append(f);f=jsHelper.getTBody(f).rows[0].cells[0];jsHelper.setClass(f,1,["smallfont","status_td"]);f.innerHTML=a;f=$(bfPage.createElement("div",{className:"status_"+g,style:{position:"absolute",width:"14px",height:"14px"}}));f.css({"border-top-style":"none","border-right-style":"none","-moz-transform":"rotate(45deg)","-o-transform":"rotate(45deg)","-webkit-transform":"rotate(45deg)","-ms-transform":"rotate(45deg)",transform:"rotate(45deg)",filter:"progid:DXImageTransform.Microsoft.Matrix(M11=0.7071067811865476, M12=-0.7071067811865475, M21=0.7071067811865475, M22=0.7071067811865476, sizingMethod='auto expand')",
zoom:"1"});c.append(f);var h=Math.round(c.outerHeight()/2)-Math.round(f.innerHeight()/2),d=-Math.round(f.innerWidth()/2);f.css({top:h+"px",left:d+"px"});this.overlay.push({obj:b,type:g,msg:a,layer:c,cntr:e});this.reposOverlay({index:this.overlay.length-1})}};

