function getElementsByClassName(node,classname){if(node.getElementsByClassName){return node.getElementsByClassName(classname);}else{return(function getElementsByClass(searchClass,node){if(node==null)node=document; var classElements = [], els = node.getElementsByTagName("*"), elsLen = els.length, pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)"), i, j; for (i = 0, j = 0; i < elsLen; i++) { if ( pattern.test(els[i].className) ) { classElements[j] = els[i]; j++; } } return classElements; })(classname, node);}}
function processAnchors(prefix, hashTmp) { var anchors = getElementsByClassName(document, prefix + '-' + hashTmp); if (anchors && anchors.length > 0) { var a0 = 0; for (var ii = 0; ii < anchors.length; ii++) { var a = anchors[ii]; if (a.href && a.href.indexOf('an=') < 0) { a.href = a.href + '&an=' + a0; a0 = a0 + 1; } } } }
function addClassCreationPool(id, cssClassNew) {
var divPool = document.getElementById(id);
if (divPool) {
if (divPool.className.indexOf(cssClassNew) < 0) {
divPool.className += ' ' + cssClassNew;
}
}
}
function addStyle(styleText, idStyle) {
var createStyle = true;
if (idStyle) {
var styleExist = document.getElementById(idStyle);
if (styleExist) {
createStyle = false;
}
}
if (createStyle && styleText) {
var cssstyle = document.createElement("style");
if (cssstyle) {
if (idStyle) {
cssstyle.setAttribute('id', idStyle);
}
cssstyle.setAttribute('type', 'text/css');
var styles = document.createTextNode(styleText);
if (cssstyle.styleSheet) {
cssstyle.styleSheet.cssText = styles.nodeValue;
} else {
cssstyle.appendChild(styles);
}
var head = document.getElementsByTagName('head')[0];
if (head) {
head.appendChild(cssstyle);
}
}
}
}
function ofeOnLoad() {
}
function addScript(scriptHref, idScript) {
var createScript = true;
if (idScript) {
var scriptExist = document.getElementById(idScript);
if (scriptExist) {
createScript = false;
}
}
if (createScript && scriptHref) {
var script = document.createElement("script");
if (script) {
if (idScript) {
script.setAttribute('id', idScript);
}
script.setAttribute('type', 'text/javascript');
script.setAttribute('src', scriptHref);
script.onload=ofeOnLoad;
var head = document.getElementsByTagName('head')[0];
if (head) {
head.appendChild(script);
}
}
}
}
function includejQueryUI() {
var script = document.createElement('script');
script.setAttribute('id', 'ofe-jquery-ui');
script.src = 'https://www.oferteo.pl/scripts/jquery/jquery-ui-1.10.3.custom.min.js';
document.getElementsByTagName('head')[0].appendChild(script);
}
function includejQuery(callback) {
if(window.jQuery) {
if (callback) {
setTimeout(function() { callback(jQuery); }, 1000);
}
} else {
var script = document.createElement('script');
script.onload = function() {
jQuery.noConflict();
if (callback) {
callback(jQuery);
}
};
script.setAttribute('id', 'ofe-jquery');
script.src = 'https://www.oferteo.pl/scripts/jquery/jquery-1.9.1.min.js';
document.getElementsByTagName('head')[0].appendChild(script);
}
}
function creationframe(id, node, styleText, idStyle, idDiv, classDiv) {
var content = ' ';
iframe = document.createElement('iframe');
iframe.setAttribute("frameborder","0");
iframe.setAttribute("scrolling","no");
iframe.setAttribute("allowTransparency","true");
iframe.setAttribute("width","241px");
iframe.setAttribute("height","500");
src = 'data:text/html;charset=utf-8';
iframe.setAttribute("src", src );
//node.parentNode.insertBefore(iframe, node.nextSibling);
node.appendChild(iframe);
iframe.onload = function() {
var y = (iframe.contentWindow || iframe.contentDocument);
if (y.document)y = y.document;
var createStyle = true;
if (idStyle) {
var styleExist = y.getElementById(idStyle);
if (styleExist) {
createStyle = false;
}
}
if (createStyle) {
if (styleText) {
var cssstyle = document.createElement("style");
if (cssstyle) {
if (idStyle) {
cssstyle.setAttribute('id', idStyle);
}
cssstyle.setAttribute('type', 'text/css');
var styles = document.createTextNode(styleText);
if (cssstyle.styleSheet) {
cssstyle.styleSheet.cssText = styles.nodeValue;
} else {
cssstyle.appendChild(styles);
}
var iHead = y.getElementsByTagName('head')[0];
if (iHead) {
iHead.appendChild(cssstyle);
}
}
}
}
y.body.innerHTML = y.body.innerHTML = '' + content + '
';
}
}
var hash235 = '';
var _id235 = '';
hash235 = 'ofe-1000-235';
_id235 = 'ofe-1000-235';
var elements235 = getElementsByClassName(document, hash235);
if (elements235 == null || elements235.length == 0) {
hash235 = '1000-10999';
elements235 = getElementsByClassName(document, hash235);
}
if (elements235 == null || elements235.length == 0) {
hash235 = 'ofe-1000-10999';
elements235 = getElementsByClassName(document, hash235);
}
if (elements235 == null || elements235.length == 0) {
hash235 = '10999';
elements235 = getElementsByClassName(document, hash235);
}
if (elements235 == null || elements235.length == 0) {
hash235 = '235';
elements235 = getElementsByClassName(document, hash235);
}
if (elements235 && elements235.length > 0) {
for (var i = 0; i < elements235.length; i++) {
var e235 = elements235[i];
var id235 = 'ofe_' + i + '_' + hash235;
e235.id = id235;
addStyle('#ofe-1000-10999 .wdg-oferteo {background-color: #f3f3f3; border-radius: 6px;border-top: 0px solid #d60000 !important;border-right: 0px solid #d60000 !important;border-bottom: 0px solid #d60000 !important;border-left: 0px solid #d60000 !important;color: #303030; max-width: 241px;font-family: Arial,sans-serif;height: auto;padding: 5px 10px 10px;box-sizing: border-box;text-align: center; margin-left: 20px;}#ofe-1000-10999 .wdg-oferteo h1 {font-size: 20px;line-height: 22px;font-weight: bold;margin: 17px 0 5px 0;float: left;width: 100%; padding: 0px;}#ofe-1000-10999 .wdg-oferteo h1 span.usp {color: #d60000;font-size: 13px;display: block;}#ofe-1000-10999 .wdg-oferteo .clear {clear: both;}#ofe-1000-10999 .wdg-oferteo .radio-box {text-align: left;display: inline-block; margin: 7px 0 8px;}#ofe-1000-10999 .wdg-oferteo .radio {margin-top: 0px;margin-bottom: 0px;padding: 0px;}#ofe-1000-10999 .wdg-oferteo .radio a {color: #333;text-decoration: none;display: block;padding: 0 2px;}#ofe-1000-10999 div.radio input { margin-right: 5px; vertical-align: text-top; position: relative; margin-top: 2px;}#ofe-1000-10999 .wdg-oferteo label:hover,#ofe-1000-10999 .wdg-oferteo .radio:hover a, #ofe-1000-10999 .wdg-oferteo .radio:active a, #ofe-1000-10999 .wdg-oferteo .radio:focus a {color: #fff;background-color: #f06407;border-radius: 3px;}#ofe-1000-10999 .wdg-oferteo label {display: block;font-weight: normal;font-size: 14px;line-height: 24px;max-width: 100%;margin-bottom: 0;cursor: pointer;}#ofe-1000-10999 .wdg-oferteo .btn-widget {-moz-user-select: none; background-color: #f07d13; border-color: #d36f13;background-image: none;border-radius: 6px;color: #ffffff;cursor: pointer;display: inline-block;font-size: 16px;font-weight: normal !important;line-height: 19px;margin: 10px 0 15px;padding: 10px 29px;text-align: center;vertical-align: middle;white-space: nowrap;text-decoration: none;font-weight: bold; line-height: 1.33em;}#ofe-1000-10999 .wdg-oferteo .btn-widget:hover { background-color: #f06407!important; border-color: #e45b00;}#ofe-1000-10999 .wdg-oferteo .btn-widget-blue {-moz-user-select: none; background-color: #1b88c3; border-color: #237bac;background-image: none;border-radius: 6px;color: #ffffff;cursor: pointer;display: inline-block;font-size: 16px;font-weight: normal !important;line-height: 19px;margin: 10px 0 15px;padding: 10px 29px;text-align: center;vertical-align: middle;white-space: nowrap;text-decoration: none;font-weight: bold; line-height: 1.33em;}#ofe-1000-10999 .wdg-oferteo .btn-widget-blue:hover { background-color: #156996!important; border-color: #195779;} #ofe-1000-10999 .ofe-link { color: #1b88c3; margin-bottom: 10px; text-decoration: none; font-size: 14px; display:block;}#ofe-1000-10999 .ofe-link:hover { text-decoration: underline;}#ofe-1000-10999 .wdg-oferteo p {font-size: 11px;margin: 6px 4px 0;color: #808080;text-align: center;}#ofe-1000-10999 .wdg-oferteo p strong {font-weight: bold;}@media (max-width : 767px) {#ofe-1000-10999 .ofe-hidden-xs-sm { display: none;}}', 's_ofe-1000-10999');
addClassCreationPool(id235, 'ofe-1000-10999');
var creationDiv = document.getElementById(id235);
creationDiv.innerHTML = '';
var jscriptUrl = 'https://www.oferteo.pl/scripts/widget.js';
addScript(jscriptUrl, 'js-' + hash235);
includejQuery(function($){
//includejQueryUI();
+function ($) {
'use strict';
var $flyer,
$blocker,
$self,
$window = $(window),
bounds = {
top: 0,
bottom: $('body').height()
},
options;
var calculateTop = function () {
var scrollTop = $window.scrollTop();
if (bounds.bottom && scrollTop >= bounds.bottom) {
if (options.hiddenAtStart) {
$flyer.css('visibility', 'visible');
}
return options.top + bounds.bottom - scrollTop;
}
if (scrollTop <= bounds.top - options.top) {
if (options.hiddenAtStart) {
$flyer.css('visibility', 'hidden');
}
return $self.offset().top - scrollTop;
}
if (options.hiddenAtStart) {
$flyer.css('visibility', 'visible');
}
return options.top;
};
var refreshPosition = function (full) {
$flyer.css({top: calculateTop(), left: $self.offset().left, width: $self.css('width')});
if (full && options.minWindowWidth) {
if ($window.width() > options.minWindowWidth) {
$flyer.show();
$self.css('visibility', 'hidden');
} else {
$flyer.hide();
$self.css('visibility', 'visible');
}
}
};
var resetBounds = function () {
if (!$blocker[0]) {
$blocker = $(options.blocker);
}
bounds.top = $self.offset().top;
bounds.bottom = $blocker.is(':visible') ? $blocker.offset().top - $flyer.outerHeight(false) - options.bottom - options.top : 0;
};
var methods = {
init: function (opts) {
$(document).ready(function () {
setTimeout(function () {
options = opts || {};
$self = $(this);
$flyer = $self
.clone(false)
.css({
position: 'fixed',
visibility: options.hiddenAtStart ? 'hidden' : 'visible',
'z-index': 99
})
.addClass(options.class);
$blocker = $(opts.blocker);
$self.css('visibility', 'hidden');
$flyer.insertAfter($self);
$(window).on('scroll.richFlyer', function (e) {
refreshPosition();
});
$(window).on('resize.richFlyer', function (e) {
resetBounds();
refreshPosition(true);
}).resize();
}.bind(this), opts.timeout || 0);
}.bind(this));
}
};
$.fn.RichFlyer = function(methodOrOptions) {
if ( methods[methodOrOptions] ) {
return methods[ methodOrOptions ].apply( this, Array.prototype.slice.call( arguments, 1 ));
} else if ( typeof methodOrOptions === 'object' || ! methodOrOptions ) {
// Default to "init"
return methods.init.apply( this, arguments );
} else {
$.error( 'Method ' + methodOrOptions + ' does not exist on jQuery.RichFlyer' );
}
};
document.addEventListener("click", function(e) {
if (e.target.classList.contains("add-rfp-button")) {
e.preventDefault();
O.FormModal.Show({ mode: 'category', category: e.target.getAttribute('data-cat-id') });
}
});
}(jQuery);
$('.rich-flyer').RichFlyer({
blocker : '#footer-oferteo',
top : 50,
bottom : 30,
minWindowWidth : 767,
timeout: 1000,
hiddenAtStart : false
});
});
}
}
processAnchors('a0', hash235);
processAnchors('a1', hash235);
processAnchors('a2', hash235);
processAnchors('a3', hash235);