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()}}},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}};
