(function(){function jsQwerlib(){}jsQwerlib.VERSION="0.1a";jsQwerlib.TYPE_LOGIN_MAXLENGTH=10;jsQwerlib.TYPE_LOGIN_MINLENGTH=2;jsQwerlib.TYPE_LOGIN_REGEXP=/^[a-zA-Z0-9]*$/;jsQwerlib.TYPE_PASSWORD_REGEXP=/^[a-zA-Z0-9]*$/;jsQwerlib.TYPE_PASSWORD_MAXLENGTH=25;jsQwerlib.TYPE_PASSWORD_MINLENGTH=5;jsQwerlib.TYPE_FIO_MAXLENGTH=80;jsQwerlib.TYPE_EMAIL_MAXLENGTH=40;jsQwerlib.TYPE_EMAIL_REGEXP=/^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@(([a-zA-Z0-9])+(([a-zA-Z0-9-])*([a-zA-Z0-9])+)*\.)+([a-zA-Z]{2,6})$/;jsQwerlib.TYPE_TEXT_MAXLENGTH=255;jsQwerlib.TYPE_COMMENT_MAXLENGTH=5000;jsQwerlib.TYPE_FULLYEAR_REGEXP=/^[0-9]{4}$/;jsQwerlib.TYPE_NUMBER_REGEXP=/^[0-9]{1,11}$/;jsQwerlib.TYPE_PRICE_REGEXP=/^[0-9]{0,10}([.][0-9]{1,2})?$/;jsQwerlib.TYPE_TEXTSEARCH_MINLENGTH=4;jsQwerlib.TYPE_CAPTCHA_LENGTH=4;jsQwerlib.inputErrorMsgPrefix="Ошибка ввода данных: ";jsQwerlib.__DEBUG__=false;jsQwerlib.DebugWin=function(){};jsQwerlib.DebugWin.winId="jsQwerlib_DebugWin_winId";jsQwerlib.DebugWin.textId="jsQwerlib_DebugWin_textId";jsQwerlib.DebugWin.textContId="jsQwerlib_DebugWin_textContId";jsQwerlib.DebugWin.toolContId="jsQwerlib_DebugWin_toolContId";jsQwerlib.DebugWin.splitterId="jsQwerlib_DebugWin_splitterId";jsQwerlib.DebugWin.bodyId="jsQwerlib_DebugWin_bodyId";jsQwerlib.DebugWin.bodyContId="jsQwerlib_DebugWin_bodyContId";jsQwerlib.DebugWin.testId1="jsQwerlib_DebugWin_testId1";jsQwerlib.DebugWin.testId2="jsQwerlib_DebugWin_testId2";jsQwerlib.DebugWin.captionId="jsQwerlib_DebugWin_captionId";jsQwerlib.DebugWin.borderLId="jsQwerlib_DebugWin_borderLId";jsQwerlib.DebugWin.borderLTId="jsQwerlib_DebugWin_borderLTId";jsQwerlib.DebugWin.borderTId="jsQwerlib_DebugWin_borderTId";jsQwerlib.DebugWin.borderRTId="jsQwerlib_DebugWin_borderRTId";jsQwerlib.DebugWin.borderRId="jsQwerlib_DebugWin_borderRId";jsQwerlib.DebugWin.borderRBId="jsQwerlib_DebugWin_borderRBId";jsQwerlib.DebugWin.borderBId="jsQwerlib_DebugWin_borderBId";jsQwerlib.DebugWin.borderLBId="jsQwerlib_DebugWin_borderLBId";jsQwerlib.DebugWin.win=null;jsQwerlib.DebugWin.text=null;jsQwerlib.DebugWin.cookieTime=365*24*60*60;jsQwerlib.DebugWin.wWidth=500;jsQwerlib.DebugWin.wHeight=200;jsQwerlib.DebugWin.wLeft=jsQwerlib.DebugWin.defaultWLeft=0;jsQwerlib.DebugWin.wTop=jsQwerlib.DebugWin.defaultWTop=0;jsQwerlib.DebugWin.wWidthCookie="jsQwerlib_DebugWin_wWidth";jsQwerlib.DebugWin.wHeightCookie="jsQwerlib_DebugWin_wHeight";jsQwerlib.DebugWin.wLeftCookie="jsQwerlib_DebugWin_wLeft";jsQwerlib.DebugWin.wTopCookie="jsQwerlib_DebugWin_wTop";jsQwerlib.DebugWin.opacity=80;jsQwerlib.DebugWin.opacityCookie="jsQwerlib_DebugWin_opacity";jsQwerlib.DebugWin.fHeight=200;jsQwerlib.DebugWin.fHeightCookie="jsQwerlib_DebugWin_fHeight";jsQwerlib.DebugWin.minWWidth=100;jsQwerlib.DebugWin.minWHeight=50;jsQwerlib.DebugWin.minFHeight=20;jsQwerlib.DebugWin.direction=-1;jsQwerlib.DebugWin.directionCookie="jsQwerlib_DebugWin_direction";jsQwerlib.DebugWin.directionId="jsQwerlib_DebugWin_directionId";jsQwerlib.DebugWin.type=1;jsQwerlib.DebugWin.typeCookie="jsQwerlib_DebugWin_type";jsQwerlib.DebugWin.typeId="jsQwerlib_DebugWin_typeId";jsQwerlib.DebugWin.splitterSize=3;jsQwerlib.DebugWin.splitterColor="#A000A0";jsQwerlib.DebugWin.bodyMargin;jsQwerlib.DebugWin.bodyPadding;jsQwerlib.DebugWin.bodyCursor=null;jsQwerlib.DebugWin.bodyDH;jsQwerlib.DebugWin.mouseCoords;jsQwerlib.DebugWin.moveTarget=null;jsQwerlib.DebugWin.moveCursor=null;jsQwerlib.DebugWin.pageOffset;jsQwerlib.DebugWin.dSize;jsQwerlib.DebugWin.create=function(){if(this.win){return }if(jsQwerlib.getCookie(this.wWidthCookie)){this.wWidth=Number(jsQwerlib.getCookie(this.wWidthCookie))}if(jsQwerlib.getCookie(this.wHeightCookie)){this.wHeight=Number(jsQwerlib.getCookie(this.wHeightCookie))}if(jsQwerlib.getCookie(this.wLeftCookie)){this.wLeft=Number(jsQwerlib.getCookie(this.wLeftCookie))}if(jsQwerlib.getCookie(this.wTopCookie)){this.wTop=Number(jsQwerlib.getCookie(this.wTopCookie))}if(jsQwerlib.getCookie(this.opacityCookie)){this.opacity=Number(jsQwerlib.getCookie(this.opacityCookie))}if(jsQwerlib.getCookie(this.fHeightCookie)){this.fHeight=Number(jsQwerlib.getCookie(this.fHeightCookie))}if(jsQwerlib.getCookie(this.directionCookie)){this.direction=Number(jsQwerlib.getCookie(this.directionCookie))}if(jsQwerlib.getCookie(this.typeCookie)){this.type=Number(jsQwerlib.getCookie(this.typeCookie))}var eStyle="margin:0px; padding:0px; border:0;";var aStyle="border:0; font-family:Arial,Helvetica,sans-serif; color:#000080; font-size:11px;";var clearLink='<a onClick="jsQwerlib.DebugWin.clear();" href="javascript:void(0)" style="'+aStyle+'" title="Clear debug window - Ctrl+Alt+Shift+C">Clear</a>';var directionLink='<a id="'+this.directionId+'" onClick="jsQwerlib.DebugWin.changeMode();" href="javascript:void(0)" style="'+aStyle+'" title="Change output mode: prepend before or append after - Ctrl+Alt+Shift+M">'+((this.direction==1)?"Prepend":"Append")+"</a>";var typeLink='<a id="'+this.typeId+'" onClick="jsQwerlib.DebugWin.changeType();" href="javascript:void(0)" style="'+aStyle+'" title="Change debug window type: static frame or transparent floating window - Ctrl+Alt+Shift+T">'+((this.type==1)?"Window":"Frame")+"</a>";var destroyLink='<a onClick="jsQwerlib.DebugWin.destroy();" href="javascript:void(0)" style="'+aStyle+'" title="Close debug window - Ctrl+Alt+Shift+X">Close</a>';var opacityDownLink='<a onClick="jsQwerlib.DebugWin.changeOpacity(true);" href="javascript:void(0)" style="'+aStyle+'" title="Fade out debug window - Ctrl+Alt+Shift+<">[-]</a>';var opacityUpLink='<a onClick="jsQwerlib.DebugWin.changeOpacity(false);" href="javascript:void(0)" style="'+aStyle+'" title="Fade in debug window - Ctrl+Alt+Shift+>">[+]</a>';var winHelpText="Hotkeys:\\nHide/show debug window - Ctrl+Alt+Shift+H\\nMove debug window to default position - Ctrl+Alt+Shift+D\\nStop debug window moving/resizing - Esc";var winHelpLink="<a onClick=\"alert('"+winHelpText+'\');" href="javascript:void(0)" style="'+aStyle+'" title="Show invisible hotkeys">?</a>';if(this.type==1){this.bodyMargin=jsQwerlib.getStyle(document.body,"margin-top")+" "+jsQwerlib.getStyle(document.body,"margin-right")+" "+jsQwerlib.getStyle(document.body,"margin-bottom")+" "+jsQwerlib.getStyle(document.body,"margin-left");this.bodyPadding=jsQwerlib.getStyle(document.body,"padding-top")+" "+jsQwerlib.getStyle(document.body,"padding-right")+" "+jsQwerlib.getStyle(document.body,"padding-bottom")+" "+jsQwerlib.getStyle(document.body,"padding-left");var bodyHtml=document.body.innerHTML;var docHeight=document.body.clientHeight-this.fHeight-this.splitterSize;var bodyStyle="background:transparent; margin:"+this.bodyMargin+"; padding:"+this.bodyPadding+";";document.body.style.margin="0px";document.body.style.padding="0px";document.body.innerHTML='<div id="'+this.winId+'" style="'+eStyle+'"><table border="0" cellpadding="0" cellspacing="0" style="'+eStyle+'"><tr style="'+eStyle+'"><td width="100%" style="'+eStyle+'"><div id="'+this.textContId+'" style="height:'+this.fHeight+"px; overflow:auto; "+eStyle+' background-color:#ffffff;"><div id="'+this.textId+'" style="font-family: \'Courier New\',Courier,monospace;color: #000000; font-size:13px; margin:3px; padding:0px; border:0; background: transparent;"></div></div></td><td style="'+eStyle+'"><div id="'+this.toolContId+'" style="height:'+this.fHeight+"px; width:60px; overflow:hidden; "+eStyle+' border-left:1px solid #777777; background-color:#dddddd"><div style="margin:3px; padding:0px; border:0; background: transparent;">'+clearLink+"<br/>"+directionLink+"<br/>"+typeLink+"<br/>"+destroyLink+'</div></div></td></tr></table></div><div id="'+this.splitterId+'" style="height:'+this.splitterSize+"px; cursor:s-resize;"+eStyle+" background-color:"+this.splitterColor+';"><!----></div><div id="'+this.bodyContId+'" style="height:'+docHeight+"px; overflow:auto; "+eStyle+' background: transparent;"><div id="'+this.testId1+'" style="height:3px; '+eStyle+'"><!----></div><div id="'+this.bodyId+'" style="height:100%; '+bodyStyle+'"></div><div id="'+this.testId2+'" style="height:3px; '+eStyle+'"><!----></div></div>';this.bodyDH=jsQwerlib.getPosition(this.testId2).top-jsQwerlib.getPosition(this.testId1).top-3-docHeight;jsQwerlib.getElementById(this.bodyContId).innerHTML='<div id="'+this.bodyId+'" style="height:'+(docHeight-this.bodyDH)+"px; "+bodyStyle+'">'+bodyHtml+"</div>";jsQwerlib.addEvent(window,"resize",this.onResize);jsQwerlib.addEvent(this.splitterId,"mousedown",this.mouseDown)}else{this.pageOffset=jsQwerlib.getPageOffset();var win=document.createElement("div");win.id=this.winId;win.style.border="0";win.style.margin="0px";win.style.padding="0px";win.style.position="absolute";win.style.width=this.wWidth+"px";win.style.top=(this.wTop+this.pageOffset.y)+"px";win.style.left=(this.wLeft+this.pageOffset.x)+"px";win.style.overflow="visible";win.style.zIndex="1000000";win.style.background="transparent";win.style.opacity=this.opacity/100;win.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+this.opacity+")";var bStyle=eStyle+" background-color:"+this.splitterColor+";";win.innerHTML='<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" style="'+eStyle+'"><tr style="'+eStyle+"height:"+this.splitterSize+'px;"><td id="'+this.borderLTId+'" style="'+bStyle+'cursor:nw-resize;"><div style="'+eStyle+"width:"+this.splitterSize+'px;"><!----></div></td><td id="'+this.borderTId+'" width="100%" style="'+bStyle+'cursor:n-resize;"><div style="'+eStyle+'"><!----></div></td><td id="'+this.borderRTId+'" style="'+bStyle+'cursor:ne-resize;"><div style="'+eStyle+"width:"+this.splitterSize+'px;"><!----></div></td></tr><tr style="'+eStyle+'height:100%;"><td id="'+this.borderLId+'" style="'+bStyle+'cursor:w-resize;"><div style="'+eStyle+"width:"+this.splitterSize+'px;"><!----></div></td><td width="100%" style="'+eStyle+'"><table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" style="'+eStyle+'"><tr style="'+eStyle+'"><td id="'+this.captionId+'" style="'+eStyle+' background-color:#FF0000;color:#FFFFFF; padding:1px; font-family:Arial,Helvetica,sans-serif; font-size:12px;font-weight:bold; text-align:center; cursor:move;">Debug Window</td></tr><tr style="'+eStyle+'height:100%;"><td valign="top" style="'+eStyle+' border:1px solid #000000;"><div id="'+this.textContId+'" style="height:'+this.wHeight+"px; width:"+this.wWidth+"px; overflow:auto; "+eStyle+' background-color:#ffffff;"><div id="'+this.textId+'" style="font-family: \'Courier New\',Courier,monospace;color:#000000; font-size:13px; margin:3px; padding:0px; border:0; background:transparent;"></div></div></td></tr><tr style="'+eStyle+'"><td style="'+eStyle+'text-align:center; padding:1px; background-color:#dddddd;">'+winHelpLink+" "+clearLink+" "+directionLink+" "+typeLink+" "+destroyLink+" "+opacityDownLink+" "+opacityUpLink+'</td></tr></table></td><td id="'+this.borderRId+'" style="'+bStyle+'cursor:e-resize;"><div style="'+eStyle+"width:"+this.splitterSize+'px;"><!----></div></td></tr><tr style="'+eStyle+"height:"+this.splitterSize+'px;"><td id="'+this.borderLBId+'" style="'+bStyle+'cursor:sw-resize;"><div style="'+eStyle+"width:"+this.splitterSize+'px;"><!----></div></td><td id="'+this.borderBId+'" width="100%" style="'+bStyle+'cursor:s-resize;"><div style="'+eStyle+'"><!----></div></td><td id="'+this.borderRBId+'" style="'+bStyle+'cursor:se-resize;"><div style="'+eStyle+"width:"+this.splitterSize+'px;"><!----></div></td></tr></table>';document.body.appendChild(win);jsQwerlib.addEvent(this.captionId,"mousedown",this.mouseDown);jsQwerlib.addEvent(this.borderLId,"mousedown",this.mouseDown);jsQwerlib.addEvent(this.borderLTId,"mousedown",this.mouseDown);jsQwerlib.addEvent(this.borderTId,"mousedown",this.mouseDown);jsQwerlib.addEvent(this.borderRTId,"mousedown",this.mouseDown);jsQwerlib.addEvent(this.borderRId,"mousedown",this.mouseDown);jsQwerlib.addEvent(this.borderRBId,"mousedown",this.mouseDown);jsQwerlib.addEvent(this.borderBId,"mousedown",this.mouseDown);jsQwerlib.addEvent(this.borderLBId,"mousedown",this.mouseDown);jsQwerlib.addEvent(window,"scroll",this.scroll)}jsQwerlib.addEvent(document,"keydown",this.keyDown);this.win=jsQwerlib.getElementById(this.winId);this.text=jsQwerlib.getElementById(this.textId)};jsQwerlib.DebugWin.destroy=function(){with(jsQwerlib.DebugWin){if(!win){return }stopMovement();jsQwerlib.removeEvent(document,"keydown",keyDown);if(type==1){jsQwerlib.removeEvent(window,"resize",onResize);document.body.innerHTML=jsQwerlib.getElementById(bodyId).innerHTML;document.body.style.margin=bodyMargin;document.body.style.padding=bodyPadding}else{jsQwerlib.removeEvent(window,"scroll",scroll);win.parentNode.removeChild(win)}win=null;text=null}};jsQwerlib.DebugWin.write=function(str,newline){with(jsQwerlib.DebugWin){create();if(newline){str+="<br/>"}if(direction<0){text.innerHTML=str+text.innerHTML}else{text.innerHTML+=str}}};jsQwerlib.DebugWin.clear=function(){with(jsQwerlib.DebugWin){if(text){text.innerHTML=""}}};jsQwerlib.DebugWin.changeMode=function(){with(jsQwerlib.DebugWin){direction*=-1;jsQwerlib.setCookie(directionCookie,direction,cookieTime);var e=jsQwerlib.getElementById(directionId);if(e){e.innerHTML=((direction==1)?"Prepend":"Append")}}};jsQwerlib.DebugWin.changeType=function(){with(jsQwerlib.DebugWin){var html=text.innerHTML;destroy();(type==2)?type=1:type++;jsQwerlib.setCookie(typeCookie,type,cookieTime);create();text.innerHTML=html}};jsQwerlib.DebugWin.changeOpacity=function(fadeOut){with(jsQwerlib.DebugWin){if(fadeOut){opacity-=10;if(opacity<20){opacity=20}}else{opacity+=10;if(opacity>100){opacity=100}}win.style.opacity=opacity/100;win.style.filter="progid:DXImageTransform.Microsoft.Alpha(opacity="+opacity+")";jsQwerlib.setCookie(opacityCookie,opacity,cookieTime)}};jsQwerlib.DebugWin.setPosition=function(l,t,w,h){with(jsQwerlib.DebugWin){po=jsQwerlib.getPageOffset();if(w!=wWidth){wWidth=w;win.style.width=w+"px";jsQwerlib.getElementById(textContId).style.width=w+"px";jsQwerlib.setCookie(wWidthCookie,w,cookieTime)}if(h!=wHeight){wHeight=h;win.style.height=h+"px";jsQwerlib.getElementById(textContId).style.height=h+"px";jsQwerlib.setCookie(wHeightCookie,h,cookieTime)}if((l!=wLeft)||(po.x!=pageOffset.x)){wLeft=l;win.style.left=(l+po.x)+"px";jsQwerlib.setCookie(wLeftCookie,l,cookieTime)}if((t!=wTop)||(po.y!=pageOffset.y)){wTop=t;win.style.top=(t+po.y)+"px";jsQwerlib.setCookie(wTopCookie,t,cookieTime)}pageOffset=po}};jsQwerlib.DebugWin.scroll=function(e){with(jsQwerlib.DebugWin){setPosition(wLeft,wTop,wWidth,wHeight)}};jsQwerlib.DebugWin.keyDown=function(e){with(jsQwerlib.DebugWin){if(e.ctrlKey&&e.altKey&&e.shiftKey){switch(e.keyCode){case 67:clear();break;case 77:changeMode();break;case 84:changeType();break;case 88:destroy();break}if(type==2){switch(e.keyCode){case 68:stopMovement();setPosition(defaultWLeft,defaultWTop,wWidth,wHeight);break;case 72:stopMovement();win.style.visibility=((jsQwerlib.getStyle(win,"visibility").toLowerCase()=="hidden")?"visible":"hidden");break;case 188:changeOpacity(true);break;case 190:changeOpacity(false);break}}}if(e.keyCode==27){stopMovement()}}};jsQwerlib.DebugWin.dragStart=function(e){return false};jsQwerlib.DebugWin.mouseDown=function(e){with(jsQwerlib.DebugWin){if(((e.which!=undefined)&&e.which==1)||((e.button!=undefined)&&e.button==1)){stopMovement();jsQwerlib.addEvent(document,"mousemove",mouseMove);jsQwerlib.addEvent(document,"mouseup",mouseUp);jsQwerlib.addEvent(document,"dragstart",dragStart);mouseCoords={x:e.clientX,y:e.clientY};var moveTarget=jsQwerlib.getEventTarget(e);bodyCursor=jsQwerlib.getStyle(document.body,"cursor");moveCursor=document.body.style.cursor=moveTarget.style.cursor;if(type==2){switch(moveTarget.id){case borderLId:dSize={dX:-1,dY:0};break;case borderLTId:dSize={dX:-1,dY:-1};break;case borderTId:dSize={dX:0,dY:-1};break;case borderRTId:dSize={dX:1,dY:-1};break;case borderRId:dSize={dX:1,dY:0};break;case borderRBId:dSize={dX:1,dY:1};break;case borderBId:dSize={dX:0,dY:1};break;case borderLBId:dSize={dX:-1,dY:1};break;default:dSize={dX:0,dY:0}}if(e.ctrlKey){dSize={dX:0,dY:0};moveTarget.style.cursor=document.body.style.cursor="move"}}jsQwerlib.cancelClick(e)}}};jsQwerlib.DebugWin.mouseMove=function(e){with(jsQwerlib.DebugWin){if(((e.which!=undefined)&&e.which==1)||((e.button!=undefined)&&e.button==1)){var c={x:e.clientX,y:e.clientY};var dy=c.y-mouseCoords.y;var dx=c.x-mouseCoords.x;if(type==1){var h=fHeight+dy;if(h<minFHeight){c.y+=(minFHeight-h);h=minFHeight}if(fHeight!=h){jsQwerlib.getElementById(textContId).style.height=h+"px";jsQwerlib.getElementById(toolContId).style.height=h+"px";fHeight=h;onResize(null);jsQwerlib.setCookie(fHeightCookie,h,cookieTime)}}else{var w=wWidth,h=wHeight,l=wLeft,t=wTop;if(dSize.dX<0){w-=dx;l+=dx}if(dSize.dX>0){w+=dx}if(dSize.dY<0){h-=dy;t+=dy}if(dSize.dY>0){h+=dy}if(dSize.dX==0&&dSize.dY==0){l+=dx;t+=dy}if(w<minWWidth){var d=minWWidth-w;w=minWWidth;if(dSize.dX>0){c.x+=d}else{c.x-=d;l=wLeft+(c.x-mouseCoords.x)}}if(h<minWHeight){var d=minWHeight-h;h=minWHeight;if(dSize.dY>0){c.y+=d}else{c.y-=d;t=wTop+(c.y-mouseCoords.y)}}setPosition(l,t,w,h)}mouseCoords=c;jsQwerlib.cancelClick(e)}else{stopMovement()}}};jsQwerlib.DebugWin.stopMovement=function(){with(jsQwerlib.DebugWin){if(moveTarget){jsQwerlib.removeEvent(document,"mousemove",mouseMove);jsQwerlib.removeEvent(document,"mouseup",mouseUp);jsQwerlib.removeEvent(document,"dragstart",dragStart);document.body.style.cursor=bodyCursor;moveTarget.style.cursor=moveCursor;moveTarget=moveCursor=bodyCursor=null}}};jsQwerlib.DebugWin.mouseUp=function(e){with(jsQwerlib.DebugWin){if(((e.which!=undefined)&&e.which==1)||((e.button!=undefined)&&e.button==1)){stopMovement();jsQwerlib.cancelClick(e)}}};jsQwerlib.DebugWin.onResize=function(e){with(jsQwerlib.DebugWin){var docHeight=document.body.clientHeight-fHeight-splitterSize;if(docHeight<bodyDH){docHeight=bodyDH}jsQwerlib.getElementById(bodyContId).style.height=docHeight+"px";jsQwerlib.getElementById(bodyId).style.height=(docHeight-bodyDH)+"px"}};jsQwerlib.htmlspecialchars=function(str){return String(str).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(RegExp('"',"g"),"&quot;").replace(RegExp("'","g"),"&#039;")};jsQwerlib.openDebug=function(){if(jsQwerlib.__DEBUG__){jsQwerlib.DebugWin.create()}};jsQwerlib.clearDebug=function(){jsQwerlib.DebugWin.clear()};jsQwerlib.closeDebug=function(){jsQwerlib.DebugWin.destroy()};jsQwerlib.__formatDebugMsg=function(args){var msg="";for(var i=0;i<args.length;i++){var arg=args[i];var val=jsQwerlib.htmlspecialchars(arg);if(arg&&(typeof arg=="object")){if(arg instanceof Number||arg instanceof String||arg instanceof Boolean||arg instanceof RegExp||arg instanceof Date||arg instanceof Function){}else{if(arg instanceof Array){val="<b>Array [</b>";var f=true;for(var j in arg){val+=(!f?"<b>, </b>":"")+"<b>"+j+" => </b>"+jsQwerlib.htmlspecialchars(arg[j]);f=false}val+="<b>]</b>"}else{if(String(arg).search(RegExp("^\\s*function"))!=0){val="<b>Object {</b>";try{val+="<b>toString(): </b>"+arg.toString()}catch(e){}var props=Array();for(var j in arg){props.push(j)}props.sort(function(a,b){var s1=String(a).toLowerCase();var s2=String(b).toLowerCase();if(s1<s2){return -1}if(s1>s2){return 1}return 0});for(var j=0;j<props.length;j++){val+="<b>, "+props[j]+": </b>";try{val+=jsQwerlib.htmlspecialchars(arg[props[j]])}catch(e){val+="<b>unavailable!</b>"}}val+="<b>}</b>"}}}}msg+=val;if(i!=args.length-1){msg+=" | "}}return(msg+" ")};jsQwerlib.DEBUG=function(p1){if(jsQwerlib.__DEBUG__&&arguments.length>0){jsQwerlib.DebugWin.write(jsQwerlib.__formatDebugMsg(arguments),true)}};jsQwerlib.DEBUGNB=function(p1){if(jsQwerlib.__DEBUG__&&arguments.length>0){jsQwerlib.DebugWin.write(jsQwerlib.__formatDebugMsg(arguments),false)}};jsQwerlib.wait=function(millis){var begin=new Date();var curr=begin;while(curr-begin<millis){curr=new Date()}};jsQwerlib.Timer=function(start){this.begin=null;this.time=0;this.start=function(clear){if(clear){this.time=0;this.begin=new Date()}if(!this.begin){this.begin=new Date()}};this.getTime=function(){if(this.begin!=null){return(this.time+((new Date())-this.begin))/1000}else{return this.time/1000}};this.stop=function(){if(this.begin!=null){this.time+=((new Date())-this.begin);this.begin=null}return this.time/1000};if(start){this.start()}};jsQwerlib.setCookie=function(name,value,time,path,domain,secure){var date;if(time){date=new Date();date.setTime(date.getTime()+(time*1000))}document.cookie=name+"="+escape(value)+((time)?"; expires="+date.toGMTString():"")+((path)?"; path="+path:"")+((domain)?"; domain="+domain:"")+((secure)?"; secure":"")};jsQwerlib.getCookie=function(name){var prefix=name+"=";var si=document.cookie.indexOf(prefix);if(si==-1){return null}var ei=document.cookie.indexOf(";",si+prefix.length);if(ei==-1){ei=document.cookie.length}return unescape(document.cookie.substring(si+prefix.length,ei))};jsQwerlib.deleteCookie=function(name){document.cookie=name+"=; expires=Fri, 31 Dec 1999 23:59:59 GMT;"};jsQwerlib.isCookiesSupported=function(){this.setCookie("__jsQwerlib_TestCookie__",100,365*24*60*60);if(this.getCookie("__jsQwerlib_TestCookie__")!=100){return false}this.deleteCookie("__jsQwerlib_TestCookie__");return true};jsQwerlib.CookiesArray=function(name){this.name=null;this.setName=function(name){this.name=name};this.getName=function(){return this.name};this.getElement=function(index){return jsQwerlib.getCookie(this.name+"["+index+"]")};this.setElement=function(index,value,time,path,domain,secure){jsQwerlib.setCookie(this.name+"["+index+"]",value,time,path,domain,secure)};this.deleteElement=function(index){return jsQwerlib.deleteCookie(this.name+"["+index+"]")};this.size=function(){var s=0;var cookies=document.cookie.split("; ");for(var i=0;i<cookies.length;i++){var name_value=cookies[i].split("=");if(name_value[0].indexOf(this.name+"[")!=-1){s++}}return s};this.getIndexes=function(){var indexes=new Array();var cookies=document.cookie.split("; ");for(var i=0;i<cookies.length;i++){var name_value=cookies[i].split("=");if(name_value[0].indexOf(this.name+"[")!=-1){indexes.push(name_value[0].replace(this.name+"[","").replace("]",""))}}return indexes};this.find=function(value){value=escape(value);var cookies=document.cookie.split("; ");for(var i=0;i<cookies.length;i++){var name_value=cookies[i].split("=");if((value==name_value[1])&&(name_value[0].indexOf(this.name+"[")!=-1)){var s=name_value[0].replace(this.name+"[","");return s.replace("]","")}}return null};this.empty=function(){var cookies=document.cookie.split("; ");for(var i=0;i<cookies.length;i++){var name_value=cookies[i].split("=");if(name_value[0].indexOf(this.name+"[")!=-1){document.cookie=name_value[0]+"=; expires=Fri, 31 Dec 1999 23:59:59 GMT;"}}};if(name){this.setName(name)}};jsQwerlib.getElementById=function(e){if(typeof (e)=="string"){if(document.getElementById){e=document.getElementById(e)}else{if(document.all){e=document.all[e]}else{e=null}}}return e};jsQwerlib.getPosition=function(e){var e=jsQwerlib.getElementById(e);var oLeft=0;var oTop=0;while(e){oLeft+=e.offsetLeft;oTop+=e.offsetTop;e=e.offsetParent}if(navigator.userAgent.indexOf("Mac")!=-1&&typeof document.body.leftMargin!="undefined"){oLeft+=document.body.leftMargin;oTop+=document.body.topMargin}return{left:oLeft,top:oTop}};jsQwerlib.getStyle=function(e,cssProp){var e=jsQwerlib.getElementById(e);var css=null;if(e.currentStyle){var parts=cssProp.split("-");for(var i=parts.length-1;i>0;i--){parts[i]=parts[i].charAt(0).toUpperCase()+parts[i].substr(1,parts[i].length-1)}css=e.currentStyle[parts.join("")];if(css==undefined){css=null}}else{if(window.getComputedStyle){css=document.defaultView.getComputedStyle(e,null).getPropertyValue(cssProp);if(css==""){css=null}}}return css};jsQwerlib.getMouseCoords=function(ev){if(ev.pageX!=undefined){return{x:ev.pageX,y:ev.pageY}}if(ev.clientX!=undefined){return{x:ev.clientX+document.body.scrollLeft-document.body.clientLeft,y:ev.clientY+document.body.scrollTop-document.body.clientTop}}return null};jsQwerlib.getPageOffset=function(){if(window.pageYOffset!=undefined){return{x:window.pageXOffset,y:window.pageYOffset}}if(document.body.scrollTop!=undefined){return{x:document.body.scrollLeft,y:document.body.scrollTop}}return null};jsQwerlib.addEvent=function(e,evType,fn,useCapture){e=jsQwerlib.getElementById(e);if(!e){return false}evType=evType.toLowerCase();if(useCapture==undefined){useCapture=false}if(e.addEventListener){e.addEventListener(evType,fn,useCapture);return true}else{if(e.attachEvent){return e.attachEvent("on"+evType,fn)}else{e["on"+evType]=fn;return true}}};jsQwerlib.removeEvent=function(e,evType,fn,useCapture){e=jsQwerlib.getElementById(e);if(!e){return false}evType=evType.toLowerCase();if(useCapture==undefined){useCapture=false}if(e.removeEventListener){e.removeEventListener(evType,fn,useCapture);return true}else{if(e.detachEvent){return e.detachEvent("on"+evType,fn)}else{e["on"+evType]="";return true}}};jsQwerlib.getEventTarget=function(e){var target=window.event?window.event.srcElement:e?e.target:null;if(!target){return false}while(target.nodeType!=1&&target.nodeName.toLowerCase()!="body"){target=target.parentNode}return target};jsQwerlib.stopBubble=function(e){if(window.event&&window.event.cancelBubble){window.event.cancelBubble=true}if(e&&e.stopPropagation){e.stopPropagation()}};jsQwerlib.stopDefault=function(e){if(window.event&&window.event.returnValue){window.event.returnValue=false}if(e&&e.preventDefault){e.preventDefault()}};jsQwerlib.cancelClick=function(e){jsQwerlib.stopBubble(e);jsQwerlib.stopDefault(e)};jsQwerlib.chEmpty=function(name,id){var e=jsQwerlib.getElementById(id);if(e.value.length>0){return true}else{e.focus();alert(jsQwerlib.inputErrorMsgPrefix+"пустое поле '"+name+"'!");return false}};jsQwerlib.chMinLength=function(name,id,minlength){var e=jsQwerlib.getElementById(id);if(e.value.length>=minlength){return true}else{e.focus();alert(jsQwerlib.inputErrorMsgPrefix+"минимальная длина (символов) - "+minlength+", поле '"+name+"'!");return false}};jsQwerlib.chMaxLength=function(name,id,maxlength){var e=jsQwerlib.getElementById(id);if(e.value.length<=maxlength){return true}else{e.focus();alert(jsQwerlib.inputErrorMsgPrefix+"превышена максимальная длина, поле '"+name+"'!");return false}};jsQwerlib.chRegexep=function(name,id,regexp){var e=jsQwerlib.getElementById(id);if(regexp.test(e.value)){return true}else{e.focus();alert(jsQwerlib.inputErrorMsgPrefix+"недопустимый формат, поле '"+name+"'!");return false}};jsQwerlib.chMatch=function(name1,id1,name2,id2){var e1=jsQwerlib.getElementById(id1);var e2=jsQwerlib.getElementById(id2);if(e1.value==e2.value){return true}else{e1.focus();alert(jsQwerlib.inputErrorMsgPrefix+"поля '"+name1+"' и '"+name2+"' не совпадают!");return false}};jsQwerlib.chFormat=function(name,id,empty,minlength,maxlength,regexp){var e=jsQwerlib.getElementById(id);var isEmpty=(e.value.length==0);return(!empty||jsQwerlib.chEmpty(name,id))&&(isEmpty||((!minlength||jsQwerlib.chMinLength(name,id,minlength))&&(!maxlength||jsQwerlib.chMaxLength(name,id,maxlength))&&(!regexp||jsQwerlib.chRegexep(name,id,regexp))))};window.$Q=jsQwerlib;window.jsQwerlib=jsQwerlib})();
