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