var domain="bussgeldrechner.org";
var iframeWidget;var iframeHeight=450;function bussgeldrechnerWidget(){var rechner=document.getElementsByTagName("bussgeld-rechner");if(rechner.length===0){rechner=document.getElementsByTagName("ins");if(rechner.length===0){return false}}for(var i=0;i<rechner.length;i++){if(new RegExp("(^|\\s)bussgeldrechner(\\s|$)").test(rechner[i].className)===false){continue}var type=rechner[i].getAttribute("data-type");if(type===null||type===""){type="geschwindigkeit"}var backgroundColor=rechner[i].getAttribute("data-background-color");if(backgroundColor===null||backgroundColor===""){backgroundColor="#ffffff"}var fontColor=rechner[i].getAttribute("data-font-color");if(fontColor===null||fontColor===""){fontColor="#313c45"}var buttonBackgroundColor=rechner[i].getAttribute("data-button-background-color");if(buttonBackgroundColor===null||buttonBackgroundColor===""){buttonBackgroundColor="#3889cf"}var buttonFontColor=rechner[i].getAttribute("data-button-font-color");if(buttonFontColor===null||buttonFontColor===""){buttonFontColor="#3889cf"}var borderColor=rechner[i].getAttribute("data-border-color");if(borderColor===null||borderColor===""){borderColor="#3889cf"}var publisherId=rechner[i].getAttribute("data-publisher-id");if(publisherId===null||publisherId===""){publisherId=0}var theme=rechner[i].getAttribute("data-theme");if(theme===null||theme===""){theme=0}var customStyles=rechner[i].getAttribute("data-stylesheet");if(customStyles===null||customStyles===""){customStyles=""}var webmaster=rechner[i].getAttribute("data-hide-webmaster");if(webmaster===null||webmaster===""){webmaster=0}var lawyerBranding=rechner[i].getAttribute("data-hide-lawyer-branding");if(lawyerBranding===null||lawyerBranding===""){lawyerBranding=0}var dropdown=rechner[i].getAttribute("data-show-dropdown");if(dropdown===null||dropdown===""){dropdown=0}if(dropdown==1){iframeHeight=460}var newIframeHeight=rechner[i].getAttribute("data-iframe-height");if(newIframeHeight!==null&&parseInt(newIframeHeight)>0){iframeHeight=parseInt(newIframeHeight)}var url="//widget."+domain+"/"+type+".html";url+="?publisherId="+encodeURIComponent(publisherId);url+="&dropdown="+encodeURIComponent(dropdown);url+="&styles="+encodeURIComponent(customStyles);if(theme!=0){url+="&theme="+encodeURIComponent(theme)}else{url+="&backgroundColor="+encodeURIComponent(backgroundColor);url+="&fontColor="+encodeURIComponent(fontColor);url+="&buttonBackgroundColor="+encodeURIComponent(buttonBackgroundColor);url+="&buttonFontColor="+encodeURIComponent(buttonFontColor);url+="&borderColor="+encodeURIComponent(borderColor)}if(webmaster!=0){url+="&webmaster="+encodeURIComponent(webmaster)}if(lawyerBranding!=0){url+="&lawyerBranding="+encodeURIComponent(lawyerBranding)}iframeWidget=document.createElement("iframe");iframeWidget.setAttribute("width","100%");iframeWidget.setAttribute("frameborder","0");iframeWidget.setAttribute("src",encodeURI(url));rechner[i].parentNode.insertBefore(iframeWidget,rechner[i]);setHeight()}}function setHeight(){console.log(iframeHeight);if(iframeWidget.clientWidth<=680){iframeWidget.height=iframeHeight+110}else{iframeWidget.height=iframeHeight}}window.onresize=function(event){if(iframeWidget){setHeight()}};window.onload=function(event){bussgeldrechnerWidget()};
