(function(){var $CS=window.ConsultSystems={min:[240,350],max:[1400,1400],offset:{x:0,y:0},savedOffset:{},savedSize:[],fixedSupport:true,scrolltop:0,window:{},opener:false,iframeSrc:""+document.location.protocol+"//consultsystems.ru/siteim/FcMyiwg5m47b/",blankIframeSrc:""+document.location.protocol+"//consultsystems.ru/blank/",fixedClass:"fixed",isFixed:true,touchSupport:false,imagesUrl:""+document.location.protocol+"//consultsystems.ru/script/im/images/",buttonImagesUrl:''+document.location.protocol+'//consultsystems.ru/script/im/button/',avatar:''+document.location.protocol+'//consultsystems.ru',style:{},domReady:false,buttonsCount:0,minOpacity:0,buttons:{},openPosition:[300,200],stylesheet:'',titleHeight:35,callbackVisit:"consultsystemsVisit",urlVisit:""+document.location.protocol+"//consultsystems.ru/script/im/visit.php?callback=?",callbackCheck:"consultsystemsCheck",urlCheck:""+document.location.protocol+"//update.consultsystems.ru/messages.php?callback=?",callbackClose:"consultsystemsClose",urlClose:""+document.location.protocol+"//consultsystems.ru/script/im/close.php?callback=?",callbackParams:"consultsystemsParams",urlParams:""+document.location.protocol+"//consultsystems.ru/script/im/setparams.php?callback=?",checkMaxId:'0',haveSession:false,needReload:false,tarifId:1923,userStatus:"offline",userReq:true,silent:false,vCookie:'',isIE8:(navigator.appVersion.indexOf("MSIE 8.")!=-1),isIE7:(navigator.appVersion.indexOf("MSIE 7.")!=-1),isIE6:false,isSafari:Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor')>0};function detectIE(){var ua=window.navigator.userAgent;var msie=ua.indexOf('MSIE ');if(msie>0){return parseInt(ua.substring(msie+5,ua.indexOf('.',msie)),10);} var trident=ua.indexOf('Trident/');if(trident>0){var rv=ua.indexOf('rv:');return parseInt(ua.substring(rv+3,ua.indexOf('.',rv)),10);} var edge=ua.indexOf('Edge/');if(edge>0){return parseInt(ua.substring(edge+5,ua.indexOf('.',edge)),10);} return false;} if(detectIE()===false){$CS.buttonRnd=Math.floor((Math.random()*10000000)+1);$CS.lastTime=0;$CS.transitionTime=0;$CS.setMainTab=function(){$CS.lastTime=Math.floor(Date.now()/1000);$CS.transitionTime=0;$CS.silent=false;var cookie=$CS.buttonRnd+';'+$CS.lastTime;setCookie("wcmaintab",cookie,{expires:0,path:"/"});var iframe=document.getElementById('consultsystems_iframe');if(typeof(iframe)!='undefined'&&iframe!=null) {iframe.style.display='block';if(iframe.src==$CS.blankIframeSrc){var loader=document.getElementById('consultsystems_iframe_loading');if(typeof(loader)!='undefined'&&loader!=null){loader.className='consultsystems_iframe_loading';} iframe.src=$CS.iframeSrc;}}} $CS.setSilentTab=function(){$CS.silent=true;var iframe=document.getElementById('consultsystems_iframe');if(typeof(iframe)!='undefined'&&iframe!=null) {var loader=document.getElementById('consultsystems_iframe_loading');if(typeof(loader)!='undefined'&&loader!=null){loader.className='consultsystems_iframe_loading';} if(iframe.src!=$CS.blankIframeSrc){iframe.style.display='none';iframe.src=$CS.blankIframeSrc;}}};$CS.checkTabState=function(){var cookie=getCookie("wcmaintab");var current_time=Math.floor(Date.now()/1000);if(typeof cookie==='undefined'){return'main';} var parts=cookie.split(";");parts[0]=parseInt(parts[0]);parts[1]=parseInt(parts[1]);if(parts[0]==$CS.buttonRnd){return'main';} if(current_time-parts[1]>9){return'main';} $CS.transitionTime+=1;if($CS.transitionTime>9){return'silent';} return'transition';} function getHiddenProp(){var prefixes=['webkit','moz','ms','o'];if('hidden'in document)return'hidden';for(var i=0;i'+''+''+''+''+''+''+options.bubbleText+'
'+'
'+'
'+'';var html=''+''+''+''+''+''+title+''+''+''+''+ bubbleHtml+''+'';var main=document.createElement('span');main.id="consultsystems_button_"+$CS.buttonsCount;addClass(main,"consultsystems_button_wrap consultsystems_button_"+options.position);main.innerHTML=html;addEvent(window,"scroll",function(e){if(!$CS.fixedSupport){$CS.scrollTopButtons=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop;main.style.marginTop=$CS.scrollTopButtons+"px";}});var bubbleButton=document.createElement('a');bubbleButton.id='bubble_but';addClass(bubbleButton,"consultsystems_bubble_button");bubbleButton.innerHTML=''+options.bubbleButtonText+'';if(window.CSEditorMode){var itm=0;$el("export-preview").appendChild(main);}else{var itm=200;document.body.appendChild(main);} var $button=$CS.buttons[$CS.buttonsCount]={wrap:main,spanpos:main.childNodes[0],options:options} $button.pos=$button.spanpos.childNodes[0];$button.button=$button.pos.childNodes[0];$button.bubble=$button.pos.childNodes[1];$button.bubbleClose=$button.bubble.childNodes[0].childNodes[0];$button.bubbleButton=$button.bubble.childNodes[0].childNodes[2].appendChild(bubbleButton);if($CS.fixedSupport&&!window.CSEditorMode){$button.wrap.style.position="fixed";$button.wrap.style.webkitTransform="translateZ(0)";} if(!window.CSEditorMode){addClass($button.pos,"consultsystems_button_outscreen");addClass($button.bubble,"consultsystems_bubble_trans");} setTimeout(function(){$button.size=sizes($button.button);autoOffset($button);removeClass($button.pos,"consultsystems_button_outscreen");if(!window.CSEditorMode){var bubbleclose=getCookie("bubbleclose");closeBubble();if(!bubbleclose&&(options.showBubble||typeof options.showBubble=="number")&&options.status=="online"){setTimeout(openBubble,options.showBubble+1);setTimeout(showBubble,options.showBubble+25);if(options.bubbleAutoHide){setTimeout(hideBubble,options.showBubble+options.bubbleAutoHide+5)}}}else{if((options.showBubble||typeof options.showBubble=="number")&&options.bubbleAutoHide!==0){openBubble();showBubble();}}},itm);var x=$CS.openPosition[0],y=$CS.openPosition[1];browserWindow();addEvent($button.button,"mousedown",function(e){addClass($button.button,"consultsystems_button_border_active")});addEvent(document,"mouseup",function(e){removeClass($button.button,"consultsystems_button_border_active")});if(!window.CSEditorMode){addEvent($button.button,"click",function(e){if(options.autoOpenPosition){var s=[$CS.savedSize[0]||$CS.min[0],$CS.savedSize[1]||$CS.min[1]];var op=poptions.op(s,$button.wrap,$CS.window);x=op.x,y=op.y;} if(typeof yaCounter25869032!=="undefined"){yaCounter25869032.reachGoal("online_cosult_called");} if(typeof ga!=="undefined"){ga("send","event","button","online_cosult_called");} if(typeof _gaq!=="undefined"){_gaq.push(["_trackEvent","button","online_cosult_called"]);} $CS.lastOpener=$button.wrap;if(!$CS.isSafari){$CS.show(x,y,$button.wrap);}else{newWin=window.open("http://consultsystems.ru/labs/safarifix.php","safarifix","width=5,height=5,resizable=no,scrollbars=no,status=no");setTimeout(function(){$CS.show(x,y,$button.wrap);},1000)} hideBubble();});addEvent($button.bubbleButton,"click",function(e){if(options.autoOpenPosition){var s=[$CS.savedSize[0]||$CS.min[0],$CS.savedSize[1]||$CS.min[1]];var op=poptions.op(s,$button.wrap,$CS.window);x=op.x,y=op.y;} if(typeof yaCounter25869032!=="undefined"){yaCounter25869032.reachGoal("online_cosult_called");} if(typeof ga!=="undefined"){ga("send","event","button","online_cosult_called");} if(typeof _gaq!=="undefined"){_gaq.push(["_trackEvent","button","online_cosult_called"]);} $CS.lastOpener=$button.wrap;if(!$CS.isSafari){$CS.show(x,y,$button.wrap);}else{newWin=window.open("http://consultsystems.ru/labs/safarifix.php","safarifix","width=5,height=5,resizable=no,scrollbars=no,status=no");setTimeout(function(){$CS.show(x,y,$button.wrap);},1000)} hideBubble();});addEvent($button.bubbleClose,"click",function(e){var d=new Date();var n=new Date(d.getTime()+1000*3600);setCookie("bubbleclose","1",{expires:n,path:"/"}) hideBubble()});} var hideBubble=function(){addClass($button.bubble,"consultsystems_bubble_hidden");setTimeout(closeBubble,500);} var showBubble=function(){removeClass($button.bubble,"consultsystems_bubble_hidden")} var closeBubble=function(){addClass($button.bubble,"consultsystems_bubble_closed")} var openBubble=function(){removeClass($button.bubble,"consultsystems_bubble_closed");} var addstyle='';addstyle+='#'+main.id+' .consultsystems_button_in {background: '+options.bgColor+'}';if(window.CSEditorMode){addstyle+='.consultsystems_button_right-bottom .consultsystems_bubble {top:auto;bottom:45px}';} if(options.bgColorType=='gradient'&&!$CS.isIE6){if(poptions.vertical){var bgGradGen=gradientGenerator(options.bgGradient[0],options.bgGradient[1],'x')} else{var bgGradGen=gradientGenerator(options.bgGradient[0],options.bgGradient[1],'y')} addstyle+='#'+main.id+' .consultsystems_button_in {background: '+options.bgColor+';'+bgGradGen+'}';} var genBordersOut=borderGenerator(options.borderColor,options.borderWidth);var genBordersIn=borderGenerator(options.inBorderColor,options.inBorderWidth);addstyle+='#'+main.id+' .consultsystems_button_border {'+genBordersOut.raw+'}';addstyle+='#'+main.id+' .consultsystems_button_in {'+genBordersIn.raw+'}';var winOuter=borderGenerator(options.borderColor,options.borderWidth);var winInner=borderGenerator(options.inBorderColor,options.inBorderWidth);var brdrlength=winOuter.obj.top.width+winOuter.obj.bottom.width+winInner.obj.top.width+winInner.obj.bottom.width;$CS.newTitleHeight=$CS.titleHeight-brdrlength;addstyle+='#'+main.id+' .consultsystems_button_text {height: '+($CS.newTitleHeight)+'px !important; line-height: '+($CS.newTitleHeight-2)+'px !important;}' if(poptions.vertical){addstyle+='#'+main.id+' .consultsystems_button_text {height: auto !important; width: '+$CS.newTitleHeight+'px}';} addstyle+='#'+main.id+' .consultsystems_button_border:hover .consultsystems_button_text {color: '+options.hoverColor+'; text-shadow: '+options.hoverTextShadow+'; -moz-text-shadow: '+options.hoverTextShadow+'; -text-shadow: '+options.hoverTextShadow+' }';addstyle+='#'+main.id+' .consultsystems_button_border:hover .consultsystems_button_in {background: none; background: '+options.hoverBgColor+'}';if(options.hoverBgColorType=="gradient"&&!$CS.isIE6){if(poptions.vertical){var hoverBgGradGen=gradientGenerator(options.hoverBgGradient[0],options.hoverBgGradient[1],'x')} else{var hoverBgGradGen=gradientGenerator(options.hoverBgGradient[0],options.hoverBgGradient[1],'y')} addstyle+='#'+main.id+' .consultsystems_button_border:hover .consultsystems_button_in {'+hoverBgGradGen+'}';} addstyle+='#'+main.id+' .consultsystems_button_border:hover {'+borderGenerator(options.hoverBorderColor,options.hoverBorderWidth).raw+'}';addstyle+='#'+main.id+' .consultsystems_button_border:hover .consultsystems_button_in {'+borderGenerator(options.hoverInBorderColor,options.hoverInBorderWidth).raw+'}';addstyle+='#'+main.id+' .consultsystems_button_border:active .consultsystems_button_text, #'+main.id+' .consultsystems_button_border_active .consultsystems_button_text, .consultsystems_button_border_active:hover .consultsystems_button_text {color: '+options.activeColor+' !important; text-shadow: '+options.activeTextShadow+'; -moz-text-shadow: '+options.activeTextShadow+'; -text-shadow: '+options.activeTextShadow+' }';addstyle+='#'+main.id+' .consultsystems_button_border:active .consultsystems_button_in, #'+main.id+' .consultsystems_button_border_active .consultsystems_button_in, .consultsystems_button_border_active:hover .consultsystems_button_in {background: none; background: '+options.activeBgColor+'}';if(options.activeBgColorType=="gradient"&&!$CS.isIE6){if(poptions.vertical){var activeBgGradGen=gradientGenerator(options.activeBgGradient[0],options.activeBgGradient[1],'x')} else{var activeBgGradGen=gradientGenerator(options.activeBgGradient[0],options.activeBgGradient[1],'y')} addstyle+='#'+main.id+' .consultsystems_button_border:active .consultsystems_button_in, #'+main.id+' .consultsystems_button_border_active .consultsystems_button_in {background: none; '+activeBgGradGen+'}';} addstyle+='#'+main.id+' .consultsystems_button_border:active, #'+main.id+' .consultsystems_button_border_active {'+borderGenerator(options.activeBorderColor,options.activeBorderWidth).raw+'}';addstyle+='#'+main.id+' .consultsystems_button_border:active .consultsystems_button_in, #'+main.id+' .consultsystems_button_border_active .consultsystems_button_in {'+borderGenerator(options.activeInBorderColor,options.activeInBorderWidth).raw+'}';if(!options.icon){options.iconImage='none';options.iconSize=[0,0];if(poptions.vertical){addstyle+='#'+main.id+' .consultsystems_button_text {padding-bottom:5px}';}else{addstyle+='#'+main.id+' .consultsystems_button_text {padding-left:12px}';}} addstyle+='#'+main.id+' .consultsystems_button_icon {background: '+options.iconImage+'; width: '+options.iconSize[0]+'px; height: '+options.iconSize[1]+'px; }';var brdrad=poptions.br[0]+'px '+poptions.br[1]+'px '+poptions.br[2]+'px '+poptions.br[3]+'px';addstyle+='#'+main.id+' .consultsystems_button_border {border-radius: '+brdrad+';-moz-border-radius:'+brdrad+';-webkit-border-radius:'+brdrad+';}';addstyle+='#'+main.id+' .consultsystems_button_in {border-radius: '+brdrad+';-moz-border-radius:'+brdrad+';-webkit-border-radius:'+brdrad+';}';var statusTextPadding='padding-right: 85px';if(poptions.vertical){statusTextPadding='padding-top: 85px'} if(options.status=="online"){var statusBg=options.statusOnlineImgX;if(poptions.vertical){statusBg=options.statusOnlineImgY}}else{var statusBg=options.statusOfflineImgX;if(poptions.vertical){statusBg=options.statusOfflineImgY}} var statusDsp='';if((options.statusShow=="onlyIfOnline"&&options.status!='online')||options.statusShow=='hide'){statusBg='none';statusDsp='display: none';statusTextPadding='padding-right: 12px';if(poptions.vertical){statusTextPadding='padding-top: 12px'}} addstyle+='#'+main.id+' .consultsystems_button_text {font-size: '+options.fontSize+' !important; color: '+options.textColor+' !important; text-shadow: '+options.textShadow+'; -moz-text-shadow: '+options.textShadow+'; -text-shadow: '+options.textShadow+'; '+statusTextPadding+' }';addstyle+='#'+main.id+' .consultsystems_button_status {background:'+statusBg+'; '+statusDsp+';}';addstyle+='#'+main.id+' .consultsystems_bubble {background:'+options.bubbleBg+'; border: solid 1px '+options.bubbleBorder+'}';var arrowImg=poptions.arrowImg;if(options.bubbleBg&&(options.bubbleBg=="white"||options.bubbleBg.toLowerCase=="#fff"||options.bubbleBg.toLowerCase=="#ffffff")){arrowImg=poptions.arrowWhiteImg;} addstyle+='#'+main.id+' .consultsystems_bubble_arrow {background-image:url('+arrowImg+')}';addstyle+='#'+main.id+' .consultsystems_bubble_button {background: '+options.bubbleButtonBg+'; color: '+options.bubbleButtonTextColor+'; border: solid 1px '+options.bubbleButtonBorder+'}';addstyle+='#'+main.id+' .consultsystems_bubble_button:hover {background: '+options.bubbleButtonHoverBg+'; color: '+options.bubbleButtonHoverTextColor+'; border: solid 1px '+options.bubbleButtonHoverBorder+'}';addstyle+='#'+main.id+' .consultsystems_bubble_button:active {background: '+options.bubbleButtonActiveBg+'; color: '+options.bubbleButtonActiveTextColor+'; border: solid 1px '+options.bubbleButtonActiveBorder+'}';$CS.defaultStyle+=addstyle;$CS.buttonsCount++;function autoOffset($btn){if($btn.options.position=="center-top"){$btn.wrap.style.marginLeft=-($btn.size[0]/2)+"px"} if($btn.options.position=="center-bottom"){$btn.wrap.style.marginLeft=-($btn.size[0]/2)+"px"} if($btn.options.position=="left-center"){$btn.wrap.style.marginTop=-($btn.size[1]/2)+"px"} if($btn.options.position=="right-center"){$btn.wrap.style.marginTop=-($btn.size[1]/2)+"px"} if($btn.options.marginTop){if(typeof $btn.options.marginTop=="number"&&$btn.options.marginTop!==0){$btn.options.marginTop+="px"} $btn.spanpos.style.marginTop=$btn.options.marginTop;} if($btn.options.marginRight){if(typeof $btn.options.marginRight=="number"&&$btn.options.marginRight!==0){$btn.options.marginRight+="px"} $btn.spanpos.style.marginRight=$btn.options.marginRight;} if($btn.options.marginBottom){if(typeof $btn.options.marginBottom=="number"&&$btn.options.marginBottom!==0){$btn.options.marginBottom+="px"} $btn.spanpos.style.marginBottom=$btn.options.offsetBottom;} if($btn.options.marginLeft){if(typeof $btn.options.marginLeft=="number"&&$btn.options.marginLeft!==0){$btn.options.marginLeft+="px"} $btn.spanpos.style.marginLeft=$btn.options.marginLeft;} if(!window.CSEditorMode){if(poptions.bottom){var bubbleHeight=$btn.bubble.offsetHeight;$btn.bubble.style.top=-bubbleHeight+"px"}}} function sizes(span){return[span.offsetWidth,span.offsetHeight];}} return $button;} bindReady(function(){$CS.fixedSupport=browserPositionFixed();if(!window.CSEditorMode){$CS.styleInit();if($CS.preopen){preopen($button);} var d=new Date();var random=d.getTime();if($CS.userStatus=='online'||typeof window.webconsult_clientinfo!='undefined'){getJSONP($CS.urlVisit+"&sitehash=FcMyiwg5m47b&title="+encodeURIComponent(document.title.substr(0,100))+"&tid="+$CS.tarifId+"&referer="+encodeURIComponent(document.referrer)+"&rnd="+$CS.getUnixTime(),$CS.callbackVisit,function(data){$CS.vCookie=data.vcookie;});} if($CS.userStatus=='online'){if($CS.tarifId!=2&&$CS.userReq&&document.location.protocol!='https:'){setInterval(function(){if(!$CS.silent){getJSONP($CS.urlCheck+'&maxid='+$CS.checkMaxId+'&site_id=31209&vcookie='+$CS.vCookie+'&rnd='+$CS.getUnixTime(),$CS.callbackCheck,function(data){if(data.maxid>0)$CS.checkMaxId=data.maxid;if(data.data){if(!$CS.opened){$CS.lastOpener=$button.wrap;var s=[$CS.savedSize[0]||$CS.min[0],$CS.savedSize[1]||$CS.min[1]];var op=$button.options.pos.op(s,$button.wrap,$CS.window);x=op.x,y=op.y;$CS.show(x,y,$button.wrap);}}});}},5000);}}} $CS.domReady=true;}) function preopen($button){$CS.lastOpener=$button.wrap;$CS.show($CS.savedOffset.x,$CS.savedOffset.y,$button.wrap);addClass($CS.lastOpener,"consultsystems_button_preopen");setTimeout(function(){removeClass($CS.lastOpener,"consultsystems_button_preopen");},555)} $CS.styleInit=function(){styleTag($CS.defaultStyle);} $CS.fixed=function(){$CS.isFixed=true;return this;} $CS.static=function(){$CS.isFixed=false;return this;} $CS.show=function(x,y,from_x,from_y){if('ontouchstart'in document.documentElement){$CS.touchSupport=true} $CS.opened=true;$CS.fixedSupport=browserPositionFixed();if(!$CS.fixedSupport){$CS.scrolltop=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop;} var ev=false;if(arguments.length==1&&isClickEvent(arguments[0])){ev=arguments[0]} if(arguments.length==3&&isClickEvent(arguments[2])){ev=arguments[2]} if(!ev&&window.event){ev=window.event} if(arguments.length==1&&typeof arguments[2]=="object"&&arguments[2].nodeType==1){var obj=arguments[0];x=from_x=obj.offsetLeft;y=from_y=obj.offsetTop;} else if(arguments.length==3&&typeof arguments[2]=="object"&&arguments[2].nodeType==1){var obj=arguments[2];from_x=obj.offsetLeft;from_y=obj.offsetTop;} else if(arguments.length==2&&(ev&&(ev.target||ev.srcElement))){var obj=ev.target||ev.srcElement;from_x=obj.offsetLeft;from_y=obj.offsetTop;} else if(!obj&&ev&&(ev.target||ev.srcElement)){var obj=ev.target||ev.srcElement;} if(obj&&obj.offsetWidth&&obj.offsetHeight){from_x=from_x+obj.offsetWidth/2;from_y=from_y+obj.offsetHeight/2;} $CS.opener={x:from_x,y:from_y,fixed:(obj&&hasClass(obj,$CS.fixedClass)||$CS.isFixed)?true:false} if(!$CS.opener.fixed){from_y-=(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop);} x=x||from_x;y=y||from_y;$CS.offset={x:$CS.savedOffset.x||x||0,y:$CS.savedOffset.y||y||0} if($CS.savedOffset.x===0){$CS.offset.x=0} if($CS.savedOffset.y===0){$CS.offset.y=0} var postop=$CS.offset.y;if(!$CS.fixedSupport&&$CS.scrolltop){postop+=$CS.scrolltop;} browserWindow();if(!$CS.div){$CS.div=document.createElement('div');$CS.div.id="consultsystems";$CS.div.style.width=$CS.min[0]+"px";$CS.div.style.height=$CS.min[1]+"px";var cstitle=$CS.style.windowTitle;$CS.div.innerHTML='
'+cstitle+'
';$CS.div.className='consultsystems';if($CS.fixedSupport){$CS.div.className+=' consultsystems_fixed'} if(window.CSEditorMode){$el("export-preview").appendChild($CS.div);$CS.div.style.position="absolute"}else{document.body.appendChild($CS.div);} $CS.sizes={titleHeight:37,bottomHeight:12} if(!window.CSEditorMode){var dragndrop=new drag("dragndrop");dragndrop.init({id:"consultsystems_title",target:$CS.div.id,min:$CS.min,max:$CS.max});var resizer=new drag("resize");resizer.init({id:"consultsystems_resizer",target:$CS.div.id,min:$CS.min,max:$CS.max});} if(!$CS.fixedSupport){addEvent(window,"scroll",function(e){$CS.scrolltop=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop;if($CS.div){$CS.div.style.top=($CS.offset.y+$CS.scrolltop)+"px";}});} addEvent(window,"resize",function(e){shake();});} else{removeClass($CS.div,"consultsystems_closed");} var w=$CS.savedSize[0]||parseFloat($CS.div.offsetWidth)||$CS.min[0];var h=$CS.savedSize[1]||parseFloat($CS.div.offsetHeight)||$CS.min[1];if($CS.fixedSupport){if($CS.opener){var ho={};}else{var ho=hiddenOffsetDetermine(w,h);} divpos(from_x||ho.left||0,(from_y||ho.top||0)+$CS.scrolltop,0,0);var sht=0;if(!window.CSEditorMode&&!$CS.preopen){addClass($CS.div,"consultsystems_hidden");setTimeout(function(){addClass($CS.div,"consultsystems_pre")},2);sht=15;} setTimeout(show,sht);} else{show();} function show(){if(typeof(window.webconsult_clientinfo)!="undefined"){getJSONP($CS.urlParams+"&site_id=31209¶ms="+encodeURIComponent(JSON.stringify(window.webconsult_clientinfo))+"&rnd="+$CS.getUnixTime(),$CS.callbackParams,function(data){});} if($CS.needReload){document.getElementById('consultsystems_iframe').src=document.getElementById('consultsystems_iframe').src;$CS.needReload=false;} postop=$CS.offset.y+$CS.scrolltop;divpos($CS.offset.x,postop,w,h);addClass($CS.div,"consultsystems_visible");setTimeout(function(){removeClass($CS.div,"consultsystems_pre");adjust()},333);var d=new Date();var n=new Date(d.getTime()+1000*3600);setCookie("bubbleclose","1",{expires:n,path:"/"});shake();} if($CS.toggleHide){$CS.hideTarget();}} $CS.showWindow=$CS.show;$CS.hide=function(x,y,from_x,from_y){if(window.CSEditorMode){return false;} $CS.opened=false;$CS.preopen=false;var d=new Date();var n=new Date(d.getTime()+1000*3600*24*30);setCookie("consultsystemswindow","hide|"+$CS.savedOffset.x+"|"+$CS.savedOffset.y+"|"+$CS.savedSize[0]+"|"+$CS.savedSize[1],{expires:n,path:"/"});if($CS.div){var with_arguments=true;if(arguments.length==1&&typeof arguments[2]=="object"&&arguments[2].nodeType==1){var obj=arguments[0];x=from_x=obj.offsetLeft;y=from_y=obj.offsetTop;} else if(arguments.length==3&&typeof arguments[2]=="object"&&arguments[2].nodeType==1){var obj=arguments[2];from_x=obj.offsetLeft;from_y=obj.offsetTop;} else{with_arguments=false;from_x=$CS.opener.x;from_y=$CS.opener.y;} if(!$CS.opener.fixed){from_y-=(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop);} x=x||from_x;y=y||from_y;var w=parseFloat($CS.div.offsetWidth)||$CS.min[0];var h=parseFloat($CS.div.offsetHeight)||$CS.min[1];if($CS.fixedSupport){addClass($CS.div,"consultsystems_pre");removeClass($CS.div,"consultsystems_visible");setTimeout(hide,5);}else{hide();addClass($CS.div,"consultsystems_closed")}} function hide(){if(with_arguments){var ho=hiddenOffsetDetermine(w,h);}else{var ho={}} divpos(from_x||ho.left||0,(from_y||ho.top||0)+$CS.scrolltop,0,0);addClass($CS.div,"consultsystems_hidden");setTimeout(function(){removeClass($CS.div,"consultsystems_pre");addClass($CS.div,"consultsystems_closed");$CS.div.style.width=w+"px";$CS.div.style.height=h+"px";},333);} if($CS.toggleHide){$CS.showTarget();}} $CS.hideWindow=$CS.hide;$CS.endDialog=function(){if(confirm("Вы действительно хотите закончить диалог?")){getJSONP($CS.urlClose+"&site_id=31209&rnd="+$CS.getUnixTime(),$CS.callbackClose,function(data){if(data.data==true){$CS.hideWindow();$CS.needReload=true;}});}} $CS.toggle=function(){if($CS.opened){$CS.hide.apply(this,arguments);}else{$CS.show.apply(this,arguments);}} $CS.showTarget=function(){$CS.openTarget();setTimeout(function(){removeClass($CS.lastOpener,"consultsystems_button_hidden");},5)} $CS.getUnixTime=function(){d=new Date();return d.getTime();} $CS.hideTarget=function(){addClass($CS.lastOpener,"consultsystems_button_hidden");setTimeout($CS.closeTarget,500)} $CS.openTarget=function(){removeClass($CS.lastOpener,"consultsystems_button_closed")} $CS.closeTarget=function(){addClass($CS.lastOpener,"consultsystems_button_closed")} $CS.iframeRestyle=function(){window.$CSI=window.consultsystems_iframe.ConsultSystemsIframe;$CSI.style.fontMessage=$CS.style.windowFontMessage;$CSI.style.fontClient=$CS.style.windowFontClient;$CSI.style.fontCons=$CS.style.windowFontCons;$CSI.style.fontSystem=$CS.style.windowFontSystem;$CSI.sendOnEnter=$CS.style.windowSendOnEnter;$CSI.restyle();} $CS.iframeonload=function(){addClass($el("consultsystems_iframe_loading"),"consultsystems_iframe_loaded");$CS.iframe=window.consultsystems_iframe;if(window.CSEditorMode&&window.consultsystems_iframe){$CS.iframeRestyle()}} function isClickEvent(e){return(e&&typeof e=="object"&&e.type=="click");} function divpos(x,y,w,h){$CS.div.style.left=x+"px";$CS.div.style.top=y+"px";$CS.div.style.width=w+"px";$CS.div.style.height=h+"px";} function hiddenOffsetDetermine(w,h){var offsetLeft=$CS.offset.x;var offsetRight=$CS.window.innerWidth-$CS.offset.x-(parseFloat($CS.div.offsetWidth)||$CS.min[0]) var off={};if(offsetLeft>=offsetRight){off.top=0;off.left=$CS.window.innerWidth+w;}else{off.top=0;off.left=-w;} return off;} function shake(){browserWindow();var w=$CS.savedSize[0]||parseFloat($CS.div.offsetWidth)||$CS.min[0];var h=$CS.savedSize[1]||parseFloat($CS.div.offsetHeight)||$CS.min[1];if(w>$CS.window.innerWidth){w=$CS.window.innerWidth;} if(h>$CS.window.innerHeight){h=$CS.window.innerHeight;} if(w<$CS.min[0]){w=$CS.min[0]} if(h<$CS.min[1]){h=$CS.min[1]} $CS.div.style.width=w+"px";$CS.div.style.height=h+"px";$CS.savedSize=[w,h];autoDrag({target:$CS.div,width:w,height:h},$CS.offset.x,$CS.offset.y+$CS.scrolltop);} function $el(e){return document.getElementById(e);} function adjust(){if($CS.isIE7){var iframeHeight=($CS.div.offsetHeight||parseInt($CS.div.style.height))-($CS.sizes.titleHeight+$CS.sizes.bottomHeight);$el("consultsystems_iframe").style.height=iframeHeight+"px";$el("consultsystems_iframe_div").style.height=(iframeHeight+4)+"px";$el("consultsystems_iframe_over").style.height=iframeHeight+"px";$el("consultsystems_iframe_loading").style.height=iframeHeight+"px";}} function addClass(o,c){if(o){var re=new RegExp("(^|\\s)"+c+"(\\s|$)","g") if(re.test(o.className))return o.className=(o.className+" "+c).replace(/\s+/g," ").replace(/(^ | $)/g,"")}} function removeClass(o,c){if(o){var re=new RegExp("(^|\\s)"+c+"(\\s|$)","g") o.className=o.className.replace(re,"$1").replace(/\s+/g," ").replace(/(^ | $)/g,"")}} function hasClass(obj,className){if(typeof obj=='undefined'||obj==null||!RegExp){return false;} var re=new RegExp("(^|\\s)"+className+"(\\s|$)");if(typeof(obj)=="string"){return re.test(obj);} else if(typeof(obj)=="object"&&obj.className){return re.test(obj.className);} return false;} function browserWindow(){var winw,winh,dbody=document.body,delem=document.documentElement;ww=window;if(dbody&&dbody.offsetWidth){winw=dbody.offsetWidth;winh=dbody.offsetHeight;} if(document.compatMode=='CSS1Compat'&&delem&&delem.offsetWidth){winw=delem.offsetWidth;winh=delem.offsetHeight;} if(ww.innerWidth&&ww.innerHeight){winw=ww.innerWidth;winh=ww.innerHeight;} var dcw=dbody.clientWidth;var dch=dbody.clientHeight;var ddcw=delem.clientWidth;var ddch=delem.clientHeight;$CS.window.width=winw;$CS.window.height=winh;if(ddcw>dcw&&ddcwdch&&ddch<=winh)||(ddch0)){$CS.window.innerHeight=ddch;}else{$CS.window.innerHeight=dch;}} function browserPositionFixed(){var testDiv=document.createElement("div");testDiv.id="testingPositionFixed";testDiv.style.position="fixed";testDiv.style.top="0px";testDiv.style.right="0px";document.body.appendChild(testDiv);var offset=1;var supported=false;if(typeof testDiv.offsetTop=="number"){if(testDiv.offsetTop!=null){if(testDiv.offsetTop!="undefined"){offset=parseInt(testDiv.offsetTop);}}} if(offset===0){supported=true;} document.body.removeChild(testDiv) return supported;} function browserQuirksMode(){if(document.createElement){var el=document.createElement('div');if(el&&el.style){el.style.width='1';} return el.style.width==='1px';}} function drag(type){this.type=type;this.md=false;} drag.prototype={init:function(params){this.params=params;this.elem=$el(this.params.id);this.target=$el(this.params.target);this.elem.onmousedown=this._mouseDown.bind(this);if($CS.touchSupport){this.elem.ontouchstart=this._mouseDown.bind(this);}},_mouseDown:function(e){this.md=true;browserWindow();e=e||window.event;this.elem.onselectstart=function(){return false};this._event_docMouseMove=this._docMouseMove.bind(this);this._event_docMouseUp=this._docMouseUp.bind(this);if(this.onstart)this.onstart();this.x=e.clientX||e.pageX;this.y=e.clientY||e.pageY;if(e.type=="touchstart"){this.x=event.touches[0].pageX;this.y=event.touches[0].pageY;} this.left=parseFloat(this.target.offsetLeft);this.top=parseFloat(this.target.offsetTop);this.width=parseFloat(this.target.offsetWidth);this.height=parseFloat(this.target.offsetHeight);addEvent(document,'mousemove',this._event_docMouseMove);addEvent(document,'mouseup',this._event_docMouseUp);if($CS.touchSupport){addEvent(document,'touchmove',this._event_docMouseMove);addEvent(document,'touchend',this._event_docMouseUp);} $CS.offset={x:this.left,y:this.top} addClass($el("consultsystems_iframe_over"),"consultsystems_iframe_over_show");return false;},_docMouseMove:function(e){if(this.md){this.setValuesClick(e);if(this.ondrag)this.ondrag();}},_docMouseUp:function(e){this.md=false;removeEvent(document,'mousemove',this._event_docMouseMove);if($CS.touchSupport){removeEvent(document,'touchmove',this._event_docMouseMove)} if(this.onstop)this.onstop();removeEvent(document,'mouseup',this._event_docMouseUp);if($CS.touchSupport){removeEvent(document,'touchend',this._event_docMouseMove)} this.width=parseFloat(this.target.offsetWidth);this.height=parseFloat(this.target.offsetHeight);removeClass($el("consultsystems_iframe_over"),"consultsystems_iframe_over_show");},setValuesClick:function(e){this.mouseX=e.clientX||e.pageX;this.mouseY=e.clientY||e.pageY;if(e.type=="touchmove"){this.mouseX=event.touches[0].pageX;this.mouseY=event.touches[0].pageY;} this.X=this.left+this.mouseX-this.x;this.Y=this.top+this.mouseY-this.y;if(this.X<0){this.X=0} if(this.Y<0){this.Y=0} if(this.type=="dragndrop"){autoDrag(this,this.X,this.Y);} else if(this.type=="resize"){var w=e.clientX||e.pageX;var h=e.clientY||e.pageY;if(e.type=="touchmove"){w=event.touches[0].pageX;h=event.touches[0].pageY-(window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop);} w=w-this.left+5;h=h-this.top+5;autoResize(this,w,h);}}} function autoDrag(wdg,x,y){if(y-$CS.scrolltop<0){y=$CS.scrolltop} if(x+wdg.width>$CS.window.innerWidth){x=$CS.window.innerWidth-wdg.width} if(y+wdg.height-$CS.scrolltop>$CS.window.innerHeight){y=$CS.window.innerHeight-wdg.height+$CS.scrolltop} $CS.offset={x:x,y:y-$CS.scrolltop} $CS.savedOffset=$CS.offset;wdg.target.style.left=x+"px";wdg.target.style.top=y+"px";save();} function autoResize(wdg,w,h){var oh=h;h=h+$CS.scrolltop;if(wwdg.params.max[0]){w=wdg.params.max[0]} if(h>wdg.params.max[1]){h=wdg.params.max[1]} if(h$CS.window.innerWidth){w=$CS.window.innerWidth-$CS.offset.x} if(h+$CS.offset.y>$CS.window.innerHeight){h=$CS.window.innerHeight-$CS.offset.y} wdg.X=wdg.left;wdg.Y=wdg.top-$CS.scrolltop;if(w>$CS.window.innerWidth){w=$CS.window.innerWidth;} if(h>$CS.window.innerHeight){h=$CS.window.innerHeight;} if(w<$CS.min[0]){w=$CS.min[0]} if(h<$CS.min[1]){h=$CS.min[1]} wdg.target.style.width=w+"px";wdg.target.style.height=h+"px";$CS.offset={x:wdg.X,y:wdg.Y} $CS.savedSize=[w,h];adjust();save();} var save=debounce(function(){var d=new Date();var n=new Date(d.getTime()+1000*3600*24*30);setCookie("consultsystemswindow","open|"+$CS.savedOffset.x+"|"+$CS.savedOffset.y+"|"+$CS.savedSize[0]+"|"+$CS.savedSize[1],{expires:n,path:"/"});},333);function getCookie(name){var matches=document.cookie.match(new RegExp("(?:^|; )"+name.replace(/([\.$?*|{}\(\)\[\]\\\/\+^])/g,'\\$1')+"=([^;]*)")) return matches?decodeURIComponent(matches[1]):undefined} function setCookie(name,value,props){props=props||{} var exp=props.expires if(typeof exp=="number"&&exp){var d=new Date() d.setTime(d.getTime()+exp*1000) exp=props.expires=d} if(exp&&exp.toUTCString){props.expires=exp.toUTCString()} value=encodeURIComponent(value) var updatedCookie=name+"="+value for(var propName in props){updatedCookie+="; "+propName var propValue=props[propName] if(propValue!==true){updatedCookie+="="+propValue}} document.cookie=updatedCookie} function deleteCookie(name){setCookie(name,null,{expires:-1})} function debounce(fn,timeout,invokeAsap,ctx){if(arguments.length==3&&typeof invokeAsap!='boolean'){ctx=invokeAsap;invokeAsap=false;} var timer;return function(){var args=arguments;ctx=ctx||this;invokeAsap&&!timer&&fn.apply(ctx,args);clearTimeout(timer);timer=setTimeout(function(){!invokeAsap&&fn.apply(ctx,args);timer=null;},timeout);}} function addEvent(elem,evType,fn){if(elem.addEventListener){elem.addEventListener(evType,fn,false);} else if(elem.attachEvent){elem.attachEvent('on'+evType,fn)} else{elem['on'+evType]=fn}} function removeEvent(element,type,handler){if(element.removeEventListener){element.removeEventListener(type,handler,false);}else{if(element.events&&element.events[type]){delete element.events[type][handler.$$guid];}}} function styleTag(val){var head=document.getElementsByTagName('head')[0];var styletag=$el('consultsystems_style');if(window.CSEditorMode){if(styletag){head.removeChild(styletag);styletag=false;}} if(styletag){var append=true;var style=styletag;}else{var append=false;var style=document.createElement('style');style.type='text/css';style.id='consultsystems_style';} var rules=document.createTextNode(val);if(style.styleSheet){style.styleSheet.cssText=rules.nodeValue} else{style.appendChild(rules)} if(!append){head.appendChild(style);}} if(!Function.prototype.bind){Function.prototype.bind=function(){function newApply(Constructor,args){var i=0,len=args.length,argNames=[];while(i1?newApply(targetFunc,allArgs):(len?new targetFunc(allArgs[0]):new targetFunc);boundFunc.prototype=new NOP;boundFunc.prototype.constructor=boundFunc;return new boundFunc;} return len>1?targetFunc.apply(boundThis,allArgs):(len?targetFunc.call(boundThis,allArgs[0]):targetFunc.call(boundThis));} boundFunc._protoMagic=false;return boundFunc;};}();} function extend(what,add){if(!add){add={}};if(typeof what=="object"&&typeof add=="object"){for(var prop in add){what[prop]=add[prop];} return what;}} if(document.getElementsByClassName){getElementsByClass=function(classList,node){return(node||document).getElementsByClassName(classList)}}else{getElementsByClass=function(classList,node){var node=node||document,list=node.getElementsByTagName('*'),length=list.length,classArray=classList.split(/\s+/),classes=classArray.length,result=[],i,j for(i=0;i