function setHoverAction(){$("#locationlist .scrollable div").on("mousemove",function(n){n.pageX+n.pageY!=mouseEvent&&(mouseEvent=n.pageX+n.pageY,showMap(this))});$("#locationlist .scrollable div").on("click",function(){doNavigate()})}function showMap(n){var t=parseFloat($(n).find(".lat").text()),r=parseFloat($(n).find(".lon").text()),u=$(n).find(".postcode").length>0,i;if(isNaN(t)||t==0){$("#map").hide("fast");return}$("#locationlist .scrollable > div").removeClass("active");$(n).addClass("active");recordIndex=$("#locationlist .scrollable .active").index()+1;i=mapurl.replace(/{lat}/g,t.toString()).replace(/{lon}/g,r.toString());u&&(i=detailmapurl.replace(/{lat}/g,t.toString()).replace(/{lon}/g,r.toString()));$("#map img").attr("src",i);$("#map").show("fast")}function doNavigate(){var n;if(selectedCountry=$("#countrycodes").val(),n=$("#locationlist .scrollable .active"),n.length!=0){var t=n.find(".locationid").text(),i=n.find(".name").text().replace(/[^a-z0-9]/gi,"-").toLowerCase(),r=targetUrl.replace(/{locationid}/g,t).replace(/{name}/,i);window.document.location.href=r}}function processKeyInput(n){switch(n.which){case 40:$("#locationlist .scrollable > div").removeClass("active");recordIndex++;recordIndex>$("#locationlist .scrollable > div").length&&(recordIndex=$("#locationlist .scrollable > div").length);$("#locationlist .scrollable > div:nth-child("+recordIndex+")").addClass("active");break;case 38:$("#locationlist .scrollable > div").removeClass("active");recordIndex--;recordIndex<1&&(recordIndex=1);$("#locationlist .scrollable > div:nth-child("+recordIndex+")").addClass("active");break;case 13:doNavigate()}try{$("#locationlist .scrollable .active").position().top<25&&$("#locationlist .scrollable").scrollTop((recordIndex-10)*20)}catch(n){}recordIndex<0&&(recordIndex=0);recordIndex<11&&$("#locationlist .scrollable").scrollTop(1);recordIndex%10==0&&$("#locationlist .scrollable").scrollTop((recordIndex-1)*20);showMap($("#locationlist .scrollable .active"))}function findLocations(n){(n={name:n.term,format:"jsonp"},typeof activeRequest=="undefined"||activeRequest!=n.term)&&(activeRequest=n.term,$("#locationlist").html(""),$("#resultset").show(),$.ajax({url:"//api.themeteocompany.com/forecast/GetLocationsByName",type:"GET",cache:!0,data:n,dataType:"jsonp",jsonp:"callback",cors:!0,success:function(n){var t="",i;if(n&&n.length!=0)if(recordIndex=0,typeof n[0].Postcode=="string"){t="<div class='head'><span class='postcode'>Postcode<\/span><span class='straat'>Straat<\/span><span class='plaats'>Plaats<\/span><\/div>";var u="",f="",e="",r="";for(t+="<div class='scrollable'>",i=0;i<n.length;i++)u!=n[i].Plaats&&(u=n[i].Plaats,f=u),e!=n[i].Straatnaam&&(e=n[i].Straatnaam,r=e),r!=""&&(t+="<div class='record'>",t+="<span class='postcode'><a href='#'>"+n[i].Postcode+"<\/a><\/span>",t+="<span class='straat'>"+r+"<\/span>",t+="<span class='plaats'>"+f+"<\/span>",t+="<span class='hidden gps lat'>"+Math.round(n[i].Latitude*100)/100+"<\/span>",t+="<span class='hidden gps lon'>"+Math.round(n[i].Longitude*100)/100+"<\/span>",t+="<\/div>"),r="",f="";t+="<\/div>"}else{for(t="<div class='head'><span class='name'>Plats<\/span><span class='country'>Land<\/span><span class='gps'>Lat<\/span><span class='gps'>Lon<\/span><span class='gps'>Alt (m)<\/span><\/div>",t+="<div class='scrollable'>",i=0;i<n.length;i++)t+="<div class='record'>",t+="<span class='name'><a href='#'>"+n[i].Name+"<\/a><\/span>",t+="<span class='country'>"+n[i].Country+"<\/span>",t+="<span class='gps lat'>"+Math.round(n[i].Latitude*100)/100+"<\/span>",t+="<span class='gps lon'>"+Math.round(n[i].Longitude*100)/100+"<\/span>",t+="<span class='hidden locationid'>"+n[i].Id+"<\/span>",n[i].ElevationModel>0&&(t+="<span class='gps alt'>"+Math.round(n[i].ElevationModel)+"<\/span>"),t+="<\/div>";t+="<\/div>"}else t="<div class='nolocations'>Inga bostäder hittades. Försök med en annan sökterm.<\/div>";$("#locationlist").html(t);$("#locationlist .scrollable > div:nth-child(1)").addClass("active");showMap($("#locationlist .scrollable > div:nth-child(1)"));setHoverAction()}}))}function addLocationToFavorite(){}(function(){function t(){}function u(n,t){for(var i=n.length;i--;)if(n[i].listener===t)return i;return-1}function i(n){return function(){return this[n].apply(this,arguments)}}var n=t.prototype,r=this,f=r.EventEmitter;n.getListeners=function(n){var t=this._getEvents(),r,i;if(typeof n=="object"){r={};for(i in t)t.hasOwnProperty(i)&&n.test(i)&&(r[i]=t[i])}else r=t[n]||(t[n]=[]);return r};n.flattenListeners=function(n){for(var i=[],t=0;t<n.length;t+=1)i.push(n[t].listener);return i};n.getListenersAsObject=function(n){var t=this.getListeners(n),i;return t instanceof Array&&(i={},i[n]=t),i||t};n.addListener=function(n,t){var i=this.getListenersAsObject(n),f=typeof t=="object";for(var r in i)i.hasOwnProperty(r)&&u(i[r],t)===-1&&i[r].push(f?t:{listener:t,once:!1});return this};n.on=i("addListener");n.addOnceListener=function(n,t){return this.addListener(n,{listener:t,once:!0})};n.once=i("addOnceListener");n.defineEvent=function(n){return this.getListeners(n),this};n.defineEvents=function(n){for(var t=0;t<n.length;t+=1)this.defineEvent(n[t]);return this};n.removeListener=function(n,t){var i=this.getListenersAsObject(n),r;for(var f in i)i.hasOwnProperty(f)&&(r=u(i[f],t),r!==-1&&i[f].splice(r,1));return this};n.off=i("removeListener");n.addListeners=function(n,t){return this.manipulateListeners(!1,n,t)};n.removeListeners=function(n,t){return this.manipulateListeners(!0,n,t)};n.manipulateListeners=function(n,t,i){var r,u,f=n?this.removeListener:this.addListener,e=n?this.removeListeners:this.addListeners;if(typeof t!="object"||t instanceof RegExp)for(r=i.length;r--;)f.call(this,t,i[r]);else for(r in t)t.hasOwnProperty(r)&&(u=t[r])&&(typeof u=="function"?f.call(this,r,u):e.call(this,r,u));return this};n.removeEvent=function(n){var r=typeof n,t=this._getEvents(),i;if(r==="string")delete t[n];else if(r==="object")for(i in t)t.hasOwnProperty(i)&&n.test(i)&&delete t[i];else delete this._events;return this};n.removeAllListeners=i("removeEvent");n.emitEvent=function(n,t){var r=this.getListenersAsObject(n),i,f,u,e;for(u in r)if(r.hasOwnProperty(u))for(f=r[u].length;f--;)i=r[u][f],i.once===!0&&this.removeListener(n,i.listener),e=i.listener.apply(this,t||[]),e===this._getOnceReturnValue()&&this.removeListener(n,i.listener);return this};n.trigger=i("emitEvent");n.emit=function(n){var t=Array.prototype.slice.call(arguments,1);return this.emitEvent(n,t)};n.setOnceReturnValue=function(n){return this._onceReturnValue=n,this};n._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0};n._getEvents=function(){return this._events||(this._events={})};t.noConflict=function(){return r.EventEmitter=f,t};typeof define=="function"&&define.amd?define("eventEmitter/EventEmitter",[],function(){return t}):typeof module=="object"&&module.exports?module.exports=t:this.EventEmitter=t}).call(this),function(n){function f(t){var i=n.event;return i.target=i.target||i.srcElement||t,i}var t=document.documentElement,r=function(){},i,u;t.addEventListener?r=function(n,t,i){n.addEventListener(t,i,!1)}:t.attachEvent&&(r=function(n,t,i){n[t+i]=i.handleEvent?function(){var t=f(n);i.handleEvent.call(i,t)}:function(){var t=f(n);i.call(n,t)};n.attachEvent("on"+t,n[t+i])});i=function(){};t.removeEventListener?i=function(n,t,i){n.removeEventListener(t,i,!1)}:t.detachEvent&&(i=function(n,t,i){n.detachEvent("on"+t,n[t+i]);try{delete n[t+i]}catch(r){n[t+i]=undefined}});u={bind:r,unbind:i};typeof define=="function"&&define.amd?define("eventie/eventie",u):n.eventie=u}(this),function(n,t){typeof define=="function"&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],function(i,r){return t(n,i,r)}):typeof exports=="object"?module.exports=t(n,require("wolfy87-eventemitter"),require("eventie")):n.imagesLoaded=t(n,n.EventEmitter,n.eventie)}(window,function(n,t,i){function h(n,t){for(var i in t)n[i]=t[i];return n}function a(n){return l.call(n)==="[object Array]"}function v(n){var t=[],i,r;if(a(n))t=n;else if(typeof n.length=="number")for(i=0,r=n.length;i<r;i++)t.push(n[i]);else t.push(n);return t}function r(n,t,i){if(!(this instanceof r))return new r(n,t);if(typeof n=="string"&&(n=document.querySelectorAll(n)),this.elements=v(n),this.options=h({},this.options),typeof t=="function"?i=t:h(this.options,t),i)this.on("always",i);this.getImages();f&&(this.jqDeferred=new f.Deferred);var u=this;setTimeout(function(){u.check()})}function e(n){this.img=n}function u(n){this.src=n;o[n]=this}var f=n.jQuery,s=n.console,c=typeof s!="undefined",l=Object.prototype.toString,o;return r.prototype=new t,r.prototype.options={},r.prototype.getImages=function(){var i,f,n,t,u,r,e,o;for(this.images=[],i=0,f=this.elements.length;i<f;i++)if(n=this.elements[i],n.nodeName==="IMG"&&this.addImage(n),t=n.nodeType,t&&(t===1||t===9||t===11))for(u=n.querySelectorAll("img"),r=0,e=u.length;r<e;r++)o=u[r],this.addImage(o)},r.prototype.addImage=function(n){var t=new e(n);this.images.push(t)},r.prototype.check=function(){function f(n,r){return t.options.debug&&c&&s.log("confirm",n,r),t.progress(n),u++,u===i&&t.complete(),!0}var t=this,u=0,i=this.images.length,n,r;if(this.hasAnyBroken=!1,!i){this.complete();return}for(n=0;n<i;n++){r=this.images[n];r.on("confirm",f);r.check()}},r.prototype.progress=function(n){this.hasAnyBroken=this.hasAnyBroken||!n.isLoaded;var t=this;setTimeout(function(){t.emit("progress",t,n);t.jqDeferred&&t.jqDeferred.notify&&t.jqDeferred.notify(t,n)})},r.prototype.complete=function(){var t=this.hasAnyBroken?"fail":"done",n;this.isComplete=!0;n=this;setTimeout(function(){if(n.emit(t,n),n.emit("always",n),n.jqDeferred){var i=n.hasAnyBroken?"reject":"resolve";n.jqDeferred[i](n)}})},f&&(f.fn.imagesLoaded=function(n,t){var i=new r(this,n,t);return i.jqDeferred.promise(f(this))}),e.prototype=new t,e.prototype.check=function(){var n=o[this.img.src]||new u(this.img.src),t;if(n.isConfirmed){this.confirm(n.isLoaded,"cached was confirmed");return}if(this.img.complete&&this.img.naturalWidth!==undefined){this.confirm(this.img.naturalWidth!==0,"naturalWidth");return}t=this;n.on("confirm",function(n,i){return t.confirm(n.isLoaded,i),!0});n.check()},e.prototype.confirm=function(n,t){this.isLoaded=n;this.emit("confirm",this,t)},o={},u.prototype=new t,u.prototype.check=function(){if(!this.isChecked){var n=new Image;i.bind(n,"load",this);i.bind(n,"error",this);n.src=this.src;this.isChecked=!0}},u.prototype.handleEvent=function(n){var t="on"+n.type;this[t]&&this[t](n)},u.prototype.onload=function(n){this.confirm(!0,"onload");this.unbindProxyEvents(n)},u.prototype.onerror=function(n){this.confirm(!1,"onerror");this.unbindProxyEvents(n)},u.prototype.confirm=function(n,t){this.isConfirmed=!0;this.isLoaded=n;this.emit("confirm",this,t)},u.prototype.unbindProxyEvents=function(n){i.unbind(n.target,"load",this);i.unbind(n.target,"error",this)},r});var imageType,UserSettings=function(){function n(){this.settingsparam={expires:9999,path:"/"}}return n.prototype.GetValue=function(n,t){n="vr-"+n;var i=$.cookie(n);return typeof i=="undefined"?t:i},n.prototype.Save=function(n,t){n="vr-"+n;$.cookie(n,t,this.settingsparam)},n.prototype.Delete=function(n){n="vr-"+n;$.removeCookie(n)},n.prototype.SaveLimited=function(n,t,i){var r,u;n="vr-"+n;r=new Date;r.setTime(r.getTime()+i*6e4);u={expires:r,path:"/"};$.cookie(n,t,u)},n.prototype.ChangeLanguage=function(n,t){this.Save(n,t);setTimeout(location.reload(),500)},n}(),settings=new UserSettings,Refspot=function(){function n(n,t,i){this.Lat=n;this.Lon=t;this.Name=i}return n.prototype.toString=function(){return this.Lat.toString()+"|"+this.Lon.toString()+"|"+this.Name},n}(),LocationSettings=function(){function n(){this.refspot1=this.parseCookie($.fn.cookie("Vaderradarspot1"));this.refspot2=this.parseCookie($.fn.cookie("Vaderradarspot2"));this.refspot3=this.parseCookie($.fn.cookie("Vaderradarspot3"))}return n.prototype.parseCookie=function(n){if(n===null||typeof n=="undefined")return null;var t=parseFloat(n.split("|")[0]),i=parseFloat(n.split("|")[1]),r=n.split("|")[2];return new Refspot(t,i,r)},n.prototype.save=function(){this.refspot1!=null&&$.fn.cookie("Vaderradarspot1",this.refspot1.toString(),{expires:9999,path:"/"});this.refspot2!=null&&$.fn.cookie("Vaderradarspot2",this.refspot2.toString(),{expires:9999,path:"/"});this.refspot3!=null&&$.fn.cookie("Vaderradarspot3",this.refspot3.toString(),{expires:9999,path:"/"})},n}(),UrlShare=function(){function n(){}return n.prototype.getUrlFull=function(){var i=parseFloat(settings.GetValue(imageType+"_centerX",zoomAction._defaultCenterX)).toFixed(0),r=parseFloat(settings.GetValue(imageType+"_centerY",zoomAction._defaultCenterY)).toFixed(0),u=zoomAction._level,f=imageType,n="?x="+i+"&y="+r+"&zoom="+u+"&imagetype="+f,t=window.location.href.indexOf("#");return t>0?window.location.href.substring(0,t)+"#"+n:window.location.href+"#"+n},n}();$(document).ready(function(){});var language,showReferenceSpot,settings=new UserSettings,zoomAction,urlshare,imageresolution,Zoom=function(){function n(n,t){this._zoomfactor=1;this._level=1;this._defaultImageWidth=1600;this._defaultImageHeight=1600;this._defaultCenterX=700;this._defaultCenterY=1400;this._mouseDown=!1;this._zoomAbleImageTypes=["actueel"];this._viewPort=n;this._image=t;imageType=="radareuropa"&&(this._defaultImageHeight=1450,this._defaultImageWidth=2e3,this._defaultCenterX=800,this._defaultCenterY=400);(imageType=="RadarScandinavie"||imageType=="radarscandinavie"||imageType=="radarscanprognos"||imageType=="radarscanlightning")&&(this._defaultCenterX=800,this._defaultCenterY=780,this._defaultImageWidth=2e3,this._defaultImageHeight=1385);imageType=="radarsverigeprognos"&&(this._defaultCenterX=1190,this._defaultCenterY=395,this._defaultImageWidth=2e3,this._defaultImageHeight=1385);imageType.indexOf("visual5hd")>=0&&(this._defaultCenterX=990,this._defaultCenterY=1095,this._defaultImageWidth=1690,this._defaultImageHeight=1230)}return n.prototype.setCenterToMyLocation=function(n,t){this._defaultCenterX=n;this._defaultCenterY=t},n.prototype.setCenter=function(n,t){var l=this,u,o,f;typeof t=="undefined"&&(t=!1);u=this._defaultImageWidth*n;o=this._defaultImageHeight*n;this._viewPort.height($(window).height()-this._viewPort.offset().top);this._viewPort.width($(window).width()-this._viewPort.offset().left);var h=this._defaultCenterX*n,c=this._defaultCenterY*n,s=$(this._viewPort).width(),e=$(this._viewPort).height(),i=s/2-h,r=e/2-c;this._currentX=this._defaultCenterX;this._currentY=this._defaultCenterY;f=this.getAdjustForBounds(i,r,u,o,s,e);i=f[0];r=f[1];t||(this._currentX=parseFloat(settings.GetValue(imageType+"_centerX",zoomAction._defaultCenterX)),this._currentY=parseFloat(settings.GetValue(imageType+"_centerY",zoomAction._defaultCenterY)),h=this._currentX*n,c=this._currentY*n,i=s/2-h,r=e/2-c,f=this.getAdjustForBounds(i,r,u,o,s,e),i=f[0],r=f[1]);settings.Save(imageType+"_centerX",this._currentX);settings.Save(imageType+"_centerY",this._currentY);this._image.animate({width:u,left:i,top:r},150,function(){l.updateRefspots(u,Math.round(i),Math.round(r));try{}catch(n){}l.updateImageMap($("#radarimg"),u,o);$(".info").css("visibility","visible")});this.updateRefspots(u,i,r);try{}catch(a){}this.updatePanMobile();$("#aside").css("min-height",e+100);try{$("#mainContainer").css("top",$("#asideImageContainer").offset().top+$("#asideImageContainer").height());$("#aside").css("min-height",$("#mainContainer").offset().top+$("#mainContainer").height()-$("#aside").offset().top);$("#opvulling").css("min-height",$("#mainContainer").offset().top+$("#mainContainer").height()-$("#opvulling").offset().top)}catch(v){}},n.prototype.getAdjustForBounds=function(n,t,i,r,u,f){var e=-(r-f),o=-(i-u);return t<e&&(t=e),n<o&&(n=o),t>0&&(t=0),n>0&&(n=0),[n,t]},n.prototype.getOffsetFromSettings=function(n,t,i,r){var u=settings.GetValue("offsetX-"+Math.round(n),i),f=settings.GetValue("offsetY-"+Math.round(t),r);return[u,f]},n.prototype.getZoomFactor=function(){return this._zoomfactor},n.prototype.hideRefspots=function(){$(".mark img.refspot").hide()},n.prototype.updateRefspots=function(n,t,i){var r=this,u=$(".mark img.refspot");u.each(function(u,f){var e=$(f).attr("data-left"),o=$(f).attr("data-top"),s=n/r._defaultImageWidth,v=$(r._viewPort).width(),y=$(r._viewPort).height(),h=30,a=settings.GetValue("mylocationShow",""),c,l;parseFloat(e)>0&&parseFloat(o)>0?(c=h/-2+t+parseFloat(e)*s,l=h/-2+i+parseFloat(o)*s,$(f).css({left:c,top:l,display:"block"})):$(f).css({display:"none"});$(f).attr("id")=="refspot-0"&&a=="false"&&$(f).css({display:"none"})});this.updateFloatingTimelabel()},n.prototype.updateFloatingTimelabel=function(){this._floatingTimeLabelFixed&&this.positionFloatingTimeLabel(this._refspotLast)},n.prototype.showFloatingTimeLabel=function(n){this.positionFloatingTimeLabel(n);$("#"+n).addClass("timelabel");$("#"+n).attr("src","");$("#"+n).attr("src","/content/images/refspot-transparant.png");$("#floatingtimelabel").css({display:"block"})},n.prototype.hideFloatingTimeLabel=function(n){$("#"+n).hasClass("active")?$("#"+n).attr("src","/content/images/refspotGPS.png"):$("#"+n).attr("src","/content/images/refspot.png");$("#"+n).css("width:","30px");$("#"+n).removeClass("timelabel");$("#floatingtimelabel").css({display:"none"})},n.prototype.positionFloatingTimeLabel=function(n){try{var t=$("#"+n).offset();$("#floatingtimelabel").css({left:t.left+45,top:t.top+4})}catch(i){}},n.prototype.updatePanMobile=function(){var n,t,i=$(".map"),u=Math.min(this._image.width(),$(".map").width())*.4,f=Math.min(this._image.height(),$(".map").height())*.2,e=Math.min(this._image.width(),$(".map").width())*.2,r=Math.min(this._image.height(),$(".map").height())*.6;n=i.offset().top;t=i.offset().left+u/1.3333;$("#panUpMob").css({top:n,left:t,width:u,height:f});n=i.offset().top+f*4;t=i.offset().left+u/1.33333;$("#panDownMob").css({top:n,left:t,width:u,height:f});n=Math.max(i.offset().top+r/3,$(".showhide").offset().top+$(".showhide").height()+20);t=i.offset().left;n+r>this._image.height()&&(r=this._image.height()-n);$("#panLeftMob").css({top:n,left:t,width:e,height:r});n=Math.max(i.offset().top+r/3,$(".showhide").offset().top+$(".showhide").height()+20);t=i.offset().left+e*4;n+r>this._image.height()&&(r=this._image.height()-n);$("#panRightMob").css({top:n,left:t,width:e,height:r})},n.prototype.toggleShareList=function(){var n=465,t=$(".shares-panel",".shares").width();n==t?($(".in",".shares").hide(),$(".out",".shares").show(),$(".shares-panel",".shares").animate({width:0},200)):($(".in",".shares").show(),$(".out",".shares").hide(),$(".shares-panel",".shares").animate({width:n},200))},n.prototype.toggleFloatingTimeLabel=function(n){this._floatingTimeLabelFixed&&$("#floatingtimelabel").css("display")!="none"&&($("#floatingtimelabel").css("display")!="block"||this._refspotLast==n.id)?(this.hideFloatingTimeLabel(n.id),this._floatingTimeLabelFixed=!1):(this.hideFloatingTimeLabel(this._refspotLast),this.showFloatingTimeLabel(n.id),this._floatingTimeLabelFixed=!0);this._refspotLast=n.id},n.prototype.updateImageMap=function(n,t,i){var u=t,f=i,e=u/this._defaultImageWidth,o=f/this._defaultImageHeight,s=n.attr("usemap").replace("#",""),r="coords";$('map[name="'+s+'"]').find("area").each(function(n,t){var u=$(t),f,s,i;for(u.data(r)||u.data(r,u.attr(r)),f=u.data(r).split(","),s=u.data(r).split(","),i=0;i<2;i++)s[i]=i%2==0?Math.round(parseInt(f[i])*e):Math.round(parseInt(f[i])*o);u.attr(r,s.toString())})},n.prototype.initialize=function(n){var t,i;this._level=settings.GetValue(imageType+"_zoomlevel",n.defaultZoom);this._level>=5&&(this._level=1);var r=settings.GetValue(imageType+"_zoomlevel",-1),f=r==-1,u=$(".navbar-header").height()==null?0:$(".navbar-header").height(),t=($(window).width()-336)/this._defaultImageWidth,i=($(window).height()-u)/this._defaultImageHeight;this._minZoomFactor=t<i?i:t;this._zoomfactor=parseFloat(settings.GetValue(imageType+"_zoomfactor",this._minZoomFactor));this._level==1&&(t=($(window).width()-336)/this._defaultImageWidth,i=1,this._minZoomFactor=i<t?i:t,this._zoomfactor=parseFloat(settings.GetValue(imageType+"_zoomfactor",this._minZoomFactor)));this._level==1&&$(window).width()<769&&(t=($(window).width()-336)/this._defaultImageWidth,i=($(window).height()-50)/this._defaultImageHeight,this._minZoomFactor=t<i?i:t,this._zoomfactor=parseFloat(settings.GetValue(imageType+"_zoomfactor",this._minZoomFactor)));urlshare=(new UrlShare).getUrlFull();this.initialiseControls();this.reset()},n.prototype.initializeWithParams=function(n,t,i,r){var u,f;this._level=r;var e=r,o=e==2,s=$(".navbar-header").height()==null?0:$(".navbar-header").height(),u=($(window).width()-336)/this._defaultImageWidth,f=($(window).height()-s)/this._defaultImageHeight;this._minZoomFactor=u<f?f:u;this._zoomfactor=r>1&&r<5?this._minZoomFactor+(r-1)*.5:this._minZoomFactor;this._currentX=this._defaultCenterX;this._currentY=this._defaultCenterY;this._level==1&&(u=($(window).width()-336)/this._defaultImageWidth,f=1,this._minZoomFactor=f<u?f:u,this._zoomfactor=parseFloat(settings.GetValue(imageType+"_zoomfactor",this._minZoomFactor)));this._level==1&&$(window).width()<769&&(u=($(window).width()-336)/this._defaultImageWidth,f=($(window).height()-50)/this._defaultImageHeight,this._minZoomFactor=u<f?f:u,this._zoomfactor=parseFloat(settings.GetValue(imageType+"_zoomfactor",this._minZoomFactor)));o&&(this._zoomfactor=this._zoomfactor+.5);this.setCenterToMyLocation(t,i);this.setCenter(this._zoomfactor,!0);urlshare=(new UrlShare).getUrlFull();this.initialiseControls()},n.prototype.initialiseControls=function(){var n=this,o=new UrlHelper,t=this,s=o.getParameterQuery("webcams"),i,r,u,f,e;$(".iabuttons #zoom").removeClass("level1");$(".iabuttons #zoom").removeClass("level2");$(".iabuttons #zoom").removeClass("level3");$(".iabuttons #zoom").removeClass("level4");$(".iabuttons #zoom").addClass("level"+this._level);$(".iabuttons #zoom").on("click",function(){$(".iabuttons #zoom").removeClass("level1");$(".iabuttons #zoom").removeClass("level2");$(".iabuttons #zoom").removeClass("level3");$(".iabuttons #zoom").removeClass("level4");t._zoomfactor=t._zoomfactor+.5;t._level++;t._level>=5&&(t._level=1,t._zoomfactor=n._minZoomFactor);t.setCenter(n._zoomfactor,!1);urlshare=(new UrlShare).getUrlFull();$(".iabuttons #zoom").addClass("level"+t._level);settings.Save(imageType+"_zoomfactor",t._zoomfactor);settings.Save(imageType+"_zoomlevel",t._level)});$(".iabuttons .panup").on("click",function(){n.panup(100)});$(".iabuttons .pandown").on("click",function(){n.pandown(100)});$(".iabuttons .panleft").on("click",function(){n.panleft(100)});$(".iabuttons .panright").on("click",function(){n.panright(100)});$(".panMobile #panUpMob").on("click",function(){n.panup(100)});$(".panMobile #panDownMob").on("click",function(){n.pandown(100)});$(".panMobile #panLeftMob").on("click",function(){n.panleft(100)});$(".panMobile #panRightMob").on("click",function(){n.panright(100)});if($(".iabuttons .panup").on("mousedown",function(){i=setInterval(function(){n.panup(20)},150)}).mouseup(function(){clearInterval(i)}),$(".iabuttons .pandown").on("mousedown",function(){r=setInterval(function(){n.pandown(20)},150)}).mouseup(function(){clearInterval(r)}),$(".iabuttons .panleft").on("mousedown",function(){u=setInterval(function(){n.panleft(20)},150)}).mouseup(function(){clearInterval(u)}),$(".iabuttons .panright").on("mousedown",function(){f=setInterval(function(){n.panright(20)},150)}).mouseup(function(){clearInterval(f)}),e=this._zoomAbleImageTypes.indexOf(imageType.toLowerCase())>-1,e){$("#radarimg").css("cursor","pointer");$(".refspot").css("cursor","pointer");$("#radarimg").on("dblclick",function(t){var i=typeof t.offsetX!="undefined"?t.offsetX:t.pageX-$(t.target).offset().left,r=typeof t.offsetY!="undefined"?t.offsetY:t.pageY-$(t.target).offset().top,u="/zoom/"+Math.round(i/n._zoomfactor)+"/"+Math.round(r/n._zoomfactor)+"/"+imageType;window.location.href=u});$("area").on("dblclick",function(t){var i=parseInt($(t.currentTarget).attr("coords").split(",")[0]),r=parseInt($(t.currentTarget).attr("coords").split(",")[1]),u="/zoom/"+Math.round(i/n._zoomfactor)+"/"+Math.round(r/n._zoomfactor)+"/"+imageType;window.location.href=u});$(".refspot").on("dblclick",function(n){var t=parseInt($(n.currentTarget).attr("data-left")),i=parseInt($(n.currentTarget).attr("data-top")),r="/zoom/"+Math.round(t)+"/"+Math.round(i)+"/"+imageType;window.location.href=r})}(imageType+"").toLowerCase()==settings.GetValue("defaultimagetype","")&&$(".checkfav a").addClass("active");$(".checkfav a").on("click",function(t){n.toggleDefaultImageType();t.preventDefault()});$(".showhide",".shares").on("click",function(){return n.toggleShareList()});$(".refspot").on("click",function(t){return n.toggleFloatingTimeLabel(t.target)});$(".refspot").hover(function(){t._floatingTimeLabelFixed||t.showFloatingTimeLabel(this.id)},function(){t._floatingTimeLabelFixed||t.hideFloatingTimeLabel(this.id)});try{}catch(h){}},n.prototype.panup=function(n){this.panmove(0,n)},n.prototype.pandown=function(n){this.panmove(0,-n)},n.prototype.panleft=function(n){this.panmove(n,0)},n.prototype.panright=function(n){this.panmove(-n,0)},n.prototype.panmove=function(n,t){var h=this,i=parseFloat(this._image.css("left")),r=parseFloat(this._image.css("top")),u=parseFloat(this._image.css("width")),c=parseFloat(this._image.css("height")),l=$(this._viewPort).height(),a=$(this._viewPort).width();r=r+t;i=i+n;var o=-(c-l),s=-(u-a),f=n/this._zoomfactor,e=t/this._zoomfactor;r>0&&(r=-20,e=0);i>0&&(i=0,f=0);r<o&&(r=o,e=0);i<s&&(i=s,f=0);this._currentX-=f;this._currentY-=e;this._currentX>this._defaultImageWidth&&(this._currentX=this._defaultImageWidth);this._currentY>this._defaultImageHeight&&(this._currentY=this._defaultImageHeight);this._currentX<0&&(this._currentX=0);this._currentY<0&&(this._currentY=0);settings.Save(imageType+"_centerX",this._currentX);settings.Save(imageType+"_centerY",this._currentY);urlshare=(new UrlShare).getUrlFull();this.hideRefspots();this._image.animate({width:u,left:i,top:r},150,function(){h.updateRefspots(u,i,r);try{}catch(n){}})},n.prototype.reset=function(){this.setCenter(this._zoomfactor);$("#reload").width($(".info").width());$("#reload").height($(".info").height())},n.prototype.toggleDefaultImageType=function(){$(".checkfav a").hasClass("active")?this.removeDefaultImageType():this.saveDefaultImageType()},n.prototype.saveDefaultImageType=function(){settings.Save("defaultimagetype",imageType);$(".checkfav a").addClass("active")},n.prototype.removeDefaultImageType=function(){settings.Delete("defaultimagetype");$(".checkfav a").removeClass("active")},n.prototype.setUrlHash=function(){var n=parseFloat(settings.GetValue(imageType+"_centerX",zoomAction._defaultCenterX)).toFixed(0),t=parseFloat(settings.GetValue(imageType+"_centerY",zoomAction._defaultCenterY)).toFixed(0),i=zoomAction._level,r=imageType;window.location.hash="&x="+n+"&y="+t+"&zoom="+i+"&imagetype="+r},n}(),Resize=function(){function n(){}return n.prototype.initialize=function(n){$(window).resize(function(){this.resizeTO&&clearTimeout(this.resizeTO);this.resizeTO=setTimeout(function(){var n,t;n=$(".img").is(":visible")?$(".img").outerWidth():0;t=$(".fullcontainer.body-content").width();$(".info").width()+n!=t&&$(".info").width(t-n-4);$("#reload").width($(".info").width());$("#reload").height($(".info").height());$(this).trigger("resizeEnd")},500);try{$("#mainContainer").css("top",$("#asideImageContainer").offset().top+$("#asideImageContainer").height());$("#aside").css("min-height",$("#mainContainer").offset().top+$("#mainContainer").height()-$("#aside").offset().top);$("#opvulling").css("min-height",$("#mainContainer").offset().top+$("#mainContainer").height()-$("#opvulling").offset().top)}catch(n){}});$(window).bind("resizeEnd",function(){setTimeout(function(){n()},200)})},n}(),MyLocation=function(){function n(n){var i=this,t;this._longitudeStart=2.865478;this._longitudeEnd=35.110422;this._latitudeStart=71.546744;this._latitudeEnd=53.879462;this._defaultImageWidth=1600;this._defaultImageHeight=1600;this.options={enableHighAccuracy:!0,timeout:5e3,maximumAge:0};imageType=="radareuropa"&&(this._latitudeStart=72,this._longitudeStart=-19.625,this._latitudeEnd=32.6257,this._longitudeEnd=51.25,this._defaultImageWidth=2e3,this._defaultImageHeight=1450);(imageType=="RadarScandinavie"||imageType=="radarscandinavie"||imageType=="radarscanprognos"||imageType=="radarsverigeprognos")&&(this._latitudeStart=71.546744,this._longitudeStart=2.865478-12,this._latitudeEnd=53.879462,this._longitudeEnd=35.110422,this._defaultImageWidth=2e3,this._defaultImageHeight=1385);this._locationButton=n;this._locationButton.on("click",function(){i.findLocation()});this.findLocationAtStart();this.SetReferenceSpots();t=settings.GetValue("mylocation","");t!=""&&this.displayLocation(parseFloat(t.split("|")[0]),parseFloat(t.split("|")[1]),"",!1)}return n.prototype.findLocation=function(){var n=this,t;navigator.geolocation&&(t=settings.GetValue("mylocation",""),t==""?navigator.geolocation.getCurrentPosition(function(t){var i=Math.round(t.coords.latitude*100)/100,r=Math.round(t.coords.longitude*100)/100;n.CheckLatLonBoundaries(i,r)?n.displayLocation(i,r,null,!0):(settings.Delete("mylocation"),settings.Save("mylocationShow","false"))},function(){settings.Delete("mylocation");settings.Save("mylocationShow","false")},this.options):($("#refspot-0").toggle(),$("#refspot-0").is(":visible")?(settings.Save("mylocationShow","true"),settings.Delete("centerX"),settings.Delete("centerY"),navigator.geolocation.getCurrentPosition(function(t){var i=Math.round(t.coords.latitude*100)/100,r=Math.round(t.coords.longitude*100)/100;n.CheckLatLonBoundaries(i,r)?n.displayLocation(i,r,null,!0):(settings.Delete("mylocation"),settings.Save("mylocationShow","false"))},function(){settings.Delete("mylocation");settings.Save("mylocationShow","false")},this.options)):settings.Save("mylocationShow","false")))},n.prototype.findLocationAtStart=function(){var n=this,t=settings.GetValue("mylocation","");t==""&&navigator.geolocation.getCurrentPosition(function(t){var i=Math.round(t.coords.latitude*100)/100,r=Math.round(t.coords.longitude*100)/100;n.CheckLatLonBoundaries(i,r)?(n.displayLocation(i,r,null,!0),settings.Save("mylocationShow","true")):(settings.Delete("mylocation"),settings.Save("mylocationShow","false"))},function(){settings.Delete("mylocation");settings.Save("mylocationShow","false")},this.options)},n.prototype.displayLocation=function(n,t,i,r){settings.SaveLimited("mylocation",[n,t].join("|"),240);var u=this.getXYFromLatLon(n,t),f="#refspot-0";$(f).attr("data-left",u[0]);$(f).attr("data-top",u[1]);r&&(zoomAction.setCenterToMyLocation(u[0],u[1]),zoomAction.reset())},n.prototype.displayRefspot=function(n,t,i,r,u){var f=this.getXYFromLatLon(n,t),e="#refspot-"+u.toString();$(e).attr("data-left",f[0]);$(e).attr("data-top",f[1]);$(e).attr("title",i);$(e).attr("alt",i);r&&(zoomAction.setCenterToMyLocation(f[0],f[1]),zoomAction.reset())},n.prototype.SetReferenceSpots=function(){for(var f,n,t=1;t<4;t++)if(f=(t-1).toString(),n=$.cookie("vaderradarspot"+t),n&&typeof n!="undefined")try{var i=n.split("|")[0],r=n.split("|")[1],e=Math.round(parseFloat(i.replace(",","."))*100)/100,o=Math.round(parseFloat(r.replace(",","."))*100)/100,u=n.split("|")[2];if(u==""||i=="0"||r=="0")continue;this.displayRefspot(e,o,u,!1,t)}catch(s){}},n.prototype.getXYFromLatLon=function(n,t){var i=this._longitudeStart,u=this._longitudeEnd,r=this._latitudeStart,f=this._latitudeEnd,e=this._defaultImageWidth,o=this._defaultImageHeight,s=(u-i)/e,h=(r-f)/o,c=Math.round((t-i)/s),l=Math.round((r-n)/h),a=zoomAction.getZoomFactor();return[c,l]},n.prototype.CheckLatLonBoundaries=function(n,t){var i=this._longitudeStart,r=this._longitudeEnd,u=this._latitudeStart,f=this._latitudeEnd;return t<i||t>r?!1:n>u||n<f?!1:!0},n.prototype.getLatLonFromXY=function(n,t){var i=this._longitudeStart,u=this._longitudeEnd,r=this._latitudeStart,f=this._latitudeEnd,e=this._defaultImageWidth,o=this._defaultImageHeight,s=(u-i)/e,h=(r-f)/o,c=n*s+i,l=t*h+r,a=zoomAction.getZoomFactor();return[l,c]},n}(),UrlHelper=function(){function n(){}return n.prototype.getParameterQuery=function(n){n=n.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i="[\\#?&]"+n+"=([^&#]*)",r=new RegExp(i),t=r.exec(window.location.href);return t==null?null:t[1]},n}(),WindowsPhone=function(){function n(){}return n.prototype.initialize=function(){var n;navigator.userAgent.match(/IEMobile/)&&(n=document.createElement("style"),n.appendChild(document.createTextNode("@-ms-viewport{width:auto!important;}")),document.getElementsByTagName("head")[0].appendChild(n));navigator.userAgent.match(/WPDesktop/)&&(n=document.createElement("style"),n.appendChild(document.createTextNode("@-ms-viewport{width:auto!important;}")),document.getElementsByTagName("head")[0].appendChild(n))},n}(),windowsPhoneHack=new WindowsPhone,Messages,messages;windowsPhoneHack.initialize();Messages=function(){function n(){}return n.prototype.displayCookieMessage=function(){if(!(window.location.pathname.toLowerCase().indexOf("gratisradar")>-1)){var n="<div id='cookie-message'>"+hostname+" använder cookies. Varför? <a href='/service/privacy/'> Klicka <\/a> HÄR för mer information. <span> Stäng. <\/ span> <\/ div>";language=="FR"&&(n="<div id='cookie-message'>"+hostname+" utilise des cookies. Pourquoi? Cliquez <a href='/service/privacy/'>ICI<\/a> pour plus d'informations. <span>Fermer.<\/span><\/div>");$(document).ready(function(){if(settings.GetValue("cookiemessage","")!="hide"){$("body").append(n);$("#cookie-message > span").on("click",function(){settings.Save("cookiemessage","hide");$("#cookie-message").hide()})}})}},n}();$(document).ready(function(){});var language,culture,recordIndex=0,mapurl="//dev.virtualearth.net/REST/v1/Imagery/Map/Road/{lat},{lon}/11?ms=200,236&od=1&c="+culture+"&key=AijbFhynMi9YlUoC5sbBKfrfbnkcMJ34sYBEORQwbsviodnw8nTkkgh5se5COtMs&ur="+language,detailmapurl="//dev.virtualearth.net/REST/v1/Imagery/Map/Road/{lat},{lon}/14?ms=200,236&od=1&c="+culture+"&key=AijbFhynMi9YlUoC5sbBKfrfbnkcMJ34sYBEORQwbsviodnw8nTkkgh5se5COtMs&ur="+language,targetUrl="/"+language+"/forecast/h/{locationid}/{name}",selectedCountry,mouseEvent,activeRequest;$("#location").autocomplete({source:function(n,t){findLocations(n,t)},minLength:3});mouseEvent=null;$("#countrycodes").on("change",function(){var n={term:$("#location").val(),country:$("#countrycodes").val()};findLocations(n,null)});$("#location").on("input",function(){$("#location").val().length==0&&$("#resultset").hide()});$("#clear").on("click",function(){$("#location").val("");$("#resultset").hide()});$(".zoekplaats input").on("keydown",function(n){try{processKeyInput(n)}catch(n){}});activeRequest="";$.ajax({url:"/"+language+"/api/countrylist",type:"GET",cache:!0,dataType:"json",success:function(n){var i,r,t,u;if(n&&n.length!=0){for(i="",r=!1,i+="<select id='countrycodes'>",t=0;t<n.length;t++)n[t].DisplayOrder!=99||r||(i+="<option class='split'>===============================<\/option>",r=!0),u="",selectedCountry==n[t].CountryCode&&(u=" selected='selected' "),i+="<option "+u+" value='"+n[t].CountryCode+"' class=''>"+n[t].Name+"<\/option>";i+="<\/select>";$("#countrylist").html(i)}}})