WMWEATHER={settings:{imgurl:"http://asset.webmart.de/weather/",fcdates:[],woeid:0,city:"",venue:0},init:function(){var b=document.getElementById("q").value;var a=document.createElement("script");a.src="/ws/locate?q="+encodeURI(b)+"&callback=WMWEATHER.callback";document.getElementsByTagName("head")[0].appendChild(a)},callback:function(b){if(b.length===1){document.location.href="/"+b[0].woeid}else{if(b.length>1){var a='<ul class="morelist">';jQuery.each(b,function(c,d){a+="<li>";a+='<a href="/'+d.woeid+'">';a+=d.name+" ("+d.countrycode+")";a+="</a></li>"});a+="</ul>";$("#more").html(a)}else{if(this.settings.language==="de"){$("#more").html("Keine Ergebnisse")}else{if(this.settings.language==="en"){$("#more").html("No results.")}}}}},renderDates:function(){var b;var a=this.settings;if(a.language==="de"){dateFormat.i18n.dayNames=["So","Mo","Di","Mi","Do","Fr","Sa","Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"]}jQuery.each(a.fcdates,function(c,d){var f=d.split(" ");f=Date.parse(f[1]+" "+f[0]+", "+f[2]);if(a.language==="de"){f=dateFormat(f,"dddd, dd.mm.yy")}else{if(a.language==="en"){f=dateFormat(f,"dddd, mm/dd/yy")}}$("#fcdate_"+c).html(f)});b=a.lastupdate.split(" ");b=b.slice(0,(b.length-1)).join(" ");if(a.language==="de"){b=dateFormat(b,"dd.mm.yy HH:MM")}else{if(a.language==="en"){b=dateFormat(b,"dd/mm/yy HH:MM")}}$("#lastupdate_date").html(b);this.searchHistory({woeid:a.woeid,city:a.city});this.renderVenues()},renderVenue:function(e){var a=this.settings;if(a.venue){$("#vdetail_"+a.venue).css("display","none");$("#vmap_"+a.venue).html("").hide()}$("#vdetail_"+e.id).slideDown(800);$("#vmap_"+e.id).show();var d;var f=e.c;var b="gmap_"+e.id;if(GBrowserIsCompatible()){$("#vmap_"+e.id).html('<div id="'+b+'" style="margin-bottom:10px;width:400px;height:250px"></div>');d=new GMap2(document.getElementById(b));theCenter=new GLatLng(f[0],f[1]);d.setCenter(theCenter,15);d.setUIToDefault();d.disableScrollWheelZoom();d.addOverlay(new GMarker(theCenter))}a.venue=e.id},renderVenues:function(){var a=this.settings;$("#tabs").tabs();$(".venues div").css("display","none");$(".vdetail").each(function(){var b=this.id.split("_")[1];var c=$("#v_"+b+" a").html();$(this).append('<br /><br /><a rel="external nofollow" href="http://foursquare.com/venue/'+b+'" target="_blank">'+c+" on foursquare</a>")})},searchHistory:function(g){var b=this.settings;var d,f="";if(!Modernizr.localstorage){return}var c=window.localStorage.history;if(!c&&!g){return}c=c||"[]";c=JSON.parse(c);if(c.length>4){c=c.splice(0,6)}if(g){var a=[];jQuery.each(c,function(h,j){if(j.city!=g.city&&j.woeid!=g.woeid){a.push(j)}});a.unshift(g);window.localStorage.history=JSON.stringify(a)}jQuery.each(c,function(h,j){if(j.woeid!=b.woeid){f+='<a href="/'+j.woeid+'" class="h">'+j.city+"</a>"}});if(f.length){d=document.createElement("div");d.id="history";d.innerHTML=b.lastsearch+f;document.getElementById("search").appendChild(d)}},showEmbed:function(b){var a=$("#showembed").text();$("#embed").html("<h2>"+a+'</h2><iframe src="/embed/'+this.settings.woeid+"?city="+b+'" width="100%" height="600px" scrolling="no"></iframe>')},showMap:function(e){var d;if(GBrowserIsCompatible()){$("#gmap").html('<div id="map_canvas" style="margin-bottom:10px;width:100%;height:600px"></div>');d=new GMap2(document.getElementById("map_canvas"));theCenter=new GLatLng(e[0],e[1]);d.setCenter(theCenter,12);d.setUIToDefault();d.disableScrollWheelZoom();d.addOverlay(new GMarker(theCenter))}var a="pub-3271650949652970";var b={maxAdsOnMap:3,style:G_ADSMANAGER_STYLE_ADUNIT,channel:"0411809389"};adsManager=new GAdsManager(d,a,b);adsManager.enable()}};var dateFormat=function(){var a=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g,b=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,d=/[^-+\dA-Z]/g,c=function(f,e){f=String(f);e=e||2;while(f.length<e){f="0"+f}return f};return function(i,v,q){var g=dateFormat;if(arguments.length==1&&Object.prototype.toString.call(i)=="[object String]"&&!/\d/.test(i)){v=i;i=undefined}i=i?new Date(i):new Date;if(isNaN(i)){throw SyntaxError("invalid date")}v=String(g.masks[v]||v||g.masks["default"]);if(v.slice(0,4)=="UTC:"){v=v.slice(4);q=true}var t=q?"getUTC":"get",l=i[t+"Date"](),e=i[t+"Day"](),j=i[t+"Month"](),p=i[t+"FullYear"](),r=i[t+"Hours"](),k=i[t+"Minutes"](),u=i[t+"Seconds"](),n=i[t+"Milliseconds"](),f=q?0:i.getTimezoneOffset(),h={d:l,dd:c(l),ddd:g.i18n.dayNames[e],dddd:g.i18n.dayNames[e+7],m:j+1,mm:c(j+1),mmm:g.i18n.monthNames[j],mmmm:g.i18n.monthNames[j+12],yy:String(p).slice(2),yyyy:p,h:r%12||12,hh:c(r%12||12),H:r,HH:c(r),M:k,MM:c(k),s:u,ss:c(u),l:c(n,3),L:c(n>99?Math.round(n/10):n),t:r<12?"a":"p",tt:r<12?"am":"pm",T:r<12?"A":"P",TT:r<12?"AM":"PM",Z:q?"UTC":(String(i).match(b)||[""]).pop().replace(d,""),o:(f>0?"-":"+")+c(Math.floor(Math.abs(f)/60)*100+Math.abs(f)%60,4),S:["th","st","nd","rd"][l%10>3?0:(l%100-l%10!=10)*l%10]};return v.replace(a,function(m){return m in h?h[m]:m.slice(1,m.length-1)})}}();dateFormat.masks={"default":"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"};dateFormat.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]};Date.prototype.format=function(a,b){return dateFormat(this,a,b)};if(!this.JSON){this.JSON={}}(function(){function l(b){return b<10?"0"+b:b}function o(b){p.lastIndex=0;return p.test(b)?'"'+b.replace(p,function(f){var c=r[f];return typeof c==="string"?c:"\\u"+("0000"+f.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+b+'"'}function m(b,f){var c,d,g,j,i=h,e,a=f[b];if(a&&typeof a==="object"&&typeof a.toJSON==="function"){a=a.toJSON(b)}if(typeof k==="function"){a=k.call(f,b,a)}switch(typeof a){case"string":return o(a);case"number":return isFinite(a)?String(a):"null";case"boolean":case"null":return String(a);case"object":if(!a){return"null"}h+=n;e=[];if(Object.prototype.toString.apply(a)==="[object Array]"){j=a.length;for(c=0;c<j;c+=1){e[c]=m(c,a)||"null"}g=e.length===0?"[]":h?"[\n"+h+e.join(",\n"+h)+"\n"+i+"]":"["+e.join(",")+"]";h=i;return g}if(k&&typeof k==="object"){j=k.length;for(c=0;c<j;c+=1){d=k[c];if(typeof d==="string"){if(g=m(d,a)){e.push(o(d)+(h?": ":":")+g)}}}}else{for(d in a){if(Object.hasOwnProperty.call(a,d)){if(g=m(d,a)){e.push(o(d)+(h?": ":":")+g)}}}}g=e.length===0?"{}":h?"{\n"+h+e.join(",\n"+h)+"\n"+i+"}":"{"+e.join(",")+"}";h=i;return g}}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+l(this.getUTCMonth()+1)+"-"+l(this.getUTCDate())+"T"+l(this.getUTCHours())+":"+l(this.getUTCMinutes())+":"+l(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var q=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,p=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,h,n,r={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},k;if(typeof JSON.stringify!=="function"){JSON.stringify=function(b,f,c){var d;n=h="";if(typeof c==="number"){for(d=0;d<c;d+=1){n+=" "}}else{if(typeof c==="string"){n=c}}if((k=f)&&typeof f!=="function"&&(typeof f!=="object"||typeof f.length!=="number")){throw Error("JSON.stringify")}return m("",{"":b})}}if(typeof JSON.parse!=="function"){JSON.parse=function(b,f){function c(g,j){var i,e,a=g[j];if(a&&typeof a==="object"){for(i in a){if(Object.hasOwnProperty.call(a,i)){e=c(a,i);if(e!==undefined){a[i]=e}else{delete a[i]}}}}return f.call(g,j,a)}var d;b=String(b);q.lastIndex=0;if(q.test(b)){b=b.replace(q,function(g){return"\\u"+("0000"+g.charCodeAt(0).toString(16)).slice(-4)})}if(/^[\],:{}\s]*$/.test(b.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,""))){d=eval("("+b+")");return typeof f==="function"?c({"":d},""):d}throw new SyntaxError("JSON.parse")}}})();
