function mSubmitForm(number) { if(!number) { number = ""; } var _container = document.getElementById("SearchResult"+number); _container.style.display = "none"; var sSearchPattern = document.getElementById("searchPattern"+number).value; var url = "http://www.wetter.info/suche/sp_" +sSearchPattern+ "/62174516"; fenster = window.open(url); fenster.focus(); } function mJsonp(url, callback) { var callbackName = "jsonp_callback_" + Math.round(100000 * Math.random()); window[callbackName] = function(data) { delete window[callbackName]; document.body.removeChild(script); callback(data); }; var script = document.createElement("script"); script.src = url + (url.indexOf("?") >= 0 ? "&" : "?") + "callback=" + callbackName; document.body.appendChild(script); } function mInputChanged(number) { if(!number) { number = ""; } var _el = document.getElementById("searchPattern"+number); var _container = document.getElementById("SearchResult"+number); function buildSection(node, title) { if(node.result.length > 0) { var _section = document.createElement("span"); _section.className = "section"; var _text = document.createTextNode(title); _section.appendChild(_text); _container.appendChild(_section); } for(var x = 0; x < node.result.length; x++) { var _link = document.createElement("a"); _link.target = "_blank"; var _text; if(node.result[x].POSTLEITZAHL != undefined) { _text = document.createTextNode(node.result[x].POSTLEITZAHL + " " + node.result[x].WOHNORT_NAME); } else { _text = document.createTextNode(node.result[x].WOHNORT_NAME); } var _zusatzContainer = document.createElement("span"); _zusatzContainer.className = "info"; var _zusatz = document.createTextNode(""); if(node.result[x].COUNTRY_SHORT != "DE") { _zusatz = document.createTextNode("(" + node.result[x].COUNTRY + ", " + node.result[x].BUNDESLAND_NAME + ")"); } else { if(node.result[x].WOHNORT_NAMENSZUSATZ != undefined && node.result[x].WOHNORT_NAMENSZUSATZ != "") { _zusatz = document.createTextNode("(" + node.result[x].WOHNORT_NAMENSZUSATZ + ")"); } } _zusatzContainer.appendChild(_zusatz); _link.title = node.result[x].WOHNORT_NAME; _link.href = node.result[x].URL_DEFAULT; _link.appendChild(_text); _link.appendChild(_zusatzContainer); _container.appendChild(_link); _link.addEventListener("click", function() { _container.style.display = "none"; }) } return node.result.length; } if(_el.value.length >= 3) { mJsonp("http://suche.wetter.info/ariadne/wsuggestion?&limitNumber=10&t=td39ef23d36bbcf35c7f6607a3ab239be&location=" + _el.value, function(data){ while(_container.firstChild){ _container.removeChild(_container.firstChild); } _count = 0; _count += buildSection(data.TopHits, "Beste Treffer"); _count += buildSection(data.Deutschland, "Orte in Deutschland"); _count += buildSection(data.International, "Orte weltweit"); if(_count > 0) { _container.style.display = "block"; } else { _container.style.display = "none"; } }) } else { _container.style.display = "none"; } var _timeout; _container.addEventListener("mouseleave", function() { _timeout = window.setTimeout(function() { _container.style.display = "none"; }, 1500) }) _el.addEventListener("mouseleave", function() { _timeout = window.setTimeout(function() { _container.style.display = "none"; }, 1500) }) _el.addEventListener("mouseenter", function() { clearTimeout(_timeout); }) _container.addEventListener("mouseenter", function() { clearTimeout(_timeout); }) } document.getElementById('MediumCity').className='Day';document.getElementById('wetterinfo_data').innerHTML = '
Andere Stadt wählen:
';