строительство каркасного дома под ключ https://www.karkasnye-doma-pod-klyuch-krasnoyarsk.ru.
строительство каркасного дома под ключ https://www.karkasnye-doma-pod-klyuch-krasnoyarsk.ru.
(function() {
var dataUrl = ‘https://app.arnica.pro’.replace(/^https?:/,»»);
var contain,
d = document, bodyOldStyle, htmlOldStyle,
body = function() {
var buff = d.getElementsByTagName(‘body’);
return buff.item(0);
},
html = function() {
var buff = d.getElementsByTagName(‘html’);
return buff.item(0);
},
getMaxZIndex = function() {
var maxZIndex = 0;
if(typeof document.querySelectorAll !== ‘function’) {
return maxZIndex;
}
var tags = document.querySelectorAll(«body *»);
for(var i = 0; i < tags.length; i++) {
var element = tags.item(i);
var zindex=document.defaultView.getComputedStyle(element,null).getPropertyValue("z-index");
if (zindex != 'auto') {
zindex = parseInt(zindex);
if(zindex > maxZIndex) {
maxZIndex = zindex;
}
}
}
return maxZIndex;
},
openIframe = function(url) {
contain = d.createElement(‘div’);
var iframe = d.createElement(‘iframe’),
setIframeAttributes = function() {
iframe.setAttribute(‘style’, ‘width:100%;height:100%;border:none;’);
};
iframe.setAttribute(‘src’, url);
setIframeAttributes();
contain.setAttribute(‘style’, ‘position:fixed; top:0; left:0; width: 100%; height: 100%; text-align: center; z-index: ‘ + getMaxZIndex() + 1);
body().appendChild(contain);
contain.appendChild(iframe);
return contain;
},
removeScrolls = function() {
var h = html(),
b = body();
htmlOldStyle = h.getAttribute(‘style’);
bodyOldStyle = b.getAttribute(‘style’);
h.setAttribute(‘style’, ‘overflow: hidden !important’);
b.setAttribute(‘style’, ‘overflow: hidden !important’);
},
returnScrolls = function() {
var h = html(),
b = body();
h.setAttribute(‘style’, htmlOldStyle);
b.setAttribute(‘style’, bodyOldStyle);
},
isMobile = function() {
return /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(
navigator.userAgent.toLowerCase()
);
};
window.arnicaBooking = {
open: function() {
var self = this;
if(isMobile()) {
var win = window.open(this.getUrl(), ‘_blank’);
win.focus();
return;
}
var closeListener = function(event) {
if(event.data === «CloseBookingFrame») {
self.close();
if(window.addEventListener){
window.removeEventListener(«message», closeListener,false);
} else {
window.detachEvent(«onmessage», closeListener);
}
}
};
removeScrolls();
contain = openIframe(this.getUrl(true));
if(window.addEventListener){
window.addEventListener(«message», closeListener,false);
} else {
window.attachEvent(«onmessage», closeListener);
}
return false;
},
close: function() {
body().removeChild(contain);
returnScrolls();
return false;
},
getUrl: function(flag) {
return dataUrl + ‘/booking/booking?’ +
(flag ? ‘from=site&’ : ») + ‘orgid=24984’;
},
getZIndex : function () {
return getMaxZIndex() + 1;
}
};
window.onlineBooking = window.arnicaBooking;
})();
(function() {
if (!window.onlineBooking) {
throw «onlineBooking not exists»;
}
var aBooking = window.onlineBooking;
var id = ‘id’ + Math.round(Math.random()*10E9);
aBooking.placeButton = function(config) {
if (!config) {
return;
}
var button = document.createElement(‘a’);
button.setAttribute(‘id’, id);
button.setAttribute(‘style’, objectToStyleStr(config.style));
button.style[‘text-decoration’] = ‘none’;
setOnClick(button);
button.innerHTML = config.text;
var scrollWidth = Math.max(
document.body.scrollWidth, document.documentElement.scrollWidth,
document.body.offsetWidth, document.documentElement.offsetWidth,
document.body.clientWidth, document.documentElement.clientWidth
);
var scrollHeight = window.clientHeight || document.documentElement.clientHeight || document.body.clientHeight;
var body = document.getElementsByTagName(‘body’).item(0);
body.appendChild(button);
setTimeout(function() {
switch(config.orientation) {
case ‘left’:
case ‘right’:
if (config.deflection < 0.5) {
button.style.top = ((1 - button.offsetWidth / scrollHeight) * config.deflection * 100) + '%';
} else {
button.style.bottom = ((1 - config.deflection) * (scrollHeight - button.offsetWidth) +
(button.offsetWidth - button.offsetHeight)) + 'px';
}
break;
case 'bottom':
default:
if (config.deflection < 0.5) {
button.style.left = ((1 - button.offsetWidth / scrollWidth) * config.deflection * 100) + '%';
} else {
button.style.right = ((1 - config.deflection) * (1 - button.offsetWidth / scrollWidth) * 100) + '%';
}
}
}, 0);
};
function objectToStyleStr(object) {
var result = [];
for (var prop in object) {
if (object.hasOwnProperty(prop)) {
result.push(prop + ': ' + object[prop]);
}
}
result.push('z-index:'+onlineBooking.getZIndex());
return result.join(';');
}
function setOnClick(button) {
button.onclick = function (){
aBooking.open();
};
}
var loadListener = function(){
aBooking.placeButton({"text":"\u0417\u0430\u043f\u0438\u0441\u044c-\u043e\u043d\u043b\u0430\u0439\u043d","size":"medium","color":"b10da6","orientation":"bottom","deflection":0.46666666666667,"style":{"position":"fixed","cursor":"pointer","border":"2px solid","border-radius":"4px 4px 0 0","font-size":"16px","padding":"0 20px","height":"28px","line-height":"28px","color":"#EEE","text-shadow":"-1px -1px 0px rgba(0,0,0,0.3)","box-shadow":"inset 0px 0px 34px #73086c","border-color":"#d410c7","background-color":"#b10da6","bottom":0}});
};
if(window.addEventListener){
window.addEventListener("load", loadListener,false);
} else {
window.attachEvent("onload", loadListener);
}
})();