var UtilInit = { newElement: function(tagName, style) { var doc = document; var newElement = UtilInit.createElement(doc,tagName); if (style) { for (key in style) { if (key == 'cssFloat' && UtilInit.isIE()) { newElement.style['styleFloat'] = style[key]; } else { newElement.style[key] = style[key]; } } } return newElement; }, createElement: function(doc,tagName) { var newElt = doc.createElement(tagName); if (typeof(newElt) != 'object') {newElt = doc.standardCreateElement(tagName);} return newElt; }, isIE: function() { return (navigator.appName == "Microsoft Internet Explorer"); }, isIE6: function() { return (navigator.appVersion.indexOf("MSIE 6")!=-1); }, canUseFixedPosition: function() { return (UtilInit.isIE6() || (UtilInit.isIE() && UtilInit.detectDoctype() == null))?false:true; }, getWindowWidth: function(){ var x = 0; if (self.innerHeight){ x = self.innerWidth; } else if (document.documentElement && document.documentElement.clientHeight){ x = document.documentElement.clientWidth; } else if (document.body){ x = document.body.clientWidth; } return x; }, getWindowHeight: function(){ var x = 0; if (self.innerHeight){ x = self.innerHeight; } else if (document.documentElement && document.documentElement.clientHeight){ x = document.documentElement.clientHeight; } else if (document.body){ x = document.body.clientHeight; } return x; }, detectDoctype: function(){ var re=/\s+(X?HTML)\s+([\d\.]+)\s*([^\/]+)*\//gi; var res=false; if(typeof document.namespaces != "undefined") res=document.all[0].nodeType==8 ? re.test(document.all[0].nodeValue) : false; else res=document.doctype != null ? re.test(document.doctype.publicId) : false; if(res){ res=new Object(); res['xhtml']=RegExp.$1; res['version']=RegExp.$2; res['importance']=RegExp.$3; if(res['xhtml'].toLowerCase() != 'xhtml') return null; return res; }else{ return null; } }, getElementsByClassName: function(searchClass,node) { if (node == null) node = document; if (node.getElementsByClassName) return node.getElementsByClassName(searchClass); var classElements = new Array(); var els = node.getElementsByTagName("*"); var elsLen = els.length; var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)"); for (i = 0, j = 0; i < elsLen; i++) { if (pattern.test(els[i].className)) { classElements[j] = els[i]; j++; } } return classElements; }, getElementsByName: function(search,node) { if (node == null) node = document; var elements = new Array(); var els = node.getElementsByTagName("*"); var elsLen = els.length; var pattern = new RegExp("(^|\\s)"+search+"(\\s|$)"); for (i = 0, j = 0; i < elsLen; i++) { if (pattern.test(els[i].name)) { elements[j] = els[i]; j++; } } return elements; }, htmlDecode: function(input){ var e = document.createElement('div'); e.innerHTML = input; var result = ""; for(var i=0;i 3) { var pp = ps.split("&"); for (var i = 0; i < pp.length; i++) { var pa = pp[i].split("="); this.params[pa[0]] = pa[1]; if(pa[0] != 'wId') { userPassedUrlParams += "&" + pa[0] + "=" + pa[1]; } } if(userPassedUrlParams != "") { this.WidgetParams.urlSuffixForIms = userPassedUrlParams; } } } }; this.insertWidget = function(){ var nimbleBuyWidget = this.gebi("nimbleBuyWidget"); if(nimbleBuyWidget){ if(this.WidgetParams.widgetWidth != 0 && this.WidgetParams.widgetHeight !=0) { var widgetWidth = this.WidgetParams.widgetWidth; if (widgetWidth.indexOf("px") == -1){ widgetWidth += "px"; } nimbleBuyWidget.style.width = widgetWidth; var widgetHeight = this.WidgetParams.widgetHeight; if (widgetHeight.indexOf("px") == -1){ widgetHeight += "px"; } nimbleBuyWidget.style.height = widgetHeight; } nimbleBuyWidget.style.position = "relative"; nimbleBuyWidget.style.overflow = "hidden"; nimbleBuyWidget.innerHTML = this.WidgetHtml.getNimbleBuyWidgetHTML(); if(this.WidgetHtml.getNimbleBuyWidgetHTML() == "") { nimbleBuyWidget.style.display = "none"; } this._outerDiv = nimbleBuyWidget; } else { var prms = { zIndex: 20001, scrolling: 'no', overflow: 'hidden', position: 'absolute', width: this.WidgetParams.widgetWidth+'px', height: this.WidgetParams.widgetHeight+'px' }; var bd = document.body; if(!bd) return; this._outerDiv = UtilInit.newElement("div",prms); this._outerDiv.id = "nimbleBuyWidget"+this.WidgetParams.id; this._outerDiv.innerHTML = this.WidgetHtml.getNimbleBuyWidgetHTML(); bd.insertBefore(this._outerDiv, bd.firstChild); this.setWidgetPosition(); } this.processWidgetLinks(); }; this.isImshopping= function() { var url = document.location.href; if ('' != this.WidgetParams.imsAppUrl && url.indexOf(this.WidgetParams.imsAppUrl) > -1) { return true; } else { return false; } }; this.processWidgetLinks= function() { var isIms = this.isImshopping(); var nimbleBuyWidget = this.gebi("nimbleBuyWidget"); var links = UtilInit.getElementsByName("widgetNimbleBuyProductLink",nimbleBuyWidget); if (links.length > 0) { for (var i = 0; i < links.length; i++) { var link = links[i]; var suffix = this.WidgetParams.urlSuffixForIms; if (link.href.indexOf("?") > -1) { link.href += suffix; } else { link.href += "?" + suffix; } } } }; this.startScroll = function(){ this.scroll = true; }; this.stopScroll = function(){ this.scroll = false; }; this.scrollOffer = function(){ var offers = this.gebi("nimbleBuyOffers"); if(!offers) return; if (this.scroll) { var l = parseInt(offers.style.left, 10); var w = offers.offsetWidth/offers.childElementCount; if (l > -(this.WidgetParams.widgetOffersSize * w - w)) { offers.style.left = l - w + "px"; } else { offers.style.left = 0; } } setTimeout(function(){self.scrollOffer();}, this.WidgetParams.rotateTimeInterval); }; this.calcWidgetPosition = function(){ var widgetHeight = 400; var widgetWidth = 450; var winHeight = UtilInit.getWindowHeight(); var winWidth = UtilInit.getWindowWidth(); var scrollTop = 0; var top = Math.round((winHeight/2) - (widgetHeight/2) + scrollTop); if(top<(10+scrollTop)) top = 10+scrollTop; var widgetPosH = top + 'px'; var widgetPosW = Math.round((winWidth/2) - (widgetWidth/2)) + 'px'; return {top:widgetPosH, left:widgetPosW}; }; this.setWidgetPosition = function(){ var btn = this.gebi("nimbleBuyWidget"); if(!btn) return; var winHeight = UtilInit.getWindowHeight(); var WidgetHeight = this.getWidgetHeight(); var btnTop = Math.round((winHeight/2) - (WidgetHeight/2)); btn.style.top = btnTop + "px"; btn.style.left = 0; }; this.showLoading = function(){ if(!this.gebi("imsLoading")){ var w = UtilInit.getWindowWidth(); var h = UtilInit.getWindowHeight(); var l = Math.round(w/2-100) + 'px'; var t = Math.round(h/2-50) + 'px'; var prms = { zIndex: 20001, display: 'block', position: 'absolute', left: l, top: t, textAlign: 'center', padding: '20px', border: '10px solid #acacac', backgroundColor: '#fff', width: '200px', fontSize: '18px', fontWeight: 'bold', fontFamily: 'Arial' }; this.loading = UtilInit.newElement("div",prms); this.loading.id = "imsLoading"+this.WidgetParams.id; this.loading.innerHTML = "Loading..."; document.body.insertBefore(this.loading, document.body.firstChild); } else { this.gebi("imsLoading").innerHTML = "Loading..."; this.gebi("imsLoading").style.display = "block"; } }; this.refreshDealTimeLeftArea = function() { var times = UtilInit.getElementsByClassName("offerTimeLeft",this.gebi("nimbleBuyOffers")); for(var i=0; i]+)>)/ig,""); } else {timerText = "";} if (timerText == "Expired" || timerText == "00:00:00") { times[i].innerHTML = "00" + this.WidgetLocalizationProps.hour + ":00" + this.WidgetLocalizationProps.min + ":00" + this.WidgetLocalizationProps.sec; } else { var timestrs = timerText.split(":"); var inDays = (timestrs[0].indexOf(this.WidgetLocalizationProps.day)!=-1) ? true : false; var daysStr = inDays == true ? timestrs[0].substr(0, timestrs[0].length-this.WidgetLocalizationProps.day.length) : null; var hoursStr = inDays == true ? timestrs[1].substr(0, timestrs[1].length-this.WidgetLocalizationProps.hour.length) : timestrs[0].substr(0, timestrs[0].length-this.WidgetLocalizationProps.hour.length); var minStr = inDays == true ? timestrs[2].substr(0, timestrs[2].length-this.WidgetLocalizationProps.hour.length) : timestrs[1].substr(0, timestrs[1].length-this.WidgetLocalizationProps.min.length); var secStr = inDays == true ? null : timestrs[2].substr(0, timestrs[2].length-this.WidgetLocalizationProps.sec.length); var seconds = inDays == true ? parseInt(daysStr, 10)*86400 + parseInt(hoursStr, 10)*3600 + parseInt(minStr, 10)*60 : parseInt(hoursStr, 10)*3600 + parseInt(minStr, 10)*60 + parseInt(secStr, 10) - 1; if (this.seconds[i] == 0) { this.seconds[i] = seconds; } this.seconds[i]--; seconds = this.seconds[i]; if (inDays == true) { var days = Math.floor(seconds / 86400); seconds -= days*86400; } var hours = Math.floor(seconds / 3600); seconds -= hours*3600; var minutes = Math.floor(seconds / 60); seconds -= minutes*60; if (inDays == false) { times[i].innerHTML = hours + this.WidgetLocalizationProps.hour + ":" + ((minutes<10)?("0"+minutes):minutes) + this.WidgetLocalizationProps.min + ":" + ((seconds<10)?("0"+seconds):seconds)+this.WidgetLocalizationProps.sec; } else { minutes++; times[i].innerHTML = days + this.WidgetLocalizationProps.day + ":" + ((hours<10)?("0"+hours):hours) + this.WidgetLocalizationProps.hour + ":" + ((minutes<10)?("0"+minutes):minutes)+this.WidgetLocalizationProps.min; } } } setTimeout(function() {self.refreshDealTimeLeftArea();}, 1000); }; this.unInstall = function(){ var s = this.gebi("nimbleBuyWidgetScript"); if (s) { s.parentNode.removeChild(s); var nimbleBuyWidget = this.gebi("nimbleBuyWidget"); if (nimbleBuyWidget) nimbleBuyWidget.innerHTML = ""; } }; this.install = function(WidgetHtml, WidgetParams, WidgetLocalizationProps){ this.WidgetHtml = WidgetHtml; this.WidgetParams = WidgetParams; if (WidgetLocalizationProps){ this.WidgetLocalizationProps = WidgetLocalizationProps; } this.getParams(); this.insertWidget(); if(this.WidgetParams.widgetOffersSize>1){ setTimeout(function(){ self.scrollOffer(); }, this.WidgetParams.rotateTimeInterval); } setTimeout(function() {self.refreshDealTimeLeftArea();}, 1000); }; this.installOnload = function(WidgetHtml, WidgetParams){ if (window.addEventListener) { window.addEventListener("load", function(){ self.install(WidgetHtml, WidgetParams); }, false); } else if(window.attachEvent) { window.attachEvent("onload", function(){ self.install(WidgetHtml, WidgetParams); }, false); } }; }; var WidgetHtml9298 = { getNimbleBuyWidgetHTML: function(){ var s = ''; s = "<div id="nimbleBuyOffers9298" style="width:930px; height:180px; position:relative;left:0;top:0;"> <div style="float:left;width:930px;height:180px;"><div style="background-color:#00718b;width:930px;height:180px;padding-top:10px;"><a href="http://eu.nmb.ly/3gh3z?host=www.sweetdeal.dk" target="_blank"><img style="width:930px;height:180px;position:absolute;left:0px;top:0px;z-index:10;" src="https://s3.amazonaws.com/product-images.imshopping.com/nimblebuy/e51232cf9fc8dd7b4756cbe34f3be9cc" /></a><div style="background-color:#FFFFFF;width:910px;height:160px;margin-left: 10px;"> <div style="float:left;width:520px;"> <div style="padding: 10px;height:35px;text-align:left;"> <img style="border:none;" src="https://s3.amazonaws.com/product-images.imshopping.com/nimblebuy/65c4962599d12060de4dfaf1149de9b7" /> </div> <div style="font-family:Arial,Helvetica,sans-serif;padding-left:10px;padding-top:5px;padding-right:5px;color:#11718D;font-size:26px;font-weight:bold;height:75px;line-height:100%;text-align:left;">Få genoprettet balancen i kroppen med zoneterapi hos Ina-Marie Berthelsen i Allinge. Bliv forkælet i 45 minutter og få lindret eventuelle smerter.</div><div style="font-family:Arial,Helvetica,sans-serif;margin-left:5px;font-size:11px;padding-left:5px;text-align:left;">Denne Sweetdeal udbydes af Ina-Marie Berthelsen</div> </div> <div style="float:left;padding:6px;"> <div style="float:left;margin-left: 5px;border:1px solid #bbbbbb; width:238px;height:146px;"><img style="margin-left:4px;margin-top:4px;border:none;width:230px;height:138px" alt="Få genoprettet balancen i kroppen med zoneterapi hos Ina-Marie Berthelsen i Allinge. Bliv forkælet i 45 minutter og få lindret eventuelle smerter." src="http://product-images.imshopping.com/nimblebuy/fa-genoprettet-balancen-kroppen-med-zoneterapi-hos-inamarie-473964-small_lv.jpg" /></div> <div style="margin-left:4px;float:left;"> <div style="font-family:Arial,Helvetica,sans-serif;background-color:#00718b;background-image:url(http://euwidget.imshopping.com/images/button_mask_height_50px.png);width:120px;padding:4px;color:#ffffff;font-weight:bold;font-size:18px;line-height:120%;">DKK 225,-<br /><span style="font-size:13px;text-decoration:line-through;color:#c3c3c3;">DKK 450,-</span></div> <div style="font-family:Arial,Helvetica,sans-serif;background-color:#00718b;background-image:url(http://euwidget.imshopping.com/images/button_mask_height_50px.png);width:122px;height:30px;padding-top:5px;padding-left:5px;color:#ffffff;font-weight:bold;font-size:20px;margin-top: 7px;">Spar 50% </div> <div style="margin-top:10px;"><a style="text-decoration: none; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; width:110px; background-color: #7CC51E; color: #fff; padding: 7px; margin-left: 0px; float:left; display: inline; font-family: Arial,Helvetica,sans-serif; background-image:url(http://euwidget.imshopping.com/images/button_mask_height_50px.png); border:1px solid #66a314; font-size:22px; font-weight:bold; text-align:center; white-space:nowrap;" name="widgetNimbleBuyProductLink" href="http://eu.nmb.ly/3gh3z?host=www.sweetdeal.dk" >Køb nu </a></div> </div> <div style="clear:both;"></div></div></div></div>"; return UtilInit.htmlDecode(s); }};var WidgetParams9298 = { id: '9298', rootUrl: 'http://euwidget.imshopping.com', imsAppUrl: '', widgetWidth: '930', widgetHeight: '180', widgetOffersSize: 1, rotateTimeInterval: 10000, urlSuffixForIms: ''};var WidgetLocalizationProps9298 = { day: 'd', hour: 't', min: 'm', sec: 's'};WidgetInit.install(WidgetHtml9298, WidgetParams9298, WidgetLocalizationProps9298);