var DMASKid='DMASK'; function fn_unescape(s){ s = s.replace(/%22/g,"\"").replace(/%25/g,"%").replace(/%20/g," ").replace(/%21/g,"!").replace(/%23/g,"#").replace(/%24/g,"$"); s = s.replace(/%26/g,"&").replace(/%27/g,"'").replace(/%28/g,"(").replace(/%29/g,")").replace(/%2C/g,",").replace(/%2F/g,"/"); s = s.replace(/%3A/g,":").replace(/%3B/g,";").replace(/%3C/g,"<").replace(/%3D/g,"=").replace(/%3E/g,">").replace(/%3F/g,"?"); s = s.replace(/%5B/g,"[").replace(/%5C/g,"\\").replace(/%5D/g,"]").replace(/%5E/g,"^").replace(/%60/g,"`").replace(/%0D%0A/g,"\n").replace(/"/g,"\""); return s; } function fn_escape(s){ var rez = '', si = '', dSI; for(var i=0; i0x400){ if((dSI>=0x410)&&(dSI<=0x44F)){si=String.fromCharCode(dSI-0x350)} if(dSI==0x401){si=String.fromCharCode(0xA8)} if(dSI==0x451){si=String.fromCharCode(0xB8)} if(dSI==0x2116){si=String.fromCharCode(0xB9)} } if(dSI==0x2B)si='%2B'; // + if(dSI==0x24)si='%24'; // $ if(dSI==0x2F)si='%2F'; // / if(si.length==1)si=(/[^$A-Za-z0-9]/.test(si))?escape(si):si; rez += si; } return(rez); } function getTrim(STR){if(STR!=null)return STR.replace(/(^\s*)|(\s*$)/g, "");} function DoScrollForm(w){if(isIE)window.document.body.scrollTop=0;} function getSelectParam(Obj,P){ try{s=Obj.options[Obj.selectedIndex].getAttribute(P)}catch(e){s=""} if(!s)s=''; return(s); } function BSDate2UTCDate(sDate){ if((sDate=='')||(sDate.length!=10)||(sDate.substr(2,1)!='.')||(sDate.substr(5,1)!='.'))return ''; return sDate.substr(6,4) + '-' + sDate.substr(3,2) + '-' + sDate.substr(0,2); } function fngetDate(sD){ var d = new Date(),re=new RegExp('^(\\d{4}).(\\d{2}).(\\d{2})$','ig'); var s=re.exec(sD); if(s)d.setFullYear(s[1],s[2],s[3]); return d.valueOf() } function setCLN(w,o,cn){ try{ var ar=$(w,o.id); var iL=(ar.length)?ar.length:0; }catch(e){iL=0} if(iL==0){ o.className=cn; return; } for(i=0;i0 && i%3==0)r=' '+r; r=x.charAt(sA.length-1-i)+r; } return r=(r=='')?' ':r+sR; } //**** function fn_hide_block(w,b,obj){ try{ var xName=((!obj)||(obj==''))?'FormTarget':obj; var oF=$(window,xName); oF.style.display=b?'block':'none'; }catch(e){} } function RollFilter(w,f){ try{ var sN='none',sB='block',oF=window.document.all.FilterForm; if (oF.length > 0){ var i=oF.length, sDsp=oF[i-1].style.display; var xv=f?((f=='1')?sB:sN):(((sDsp==sB)||(sDsp==''))?sN:sB); oF[i-1].style.display=xv; window.document.all.FHImg[i-1].src='../img/ico/b-'+((xv==sB)?'max':'min')+'.gif'; try{eval('_filter_'+$(window,'SCHEMENAME').value+'_'+((window.IsForm)?$(window,'FORMACTION').value:$(window,'FILTERIDENT').value)+'="'+xv+'"')}catch(e){} } else { var sDsp=oF.style.display; var xv=f?((f=='1')?sB:sN):(((sDsp==sB)||(sDsp==''))?sN:sB); oF.style.display=xv; window.document.all.FHImg.src='../img/ico/b-'+((xv==sB)?'max':'min')+'.gif'; try{eval('_filter_'+$(window,'SCHEMENAME').value+'_'+((window.IsForm)?$(window,'FORMACTION').value:$(window,'FILTERIDENT').value)+'="'+xv+'"')}catch(e){} } }catch(e){} } function fnOpenFilter(w,o,b){ try{ var oT=window.document.all.FilterTbl,sDf=oT.getAttribute('DOpen'),sO; if(sDf=='2')return; try{sO=eval('_filter_'+$(window,'SCHEMENAME').value+'_'+((w.IsForm)?$(window,'FORMACTION').value:$(window,'FILTERIDENT').value));}catch(e){sO=null} var _b=(!sO)?(sDf=='1'):(sO=='block'); RollFilter(w,(_b?'1':'0')); }catch(e){} } //************************** function DSBForm(w,_b,zIndex){ var od, l; try{od=window.document.getElementById(DMASKid)}catch(e){} // try{ if(!od){ od = window.document.createElement('DIV'); od.style.display = 'none'; od.id=DMASKid; try{od.style.MozOpacity=0.4}catch(e){} try{od.style.KHTMLOpacity=0.4}catch(e){} try{od.style.opacity=0.4}catch(e){} try{ var oS = window.document.createStyleSheet(), oP = window.document.createStyleSheet(); oS.media = "screen";oS.addRule('#DMASK','background-color:#CCCCCC;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=40);'); oP.media = "print"; oP.addRule('#DMASK','display:none;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0,enabled=0);'); }catch(e){} od.style.backgroundColor="#CCCCCC"; od.style.position='absolute'; od.style.top=0;od.style.left=0; od.style.zIndex =1000; od.style.width="100%"; od.style.height="100%"; od.innerHTML=' '; window.document.body.appendChild(od); }else{ if (zIndex!=null && zIndex!='') od.style.zIndex = zIndex; else od.style.zIndex = 1000; l = ((window.innerHeight)?window.innerHeight:window.document.body.clientHeight); if (window.scrollMaxY) { l = l + window.scrollMaxY;} else if(window.document.body.scrollHeight > window.document.body.offsetHeight) { l = window.document.body.scrollHeight;} else { l = window.document.body.offsetHeight;} od.style.height=l; } od.style.display=_b?'block':'none'; if(isIE)hideSelects(w.document,_b) window.Disabled=_b; // }catch(e){} } function hideSelects(w,_b){ try{ var Ar=w.getElementsByTagName('SELECT'),el; for(var i=0;i'+st+'') else{ _or.style.display=_b?'inline':'none'; try{if(_b)_or.innerHTML=st;}catch(e){} } } }catch(e){} } function _DSElement(w,el,_b){ switch(el.type){ case 'text':;case 'password':;case 'textarea':; SetElClass(w,el,'-ro',!_b); EnableInpEvents(w,el,_b); el.readOnly=_b; break; default: el.disabled=_b; break; } } function _Focus(w,x){ try{el = $(w,x);if(el)el.focus();}catch(e){} } function _attachEvents(w){ var OW=(isIE || IsOpera)?window.document.body:window; var sw=(isIE?"this.window":"w"), res="try{fn_msg_position("+sw+");ClickHideClnd("+sw+");}catch(e){}"; if(isIE){ OW.onresize=new Function(res); OW.onscroll=new Function(res); }else{ with(w){ OW.onresize=new Function(res); OW.onscroll=new Function(res); } } if(!window.IsDict && !window.IsVIEW) with(w){OW.onmousedown=new Function("try{ClickHideListDictionary(window,((isIE || IsOpera)?window.event:Event));}catch(e){} try{ClickHideClnd(window,((isIE || IsOpera)?window.event:Event))}catch(e){}");} } function InitFormFiles(w){ window.FormHasAttachment=true; window.sFN='FILE_NAME_'; window.pN; window.iFiles=0; window.xT=window.document.all.tFiles; window.xTB=window.xT.tBodies[0]; window.ofc=window.document.all.ItemsContainedUploadFiles; var f=window.document.all._FR; if(!window.oFR){ window.oFR=f.cloneNode(true); f.style.display='none'; } } function fillFileForView(w,b){ var xO=window.document.getElementsByName('RO_FN'),xOI,oP; for(var i=1;i1) Arr=getChildren(oR,level-1,n); return Arr; } try{ if (window.document.getElementById("BANNER").innerHTML!=''){ oBnr=window.document.getElementById("BANNER").firstChild; bnst=oBnr.getAttribute("status"); SRC=oBnr.getAttribute("S"); Ref=oBnr.getAttribute("R"); oTarget=window.document.getElementById("FormTarget").getElementsByTagName("TABLE").item(0) switch (bnst){ case '1': oR=oTarget.insertRow(0);//вверху str='top'; break; case '2':str='right';case '3': if (str=='') str='left'; y=window.document.getElementById("FormTarget").offsetHeight;// высота ДО вставки банера var oH=oTarget.insertRow(-1);//внизу вспомогательный ряд для выравнивания формы по верху банера var Arr=getChildren(oTarget,2) oR=Arr[0]; n=Arr[1]; // oR - ряд, куда вставляем банер b=true; break; case '4': oR=oTarget.insertRow(-1);//внизу str='bottom'; } k=(bnst=='2')?-1:0;//справа, слева oC=oR.insertCell(k); if (bnst=='2'||bnst=='3'){oC.setAttribute("rowSpan",n)} if (Ref!='') {//ссылка для открытия в новом окне oA=window.document.createElement("A"); oA.setAttribute("href",Ref); oA.setAttribute("target","_blank"); oA.appendChild(oBnr); } else {oA=oBnr;} oC.appendChild(oA); eval("oC.className='banner_"+str+"';"); oBnr.setAttribute("border","0"); oBnr.setAttribute("src",SRC); if (b){ function setDiff(){ if (window.bCnt>5) return;//не больше 5 попыток ожидания загрузки банера window.bCnt++; if (oBnr.readyState=='complete'||typeof(oBnr.readyState)=='undefined'){ var z=oBnr.clientHeight,x; x=z-y;//разница высоты банера и формы window.x2=x; if (x>0) { oHC=oH.insertCell(0);//если банер больше добавляем снизу ячейку соотв высоты oH.setAttribute("height",x); if (!isIE) oHC.outerHTML=' '; }else {if (window.x1!=window.x2){window.x1=window.x2;window.setTimeout(setDiff,100);}} } } window.bCnt=1;window.x1=0;window.x2=0; if (typeof(oBnr.onreadystatechange)=='object') {oBnr.onreadystatechange=setDiff;} else {window.setTimeout(setDiff,100);} } } }catch(e){} } function fn_alert(w,x,t,oFocus){ if(getTrim(x)=='')return; MessageBoxObject.alert(transformMsg(w,x,t),LRSMLCaption,oFocus); } var gWaitInfoID = 'WaitInfo'; function fn_wait(w,xMsg){ this.doPosition=function(){ with($(w,gWaitInfoID).style){ left=((window.innerWidth)?window.innerWidth:window.document.body.clientWidth)/2-$(w,gWaitInfoID).offsetWidth/2+window.document.body.scrollLeft; top=((window.innerHeight)?window.innerHeight:window.document.body.clientHeight)/2+window.document.body.scrollTop-$(w,gWaitInfoID).offsetHeight/2; } } if(!$(w,gWaitInfoID)){ var oWaitDiv=window.document.createElement('DIV'); oWaitDiv.style.display='none'; oWaitDiv.id = gWaitInfoID; window.document.body.appendChild(oWaitDiv); } if(!xMsg)xMsg=WAITLRS; $(w,gWaitInfoID).innerHTML = xMsg ? (''+xMsg) : ' '; this.doPosition(); $(w,gWaitInfoID).style.display='block'; this.doPosition(); } function wait_hide(w){ try{ $(w,gWaitInfoID).style.display='none'; }catch(e){} } function transformMsg(w,x,t){ var xs=''; if(x != null){ x=x.replace(/\r/g,'').replace(/\n/g,' ').replace(/\[BR\]/g,'
'); var Ar=x.split('[NL]'),el; for(var i=0;i'; el=el.replace(/(^\d{1,2})(\|)(.*)/,img+'$3').replace(/(^.{1})(.*)(.{1}$)/,'$1$2$3'); if(el.match(/\'; } return(xs); } function jsTableSort(el){ var col_sort = el.innerHTML; var tn = el.tagName; var tr = el.parentNode; var tbl = tr.parentNode; if(tbl.tagName != 'TABLE') tbl = tr.parentNode.parentNode; if(tbl.tagName != 'TABLE') return false; var td, arrow, col_sort_num, tdObj, val, eIMG; for (var i=0; (td = tr.getElementsByTagName(tn).item(i)); i++){ if (td.innerHTML == col_sort){ col_sort_num = i; if (td.getAttribute('sort') == "y"){ arrow = $(w,'AuthSortLnk'); el.up = Number(!el.up); }else{ td.setAttribute('sort','y'); eIMG = document.createElement("img"); eIMG.id = 'AuthSortLnk'; arrow = td.appendChild(eIMG); el.up = 0; td.className = 'SORTLNK'; } arrow.src = "../img/ico/desc"+(el.up ? "true.gif":"false.gif"); }else{ if (td.getAttribute('sort') == "y"){ td.setAttribute('sort','n'); if ($(w,'AuthSortLnk')) td.removeChild($(w,'AuthSortLnk')); } } } var array = new Array(); for(var i=1, l=tbl.rows.length; i