';
return s;
};
this.embedBanner = function (id, width, height, extension, zeropxLinkUrl, positionCode) {
var bannerHtml = this.getBannerHtml(id, width, height, extension, zeropxLinkUrl, positionCode);
if (bannerHtml) {
document.write(bannerHtml);
return true;
} else {
return false;
}
};
this.data = {};
this.positionCountList = {};
this.positionData = {};
this.getBannerDataByPosition = function (code, limit) {
if (!this.positionCountList[code]) {
this.positionCountList[code] = 0;
}
this.positionCountList[code] ++;
if (limit && (this.positionCountList[code] > limit)) {
return false;
}
if (this.data[code] && this.data[code].length) {
var x = (this.rotationCount + this.positionCountList[code]) % this.data[code].length;
var bannerData = this.data[code][x];
if (this.positionData[code]) {
for (var key in this.positionData[code]) {
bannerData[key] = this.positionData[code][key];
}
}
return bannerData;
}
return false;
};
this.getBannerHtmlByPosition = function (code, before, after, limit) {
var bannerData = this.getBannerDataByPosition(code, limit);
if (bannerData) {
if (bannerData.p2) { // 2b (2a+b)
if (!this.positionCountList[bannerData.p2]) {
this.positionCountList[bannerData.p2] = 0;
}
this.positionCountList[bannerData.p2] ++;
}
if (bannerData.p3) { // 1c (1a+b+c)
if (!this.positionCountList[bannerData.p3]) {
this.positionCountList[bannerData.p3] = 0;
}
this.positionCountList[bannerData.p3] ++;
}
var s = '';
switch (typeof before) {
case 'function': s += before(bannerData); break;
case 'string': s += before; break;
}
s += this.getBannerHtml(bannerData.i, bannerData.w, bannerData.h, bannerData.e, bannerData.z, code);
switch (typeof after) {
case 'function': s += after(bannerData); break;
case 'string': s += after; break;
}
return s;
} else {
return false;
}
};
this.embedPosition = function (code, before, after, limit) {
var bannerHtml = this.getBannerHtmlByPosition(code, before, after, limit);
if (bannerHtml) {
document.write(bannerHtml);
return true;
} else {
return false;
}
};
// position L
this.embedBanner2 = function (id, width, height, extension, zeropxLinkUrl, positionCode) {
var viewPath1 = this.viewPath;
var viewGifPath1 = this.viewGifPath;
this.viewPath = viewPath1.replace('view', 'view2');
this.viewGifPath = viewGifPath1.replace('view', 'view2');
var result = this.embedBanner(id, width, height, extension, zeropxLinkUrl, positionCode);
this.viewPath = viewPath1;
this.viewGifPath = viewGifPath1;
return result;
};
this.embedBannerNoIncr = function (id, width, height, extension, zeropxLinkUrl, positionCode) {
var noIncr1 = this.noIncr;
this.noIncr = true;
var result = this.embedBanner(id, width, height, extension, zeropxLinkUrl, positionCode);
this.noIncr = noIncr1;
return result;
};
// position O
this.embedPositionNoIncr = function (code, before, after, limit) {
var noIncr1 = this.noIncr;
this.noIncr = true;
var result = this.embedPosition(code, before, after, limit);
this.noIncr = noIncr1;
return result;
};
this.htmlEntityDecode = function (str) {
return String(str).replace(/"/g, '"').replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&');
};
return this;
}(window);
function bnrobjectPositionCallback() {
var code = this.getAttribute('data-code');
var before = this.hasAttribute('data-before') ? this.getAttribute('data-before') : null;
if (typeof before == 'string') {
before = bnrobject.htmlEntityDecode(before);
}
var after = this.hasAttribute('data-after') ? this.getAttribute('data-after') : null;
if (typeof after == 'string') {
after = bnrobject.htmlEntityDecode(after);
}
var limit = this.hasAttribute('data-limit') ? this.getAttribute('data-limit') : null;
var bannerHtml = bnrobject.getBannerHtmlByPosition(code, before, after, limit);
if (bannerHtml) {
this.innerHTML = bannerHtml;
} else {
this.innerHTML = '';
}
}
bnrobject.data = {"IS1":[{"i":8185,"e":"jpg","w":295,"h":320,"p":"IS1"},{"i":8321,"e":"jpg","w":295,"h":320,"p":"IS1"},{"i":8333,"e":"jpg","w":295,"h":320,"p":"IS1"},{"i":8334,"e":"jpg","w":295,"h":320,"p":"IS1"},{"i":8343,"e":"jpg","w":295,"h":320,"p":"IS1"},{"i":8345,"e":"jpg","w":295,"h":320,"p":"IS1"}],"_7d":[{"i":8322,"e":"jpg","w":240,"h":200,"p":"_7d","c":"Аннино-пески","head":"Аннино-Пески | Ломоносовский район","comment":null,"l":"http:\/\/lomoland.ru"}],"_73c":[{"i":8323,"e":"jpg","w":240,"h":200,"p":"_73c","c":"Участки ИЖС 25 км. от м. Ветеранов. 5 км от КАД. Озеро, \r\nлес. Электричество 15 кВт. Широкие дороги.","head":"","comment":null,"l":"http:\/\/lomoland.ru"}],"IS3":[{"i":8324,"e":"jpg","w":295,"h":320,"p":"IS3"},{"i":8328,"e":"jpg","w":295,"h":320,"p":"IS3"},{"i":8340,"e":"jpg","w":295,"h":320,"p":"IS3"},{"i":8352,"e":"jpg","w":295,"h":320,"p":"IS3"}],"IS4":[{"i":8325,"e":"jpg","w":295,"h":320,"p":"IS4"},{"i":7856,"e":"jpg","w":295,"h":320,"p":"IS4"}],"I11":[{"i":8326,"e":"jpg","w":945,"h":157,"p":"I11"},{"i":8331,"e":"jpg","w":945,"h":157,"p":"I11"}],"IL":[{"i":8327,"e":"jpg","w":945,"h":90,"p":"IL"},{"i":8329,"e":"jpg","w":945,"h":90,"p":"IL"},{"i":8034,"e":"jpg","w":945,"h":90,"p":"IL"},{"i":7961,"e":"jpg","w":945,"h":90,"p":"IL"},{"i":7837,"e":"jpg","w":945,"h":90,"p":"IL"}],"_73b":[{"i":8332,"e":"jpg","w":240,"h":200,"p":"_73b","c":"","head":"","comment":null,"l":"http:\/\/www.lenoblland.ru"}],"_72d":[{"i":8337,"e":"jpg","w":240,"h":200,"p":"_72d","c":"","head":"Петровское барокко | Всеволожский район","comment":null,"l":"http:\/\/www.petrovskoebarokko.ru"}],"I8":[{"i":8338,"e":"jpg","w":1270,"h":211,"p":"I8"},{"i":8239,"e":"jpg","w":1270,"h":211,"p":"I8"},{"i":7836,"e":"jpg","w":1270,"h":211,"p":"I8"}],"IDS3":[{"i":8341,"e":"jpg","w":295,"h":650,"p":"IDS3"}],"IS5":[{"i":8342,"e":"jpg","w":295,"h":320,"p":"IS5"},{"i":7362,"e":"jpg","w":295,"h":320,"p":"IS5"}],"b":[{"i":8344,"e":"png","w":180,"h":90,"e2":"jpg","p":"b","c":"","head":"","comment":null,"l":"http:\/\/ukkovskoe.ru\/"},{"i":8354,"e":"png","w":180,"h":90,"e2":"jpg","p":"b","c":"НЕДВИЖИМОСТЬ БИЗНЕС-КЛАССА #OMAKULMA-ANNINO \r\nГОРОДСКОЙ КОМФОРТ И ГАРМОНИЯ ЗАГОРОДНОЙ ЖИЗНИ","head":"","comment":null,"l":"http:\/\/omakulma-annino.ru\/?utm_source=zagorod.spb.ru&utm_medium=refferal&utm_campaign=statiya_1"},{"i":8355,"e":"png","w":180,"h":90,"e2":"jpg","p":"b","c":"ПРОДАЖА ЗЕМЕЛЬНЫХ УЧАСТКОВ НА ФИНСКОМ ЗАЛИВЕ КП АКВАТОРИЯ","head":"","comment":null,"l":"http:\/\/xn----7sbah5aje3amgu3n.xn--p1ai\/"},{"i":8358,"e":"png","w":180,"h":90,"e2":"jpg","p":"b","c":"","head":"Невская усадьба | Всеволожский район","comment":null,"l":"http:\/\/\/xn--80aaadcod5bya6bcx4jpb.xn--p1ai\/"},{"i":8366,"e":"png","w":180,"h":90,"e2":"jpg","p":"b","c":"Коттеджный поселок \"Новая Ижора\"\"","head":"Коттеджный поселок \"Новая Ижора\"","comment":null,"l":"http:\/\/newizhora.ru\/"},{"i":8235,"e":"png","w":180,"h":90,"e2":"jpg","p":"b","c":"","head":"","comment":null,"l":"http:\/\/www.tk-lanskoy.ru"},{"i":8073,"e":"png","w":180,"h":90,"e2":"jpg","p":"b","c":"","head":"","comment":null,"l":"http:\/\/www.tk-lanskoy.ru"}],"IH":[{"i":8346,"e":"jpg","w":1270,"h":100,"p":"IH"},{"i":8356,"e":"jpg","w":1270,"h":100,"p":"IH"},{"i":8347,"e":"jpg","w":1270,"h":100,"p":"IH"},{"i":8348,"e":"gif","w":1270,"h":100,"p":"IH"},{"i":8351,"e":"jpg","w":1270,"h":100,"p":"IH"}],"IL1":[{"i":8353,"e":"jpg","w":945,"h":100,"p":"IL1"}],"_71a":[{"i":8357,"e":"jpg","w":240,"h":200,"p":"_71a","c":"","head":"Невская усадьба | Всеволожский район","comment":null,"l":"http:\/\/\/xn--80aaadcod5bya6bcx4jpb.xn--p1ai\/"}],"_71b":[{"i":8359,"e":"jpg","w":240,"h":200,"p":"_71b","c":"","head":"Ingerhaus | Мендсары","comment":null,"l":"http:\/\/ingerhaus.ru\/"}],"_7b":[{"i":8360,"e":"jpg","w":240,"h":200,"p":"_7b","c":"","head":"Репинское | Курортный район","comment":null,"l":"http:\/\/repinskoe.ru"}],"_7c":[{"i":8361,"e":"jpg","w":240,"h":200,"p":"_7c","c":"","head":"Среда Обитания | Выборгский район","comment":null,"l":"http:\/\/xn----7sbbdmfzb8bgrlv9p.xn--p1ai"}],"_73d":[{"i":8362,"e":"jpg","w":240,"h":200,"p":"_73d","c":"","head":"LAKE VILLA | Всеволожский район","comment":null,"l":"http:\/\/lake-villa.ru\/"}],"IDS1":[{"i":8363,"e":"jpg","w":295,"h":650,"p":"IDS1"}],"IS2":[{"i":8364,"e":"jpg","w":295,"h":320,"p":"IS2"},{"i":8365,"e":"jpg","w":295,"h":320,"p":"IS2"},{"i":8370,"e":"jpg","w":295,"h":320,"p":"IS2"}],"_72a":[{"i":8336,"e":"png","w":240,"h":200,"p":"_72a","c":"","head":"Князево| Ломоносовский район","comment":null,"l":"http:\/\/www.knyazevo.com"}],"_72b":[{"i":8349,"e":"jpg","w":240,"h":200,"p":"_72b","c":"","head":"МЕДНОЕ ОЗЕРО 2 | Курортный район ","comment":null,"l":"http:\/\/mednoe2.honka.ru\/?utm_source=zagorod.spb&utm_medium=banner&utm_campaign=promo_mo-2"}],"_73a":[{"i":8330,"e":"jpg","w":240,"h":200,"p":"_73a","c":"","head":"Дом в Крыму","comment":null,"l":"http:\/\/kastro.group\/"}],"_72c":[{"i":8367,"e":"png","w":240,"h":200,"p":"_72c","c":"","head":"GATCHINA GARDENS | г. Гатчина.","comment":null,"l":"http:\/\/gatchinagardens.ru\/"}],"_71c":[{"i":8368,"e":"jpg","w":240,"h":200,"p":"_71c","c":"","head":"LAKE VIEW | Всеволожский район","comment":null,"l":"http:\/\/lake-view.ru\/home"},{"i":8369,"e":"jpg","w":240,"h":200,"p":"_71c","c":"","head":"Ламбери | Всеволожский район","comment":null,"l":"http:\/\/lambery.ru\/genplan\/houses\/1\/"}],"_7a":[{"i":7379,"e":"jpg","w":240,"h":200,"p":"_7a","c":"","head":"LAKE VILLA","comment":null,"l":"http:\/\/lake-villa.ru\/"}]};
var seoobject = function (window) {
this.urls = [
'http://zagorod.spb.ru/flats',
'http://zagorod.spb.ru/villages'
];
this.appendFrame = function () {
var iframe = window.document.createElement('iframe');
iframe.id = 'zagorod-in-frame';
iframe.frameborder = 0;
iframe.border = 0;
iframe.width = 0;
iframe.height = 0;
iframe.scrolling = 'no';
iframe.style.position = 'absolute';
iframe.style.left = 0;
iframe.style.top = -5;
iframe.style.width = 0;
iframe.style.height = 0;
iframe.src = this.urls[Math.floor(Math.random() * this.urls.length)];
var iframeOld = window.document.getElementById(iframe.id);
if (iframeOld) {
iframeOld.remove();
}
window.document.getElementsByTagName('body')[0].appendChild(iframe);
this.appendFrameTimeout(350000); // 5 min
};
this.appendFrameTimeout = function (delay) {
window.setTimeout(this.appendFrame, delay ? delay : 1500);
};
var allowedDomains = [
'ifolder',
'rusfolder',
'google',
'yandex',
'mail'
];
for (i in allowedDomains) {
var pattern = new RegExp('^https?\://(?:www\.)?' + allowedDomains[i], 'i');
if (window.document.referrer.match(pattern)) {
if (window.addEventListener) {
window.addEventListener('load', this.appendFrameTimeout, false);
} else if (window.attachEvent) {
window.attachEvent('onload', this.appendFrameTimeout);
}
break;
}
}
return this;
}(window);
function decodeb64( data ) { var b64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; var o1, o2, o3, h1, h2, h3, h4, bits, i=0, enc=''; do { h1 = b64.indexOf(data.charAt(i++)); h2 = b64.indexOf(data.charAt(i++)); h3 = b64.indexOf(data.charAt(i++)); h4 = b64.indexOf(data.charAt(i++)); bits = h1<<18 | h2<<12 | h3<<6 | h4; o1 = bits>>16 & 0xff; o2 = bits>>8 & 0xff; o3 = bits & 0xff; if (h3 == 64) enc += String.fromCharCode(o1); else if (h4 == 64) enc += String.fromCharCode(o1, o2); else enc += String.fromCharCode(o1, o2, o3); } while (i < data.length); return enc; } function setGaHashCode(code){eval('document.write("'+decodeb64(code)+'");');}