(function(){ var key = "-judB"; var widget = document.getElementById('wrapper'+key); var widget_insert = document.getElementById('load'+key); var widget_url = document.getElementById('url'+key); var widget_h2 = document.getElementById('h2'+key); var widget_detail = document.getElementById('url_detail'+key); var days = 3; var maxtemp = 0; var wind = 0; var height = 105+maxtemp+wind; var width = 138*days; var iframeHeight = 48+maxtemp+wind; var widget_detail_div = document.createElement("div"); widget_detail_div.id = "widget_detail_div"; widget_detail_div.style.cssText = 'float:right;text-decoration: none;margin-right:12px;'; widget_detail_div.appendChild(widget_detail); var textAlign = "text-align:left;"; widget_h2.style.cssText = 'float:none;margin-top:0px;margin-bottom:0px;line-height:25px;margin-left:12px;background:#ffffff;padding:0px;text-transform:none;letter-spacing:normal;'; widget_detail.style.cssText = 'font-size: 12px;font-weight: bold;color:#363636;border-style:none;'; var yr_style = "font-size:10px;text-decoration: none;color:#363636;float:left;margin-left:12px;font-family: Arial, Helvetica, sans-serif;" widget.style.cssText = 'width:' + width + 'px; height:' + height +'px;border-style: solid;border-width:1px;border-color:#c4c3c3;padding-top:10px;background-color: #ffffff;' + textAlign; widget_url.style.cssText = 'font-size: 20px;color:#363636;font-weight: bold;text-decoration: none;font-family: Arial, Helvetica, sans-serif;'; var url=""; if (location.protocol === 'https:') { url = "https://widget.vackertvader.se/widgetv3?geonameid=2686162&bgcolor=ffffff&border=c4c3c3&size=x120&textcolor=363636&days=3&maxtemp=no&wind=no&unit=C&lang="; }else{ url = "http://widget.vackertvader.se/widgetv3?geonameid=2686162&bgcolor=ffffff&border=c4c3c3&size=x120&textcolor=363636&days=3&maxtemp=no&wind=no&unit=C&lang="; } //var url = "http://api2.vackertvader.se:4013/widgetv3?geonameid=2686162&bgcolor=ffffff&border=c4c3c3&size=x120&textcolor=363636&days=3&maxtemp=no&wind=no&unit=C&lang="; var iframe = document.createElement("iframe"); iframe.id = "widget_iframe"; iframe.height = iframeHeight; iframe.width = '100%'; iframe.scrolling = 'no'; iframe.src = url; iframe.setAttribute("frameBorder","0"); widget_insert.appendChild(iframe); var yr = document.createElement("div"); yr.id = "widget_yr" yr.style.cssText = yr_style; yr.innerHTML = "Data från yr.no, MI, NRK."; widget_insert.appendChild(yr); widget_insert.appendChild(widget_detail_div); return false; })()