dClasses={Box:function(B,A){this.id=B;this.div=null;this.getLeft=function(){return Position.get(this.div).left};this.getTop=function(){return Position.get(this.div).top};this.getWidth=function(){return Position.get(this.div).width};this.getHeight=function(){return Position.get(this.div).height};this.create=function(D){var C=document.createElement("DIV");C.id=this.id;if(D.left){C.style.left=D.left+"px"}if(D.top){C.style.top=D.top+"px"}if(D.width){C.style.width=D.width+"px"}if(D.height){C.style.height=D.height+"px"}if(D.zIndex){C.style.zIndex=D.zIndex}if(D.position){C.style.position=D.position}if(D.backgroundColor){C.style.backgroundColor=D.backgroundColor}if(D.border){C.style.border=D.border}C.style.display="none";this.div=document.body.appendChild(C);if(D.opacity){setOpacity(this.id,D.opacity)}};this.create(A);this.div.tagg=this;this.show=function(){this.div.style.display=""};this.hide=function(){this.div.style.display="none"};this.setPosition=function(D,C){this.div.style.left=D;this.div.style.top=C};this.setToCenterOfScreen=function(){this.setPosition("50%","50%");this.div.style.marginLeft="-"+String(Math.round(Position.get(this.div).width/2))+"px";this.div.style.marginTop="-"+String(Math.round(Position.get(this.div).height/2))+"px"};this.setToCenterOfScreenFixed=function(){if(!Browser.isIE){this.div.style.position="fixed";this.setToCenterOfScreen()}else{this.div.style.position="fixed";this.setToCenterOfScreen()}}},Window:function(D,C,B,A){this.title=C;dClasses.Box.call(this,D,A);this.overlayed=false;if(A.overlayed){this.overlayed=A.overlayed}this.createTitle=function(){var E=document.createElement("DIV");E.id=this.id+"_title";E.style.color=A.titleColor;E.style.backgroundColor=A.titleBackgroundColor;E.style.height="26px";E.style.fontWeight="bold";E.style.width="100%";E.tagg=this;this.title_=E;E.innerHTML='<table width="100%" border="0" style="background-color:'+A.titleBackgroundColor+"; color:"+A.titleColor+';"><tr><td><div style="padding-top: 3px; padding-left: 6px;"><b id="'+this.id+'_titleText">'+C+'</b></div></td><td style="text-align: right;"><img title="Закрыть" alt="Закрыть" src="/img/bCloseWin.gif" id="'+this.id+'_imgClose"/></td></tr></table>';this.div.appendChild(E);$(this.id+"_imgClose").tagg=this;this.imgClose=$(this.id+"_imgClose");$(this.id+"_imgClose").onclick=function(){this.tagg.hide()};$(this.id+"_imgClose").onmouseover=function(){this.src="/img/bCloseWinUP.gif"};$(this.id+"_imgClose").onmouseout=function(){this.src="/img/bCloseWin.gif"}};this.createBody=function(){var E=document.createElement("DIV");E.id=this.id+"_body";E.style.padding="12px";E.innerHTML=B;E.tagg=this;this.body=E;this.div.appendChild(E)};this.createTitle();this.createBody();this.div.style.padding="1px";this.Box_show=this.show;this.show=function(){if(this.overlayed){overlayer.show(this.div.style.zIndex-1)}this.Box_show()};this.Box_hide=this.hide;this.hide=function(){this.Box_hide();if(this.overlayed){overlayer.hide()}};this.setTitle=function(E){$(this.id+"_titleText").innerHTML=E;this.title=E};this.setBody=function(E){$(this.id+"_body").innerHTML=E};this.setTitle(C)},dialogWindow:function(D,C,B,A){if(A){if(!A.zIndex){A.zIndex=overlayer.getMAXLayer()+10}if(!A.position){A.position="absolute"}if(!A.overlayed){A.overlayed=true}if(!A.backgroundColor){A.backgroundColor="white"}if(!A.border){A.border="1px #10638B solid"}if(!A.titleColor){A.titleColor="white"}if(!A.titleBackgroundColor){A.titleBackgroundColor="#10638B"}}dClasses.Window.call(this,D,C,B,A);this.focusOn_bClose=true;if(A.focusOn_bClose===false){this.focusOn_bClose=false}this.appendButton=function(){var F=document.createElement("DIV");F.style.textAlign="center";F.style.paddingTop="20px";var E=document.createElement("BUTTON");E.id=this.id+"_bClose";E.innerHTML="Закрыть";E.tagg=this;E.onclick=function(){this.tagg.hide()};F.appendChild(E);this.body.appendChild(F);this.bClose=E};this.appendButton();this.Window_show=this.show;this.show=function(){this.div.style.zIndex=overlayer.getMAXLayer()+10;this.Window_show();if(Browser.isIE){this.setToCenterOfScreen()}else{this.setToCenterOfScreenFixed()}this.div.style.top="40%";if(this.focusOn_bClose===true){this.bClose.focus()}}},dialogWindow_HTMLSave:function(E,D,C){var B='<b>HTML-код:</b><br><textarea id="textarea_'+E+'" style="width:100%; height:400px"></textarea>';dClasses.dialogWindow.call(this,E,D,B,C);try{$$("#"+E+"_bClose").before('<button id="bSave_'+E+'">Сохранить</button>&nbsp;&nbsp;&nbsp;');$$("#"+E).draggable();$$("#"+E).resizable()}catch(A){alert("По всей видимости не подключен jQuery UI.")}g($("bSave_"+E),"keydown",function(G){var F=G||window.event;if(F.keyCode==27){$(E+"_bClose").click()}});this.dialogWindow_show=this.show;this.show=function(F){if(!F){F=""}$("textarea_"+E).value=F;this.dialogWindow_show();$("textarea_"+E).focus()}},quickSearchPanelClass:function(id,input_id,ajax_url,respondent,params){this.c=function(a){return document.createElement(a)};this.id=id;this.input_id=input_id;this.input=$(this.input_id);this.ajax_url=ajax_url;this.respondent=respondent;this.div={};this.div.obj=null;this.input.qSearchPanel=this;this.params={};if(!params){this.params.width="auto";this.params.bclose=true;this.params.animated=true}else{if(params.width){this.params.width=params.width+"px"}if(params.bclose){this.params.bclose=params.bclose}if(params.animated){this.params.animated=params.animated}}var a=this.c("div");a.id=this.id;with(a.style){position="absolute";zIndex=overlayer.getMAXLayer()+10;left=Position.get(this.input).left+"px";top=Position.get(this.input).top+Position.get(this.input).height+"px";display="none";border="1px #222222 solid";padding="6px 10px";backgroundColor="#FFFFDD"}document.body.appendChild(a);this.div=$(a.id);this.div.obj=this;this.show=function(){with(this.div.style){display="";zIndex=overlayer.getMAXLayer()+10;left=Position.get(this.input).left+"px";top=Position.get(this.input).top+Position.get(this.input).height+"px"}};this.hide=function(){this.div.style.display="none"};this.clear=function(){if(this.params.bclose==true){this.div.innerHTML='<img src="/images/bCloseSmall.png" style="position:absolute; right:5px; cursor:pointer" title="Закрыть" onclick="var o=$(\''+this.id+"').obj; o.hide(); o.input.focus()\" />"}else{this.div.innerHTML=""}};this.startAnimation=function(){this.input.style.background="url(/images/bgProcess.gif) repeat top left"};this.stopAnimation=function(){this.input.style.background=""};this.loaded=function(){if(this.params.animated){this.stopAnimation()}};this.div.style.width=this.params.width;g(this.input,"keyup",function(e){var ev=e||window.event;if(ev.keyCode==27){return}var div=this.qSearchPanel;if(Browser.isIE){e=window.event}var search_str=this.value;if(search_str!=""){if(div.params.animated){div.startAnimation()}jxs.ax(div.ajax_url+"?s="+escape2(search_str)+"&mode=sub",div.respondent,true)}else{div.clear();div.hide()}});var o=this;g(this.input,"keydown",function(e){var ev=e||window.event;if(ev.keyCode==27){o.hide()}})}};function getWindowSize(){var D="sdflkw4523lksdfk";var A=document.createElement("div");A.id=D;A.style.position="absolute";A.style.width="0px";A.style.height="0px";A.style.left="50%";A.style.top="50%";document.body.appendChild(A);var C=$(D);var B={left:0,top:0};B.left=Position.get(C).left;B.top=Position.get(C).top;document.body.removeChild(A);return{width:B.left*2,height:B.top*2}};