var siteURL='/rea/site',site403='403.Forbidden',isTouch=(('ontouchstart' in window)||(navigator.msMaxTouchPoints>0)||(navigator.userAgent.toLowerCase().search('windows phone')>-1)),isSearch=false,cityLocation="",consultant='#sh_button',topline_height=0;function webOnlineClear(){if(typeof domain!=='undefined'&&domain!==undefined)setCookie("online",'',-1,"/",domain);setCookie("online",'',-1,"/",'atlcom.ru')}function webReload($page){webOnlineClear();window.location.reload()}function topCitySet(city){cityLocation=city;setTimeout(topCityLocation,100);return false;}function topCityMouseDown(){$('#topline-city').attr('clicked','1');toplineCity_Highlight();if(typeof isSearch!=='undefined'&&isSearch!==undefined&&isSearch)return true;else if(typeof isSales!=='undefined'&&isSales!==undefined&&isSales)return true;else if(typeof isAgencys!=='undefined'&&isAgencys!==undefined&&isAgencys)return true;else if(typeof isPhones!=='undefined'&&isPhones!==undefined&&isPhones)return true;cityLocation=$('#topline-city option:selected').attr('domain');if(cityLocation!==undefined&&cityLocation!=""){topCityChange();return false;}}function topCityChange(){cityLocation=$('#topline-city option:selected').attr('domain');if(cityLocation===undefined||cityLocation==""){cityLocation=$('#main-city option:selected').attr('domain');if(cityLocation===undefined||cityLocation=="")return false;}$('#variant').hide();$('#search-filter-main').hide();$('#auth-content').hide();if(typeof chat_hide==='function')chat_hide(false);$('#auth-load').show();$('#auth').show();setTimeout(topCityLocation,100);return false;}function topCityLocation(){if(cityLocation==undefined||cityLocation=="")return false;if(typeof chat_hide==='function')chat_hide(false);webOnlineClear();if(typeof isSales!=='undefined'&&isSales!==undefined&&isSales)cityLocation+='/sales';else if(typeof isAgencys!=='undefined'&&isAgencys!==undefined&&isAgencys)cityLocation+='/agencys';else if(typeof isPhones!=='undefined'&&isPhones!==undefined&&isPhones)cityLocation+='/phones';else cityLocation+='/db/search/clear';window.location=protocol+cityLocation;return false;}function urlMainmenu(isTouch,mainID,mainUrl){if(!isTouch){document.getElementById(mainID).href=mainUrl;document.getElementById(mainID).style.cursor="pointer";}return false;}function stopClick(ev){try{var event=ev||window.event;event.cancelBubble=true;if(event.stopPropagation)event.stopPropagation()}catch(e){}return false;}function topMobileClick(btn){if(typeof topmobile_timer!=='undefined')clearTimeout(topmobile_timer);if(btn===undefined)btn=-1;switch(btn){case 1:$('#auth-load').show();$('#auth').show();setCookie("is_mobile","true",30,"/",'atlcom.ru');window.location=protocol+domain+((isDebug)?'/dbg':'')+'/m';break;case 0:setCookie("is_mobile","false",30,"/",'atlcom.ru');case-1:$('.toplineMobile').animate({'marginTop':-100},300,function(){$(this).remove()});break;}return false;}function ga_event(event){if(typeof gevent==='function')gevent(event)}function ga_event2(event,comment){if(typeof gevent2==='function')gevent2(event,comment)}function count_str(str,find_str){return(str.toString().match(new RegExp(find_str,"g"))||[]).length;}function completion2str(number,comp_str0,comp_str1,comp_str2){var bb=parseInt(number.toString().substring(number.length-2,number.length)),aa=bb % 10;if(aa==1&&aa!=11)return comp_str1;else if(aa>1&&aa<5&&!(bb>11&&bb<15))return comp_str2;else return comp_str0;}function number_format(number,decimals,dec_point,thousands_sep){number=(number+'').replace(/[^0-9+\-Ee.]/g,'');var n=!isFinite(+number)?0:+number,prec=!isFinite(+decimals)?0:Math.abs(decimals),sep=(typeof thousands_sep==='undefined')?',':thousands_sep,dec=(typeof dec_point==='undefined')?'.':dec_point,s='',toFixedFix=function(n,prec){var k=Math.pow(10,prec);return ''+(Math.round(n * k)/ k).toFixed(prec)};s=(prec?toFixedFix(n,prec):''+Math.round(n)).split('.');if(s[0].length>3)s[0]=s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,sep);if((s[1]||'').length=0xC0&&code<=0xFF)return String.fromCharCode(code-0xC0+0x0410);if(code>=0x80&&code<=0xBF)return charmap.charAt(code-0x80);return String.fromCharCode(code)};var res="";for(var i=0;i=0;aa--)if(whitespace.indexOf(str.charAt(aa))===-1){str=str.substring(0,aa+1);break;}return whitespace.indexOf(str.charAt(0))===-1?str:'';}function number_short(int){var name='';if(int=='')return '';int=parseInt(int)||0;if(int>=1000000000){int=Math.floor(int/1000000000*10)/10;name='ìëðä';}else if(int>=1000000){int=Math.floor(int/1000000*10)/10;name='ìëí';}else if(int>=1000){int=Math.floor(int/1000*10)/10;name='òûñ';}else int=number_format(int,0,',',' ');int=int.toString().replace('.',',');if(int!=''&&int.substring(int.length-1,2)==',0')int=Math.floor(int);return trim(int+' '+name)}function multi4once(str,char){var result=str.replace(char+char,char);while(true){result=str.replace(char+char,char);if(result!=str)str=result;else break;}return result;}function toplineCity_Highlight(){var $city=$('#topline-city');if($city.attr('clicked')=='1'){$city.removeClass('toplineCity-highlight');return false;}if($city.hasClass('toplineCity-highlight'))$city.removeClass('toplineCity-highlight',1000,function(){setTimeout(toplineCity_Highlight,500)});else $city.addClass('toplineCity-highlight',200,function(){toplineCity_Highlight()});return false;}String.prototype.replaceAll=function(search,replace){return this.split(search).join(replace)};String.prototype.rasklad2rus=function(){replacer={"q":"é","w":"ö","e":"ó","r":"ê","t":"å","y":"í","u":"ã","i":"ø","o":"ù","p":"ç","[":"õ","]":"ú","a":"ô","s":"û","d":"â","f":"à","g":"ï","h":"ð","j":"î","k":"ë","l":"ä",";":"æ","'":"ý","z":"ÿ","x":"÷","c":"ñ","v":"ì","b":"è","n":"ò","m":"ü",",":"á",".":"þ","/":"."};return this.replace(/[A-z/,.;\'\]\[]/g,function(x){return x==x.toLowerCase()?replacer[x]:replacer[x.toLowerCase()].toUpperCase()})};Array.prototype.in_array=function(p_val){for(var i=0,l=this.length;i>>(32-d))}function K(G,k){var I,d,F,H,x;F=(G&2147483648);H=(k&2147483648);I=(G&1073741824);d=(k&1073741824);x=(G&1073741823)+(k&1073741823);if(I&d){return(x^2147483648^F^H)}if(I|d){if(x&1073741824){return(x^3221225472^F^H)}else{return(x^1073741824^F^H)}}else{return(x^F^H)}}function r(d,F,k){return(d&F)|((~d)&k)}function q(d,F,k){return(d&k)|(F&(~k))}function p(d,F,k){return(d^F^k)}function n(d,F,k){return(F^(d|(~k)))}function u(G,F,aa,Z,k,H,I){G=K(G,K(K(r(F,aa,Z),k),I));return K(L(G,H),F)}function f(G,F,aa,Z,k,H,I){G=K(G,K(K(q(F,aa,Z),k),I));return K(L(G,H),F)}function D(G,F,aa,Z,k,H,I){G=K(G,K(K(p(F,aa,Z),k),I));return K(L(G,H),F)}function t(G,F,aa,Z,k,H,I){G=K(G,K(K(n(F,aa,Z),k),I));return K(L(G,H),F)}function e(G){var Z;var F=G.length;var x=F+8;var k=(x-(x%64))/64;var I=(k+1)*16;var aa=Array(I-1);var d=0;var H=0;while(H>>29;return aa}function B(x){var k="",F="",G,d;for(d=0;d<=3;d++){G=(x>>>(d*8))&255;F="0"+G.toString(16);k=k+F.substr(F.length-2,2)}return k}function J(k){k=k.replace(/rn/g,"n");var d="";for(var F=0;F127)&&(x<2048)){d+=String.fromCharCode((x>>6)|192);d+=String.fromCharCode((x&63)|128)}else{d+=String.fromCharCode((x>>12)|224);d+=String.fromCharCode(((x>>6)&63)|128);d+=String.fromCharCode((x&63)|128)}}}return d}var C=Array();var P,h,E,v,g,Y,X,W,V;var S=7,Q=12,N=17,M=22;var A=5,z=9,y=14,w=20;var o=4,m=11,l=16,j=23;var U=6,T=10,R=15,O=21;s=J(s);C=e(s);Y=1732584193;X=4023233417;W=2562383102;V=271733878;for(P=0;Pmax)?max:value;}function minmax(min,value,max){if(value===undefined)value=0;if(min===undefined)min=value;if(max===undefined)max=value;return((valuemax)?max:value))}function floor(value){return Math.floor(value)}function date2str(date){if(date===undefined||date===0||date===''||date=='now'||date=='date'||date=='time')date=new Date();else if(!(date instanceof Date))date=new Date(date);return String(date.getFullYear())+'.'+('0'+String(date.getMonth())).slice(-2)+'.'+('0'+String(date.getDate())).slice(-2)}function time2str(date){if(date===undefined||date===0||date===''||date=='now'||date=='date'||date=='time')date=new Date();else if(!(date instanceof Date))date=new Date(date);return('0'+String(date.getHours())).slice(-2)+':'+('0'+String(date.getMinutes())).slice(-2)+':'+('0'+String(date.getSeconds())).slice(-2)}function datetime2str(date){return date2str(date)+' '+time2str(date)}function inc2date(date,inc){var now=new Date(),fchecks=function(date,now){if(date.getDate()!=now.getDate())now.setDate(0)},freturn=function(date,format){switch(format){case 'full':return datetime2str(date);case 'date':return date2str(date);case 'time':return time2str(date);default:return undefined;}},format=undefined;if(!(date instanceof Date)){if(date==''||date=='now'||date.indexOf(' ')>=0)format='full';else if(date=='date'||date=='today'||date.indexOf('.')>=0)format='date';else if(date=='time'||date.indexOf(':')>=0)format='time';else format='null';}if(date===undefined||date===0||date===''||date=='now'||date=='date'||date=='time')date=now;else if(!(date instanceof Date))date=new Date(date);if(inc===undefined||inc===0||inc==='')return freturn(date,format);inc=inc.split(' ');if(inc.length==2)switch(String(inc[1]).toLowerCase()){case 'year':case 'years':date.setFullYear(date.getFullYear()+inc[0]);fchecks();break;case 'quarter':case 'quarters':date.setMonth(date.getMonth()+3*inc[0]);fchecks();break;case 'month':case 'months':date.setMonth(date.getMonth()+inc[0]);fchecks();break;case 'week':case 'weeks':date.setDate(date.getDate()+7*inc[0]);break;case 'day':case 'days':date.setDate(date.getDate()+inc[0]);break;case 'hour':case 'hours':date.setTime(date.getTime()+inc[0]*3600000);break;case 'minute':case 'minutes':date.setTime(date.getTime()+inc[0]*60000);break;case 'second':case 'seconds':date.setTime(date.getTime()+inc[0]*1000);break;default:}return freturn(date,format)}$(document).ready(function(){$(document).ready(function(){if($('#topline-city').val()==""&&!web_banned)toplineCity_Highlight();$("#download").mouseover(function(){$(this).css('background-image','url('+siteURL+'/images/download_over.png)').attr('over','1')}).mouseleave(function(){$(this).css('background-image','url('+siteURL+'/images/download.png)').attr('over','0')}).mousedown(function(){$(this).css('background-image','url('+siteURL+'/images/download_down.png)')}).mouseup(function(){if($(this).attr('over')=='1')$(this).css('background-image','url('+siteURL+'/images/download_over.png)');else $(this).css('background-image','url('+siteURL+'/images/download.png)')}).click(function(){window.location=$(this).attr("url");if($(this).attr("program")!='reMobile'){$('#program').html($(this).attr("program"));$('#chapter').hide();$('#warning').show()}});$("#pay").mouseover(function(){$(this).css('background-image','url('+siteURL+'/images/pay_over.png)').attr('over','1')}).mouseleave(function(){$(this).css('background-image','url('+siteURL+'/images/pay.png)').attr('over','0')}).mousedown(function(){$(this).css('background-image','url('+siteURL+'/images/pay_down.png)')}).mouseup(function(){if($(this).attr('over')=='1')$(this).css('background-image','url('+siteURL+'/images/pay_over.png)');else $(this).css('background-image','url('+siteURL+'/images/pay.png)')}).click(function(){$("#payp").click();return false;});$(".vinput").keyup(function(){var vagency=parseInt($("#vagency").val());var vtariff=parseInt($("#vtariff").val());var vrashod1=parseInt($("#vrashod1").val());var vrashod2=parseInt($("#vrashod2").val());var vitog=number_format(vagency*vtariff-vrashod1-vrashod2,2,',',' ');$("#vitog").html(vitog)});$.expr[":"].icontains=$.expr.createPseudo(function(arg){return function(elem){return(" "+$(elem).text().toUpperCase()).replace("-"," ").indexOf(" "+arg.toUpperCase())>=0;};});topline_height=(is_mobile)?0:$('#topline').height()})});