function drawAll(){initChart(null)}function drawBasic(){var n=new google.visualization.DataTable,t,i;n.addColumn("timeofday","Time of Day");n.addColumn("number","Motivation Level");n.addRow([{v:[7,0,0],f:"7 am"},1]);n.addRows([[{v:[8,0,0],f:"8 am"},1],[{v:[9,0,0],f:"9 am"},2],[{v:[10,0,0],f:"10 am"},3],[{v:[11,0,0],f:"11 am"},4],[{v:[12,0,0],f:"12 pm"},5],[{v:[13,0,0],f:"1 pm"},6],[{v:[14,0,0],f:"2 pm"},7],[{v:[15,0,0],f:"3 pm"},8],[{v:[16,0,0],f:"4 pm"},9],[{v:[17,0,0],f:"5 pm"},10],]);t={title:"Motivation Level Throughout the Day",hAxis:{title:"Time of Day",format:"h:mm a",viewWindow:{min:[6,30,0],max:[17,30,0]}},vAxis:{title:"Rating (scale of 1-10)"}};i=new google.visualization.ColumnChart(document.getElementById("chart_div"));i.draw(n,t)}function initChart(n){var i,t,r,u,f,e;try{i=!1;typeof n=="undefined"||n==null?$.cookie(selectedRefspot)?(refPosCookValue=$.cookie($.cookie(selectedRefspot)),refPosCookValue?activeRefspotNameIndex=refspotNames.indexOf($.cookie(selectedRefspot)):GetRefspotsExist()!=""&&(refPosCookValue=$.cookie(GetRefspotsExist()))):(refPosCookValue=$.cookie(refPosCookieName),refPosCookValue||GetRefspotsExist()!=""&&(refPosCookValue=$.cookie(GetRefspotsExist()))):refPosCookValue=$.cookie(n);typeof refPosCookValue=="undefined"&&(refPosCookValue="50.7156|-3.5309|Devon");refPosCookValue?(SetActiveRefspot(activeRefspotNameIndex),t=refPosCookValue.split("|"),t&&(r=t[0],u=t[1],maxPrecip=0,refspotTitle=t.length>2?t[2]:"current location",$(".chartForecastTitle").each(function(){$(this).text(refspotTitle)}),CheckChartLatLonBoundaries(r,u)==!0?(f=precipForecastURL.replace(/{lat}/g,r),f=f.replace(/{lon}/g,u),$.ajax({type:"GET",url:f,cache:!1,success:function(n){var r,t,u;n&&n!=null&&(data=n.ForecastResult,data&&(t=1,$.each(data,function(){r=new Date(parseInt(this.TimeStamp.substr(6)));Date.now()<r&&(precipData[t]=[],precipData[t].push(new Date(parseInt(this.TimeStamp.substr(6)))),isNaN(this.Value)?(i=!0,precipData[t].push(0)):precipData[t].push(this.Value),precipData[t].push(this.ColorAsRGB),lastRainTime=new Date(parseInt(this.TimeStamp.substr(6))).toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit"}),this.Value>0&&(raining=!0,firstRainTime==""&&(firstRainTime=new Date(parseInt(this.TimeStamp.substr(6))).toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit"}),firstRainVal=this.Value)),!showChart&&this.Value>0&&(showChart=!0),this.Value>maxPrecip&&(maxPrecip=this.Value),t++)})),maxPrecip<1&&(maxPrecip=1),u=precipData[precipData.length-1][0],precipData&&!i&&drawChart())},error:function(n,t,i){var r=i||n.statusText},dataType:"jsonp",jsonp:"callback",crossDomain:!0}),e=new webcams,e.getWebcams4refspot(r,u,refspotTitle)):($(".nextRefspotContainer").show(),$(".chart_div").hide(),$(".forecastChartYlabel").hide(),$(".chartForecastNodata").show(),$(".precipDryTextLabel").html("The 3 hour forecast graph cannot be loaded. The location "+refspotTitle+" is outside our radarreach. <a href='/mylocations'>Change the location.<\/a>"))),i&&($(".nextRefspotContainer").show(),$(".chart_div").hide(),$(".forecastChartYlabel").hide(),$(".chartForecastNodata").show(),$(".precipDryTextLabel").html("An error occurred when reading the data."))):($(".chart_div").hide(),$(".forecastChartYlabel").hide(),$(".chartForecastNodata").show(),$(".precipDryTextLabel").html("The 3 hour forecast graph cannot be loaded. Please allow automatic location detection or <a href='/mylocations'>enter your favourite location<\/a>."))}catch(o){}}function formatTime(n){return(100+n.getHours()).toString().substring(1,3)+":"+(100+n.getMinutes()).toString().substring(1,3)}function drawChart(){var n,t,i;$(".chartForecastNodata").hide();$(".chartForecastPrecip").show();$(".nextRefspotContainer").show();$(".forecastChartYlabel").show();raining?(firstRainVal<2.5&&(firstRainType=" light "),n="rain from "+firstRainTime):n="dry until "+lastRainTime;t=google.visualization.arrayToDataTable(precipData);i={axisTitlesPosition:"in",title:n,titleTextStyle:{color:"black",fontName:"Arial",fontSize:11,bold:!0,italic:!1},hAxis:{title:null,titleTextStyle:{color:"red"},format:"HH:mm"},vAxis:{maxValue:maxPrecip*1.01,minValue:0,baseline:0,viewWindowMode:"explicit",viewWindow:{min:0,max:maxPrecip*1.01}},legend:{position:"none"}};$(".chart_div").each(function(){var n=new google.visualization.ColumnChart(this);n.draw(t,i)});$(".chart_div").fadeIn("slow")}function SetActiveRefspot(n){for(index=0;index<refspotIDs.length;++index)$("#"+refspotIDs[index]).hasClass("timelabel")||$("#"+refspotIDs[index]).attr("src","/content/images/refspot.png"),$("#"+refspotIDs[index]).removeClass("active");$("#"+refspotIDs[n]).hasClass("timelabel")||$("#"+refspotIDs[n]).attr("src","/content/images/refspotGPS.png");$("#"+refspotIDs[n]).addClass("active")}function ShowChartNextRefspot(){try{if(CheckRefspotsExist()){for(i=1;i<refspotNames.length+1;i++)if(activeRefspotNameIndex+=1,activeRefspotNameIndex>refspotNames.length-1&&(activeRefspotNameIndex=0),$.cookie(refspotNames[activeRefspotNameIndex])){firstRainType=" ";firstRainTime="";firstRainVal=0;raining=!1;lastRainTime="";$.cookie(selectedRefspot,refspotNames[activeRefspotNameIndex]);initChart(refspotNames[activeRefspotNameIndex]);break}}else confirm(text_no_refspot)&&(window.location.href="/mylocations")}catch(n){}}function CheckRefspotsExist(){try{for(i=1;i<refspotNames.length;i++)if($.cookie(refspotNames[i]))return!0;return!1}catch(n){return!1}}function GetRefspotsExist(){try{for(i=0;i<refspotNames.length;i++)if($.cookie(refspotNames[i]))return refspotNames[i];return""}catch(n){return""}}function CheckChartLatLonBoundaries(n,t){try{return t<-19.625||t>51.25?!1:n>72||n<32.625?!1:!0}catch(i){return!1}}function testSpeed4PhoneOnly(){var n,t,i;try{n=settings.GetValue("useMobileSite","");$("#mobileTest").is(":visible")&&n!="no"&&(t=settings.GetValue("resolutionAdvise",""),t==""?(imageresolution="high",i=new ConnectionSpeed,i.measure(function(t){t=="low"&&(n=="yes"?window.location.href="http://m.weerslag.nl":confirm("Uw verbinding is niet geschikt voor hoge resolutie beelden. Wilt u de mobile site m.weerslag.nl gebruiken?'")?(settings.SaveLimited("useMobileSite","yes",1440),window.location.href="http://m.weerslag.nl"):settings.SaveLimited("useMobileSite","no",1440))})):(imageresolution=t,imageresolution=="low"&&(n=="yes"?window.location.href="http://m.weerslag.nl":confirm("Uw verbinding is niet geschikt voor hoge resolutie beelden. Wilt u de mobile site m.weerslag.nl gebruiken?'")?(settings.SaveLimited("useMobileSite","yes",1440),window.location.href="http://m.weerslag.nl"):settings.SaveLimited("useMobileSite","no",1440))))}catch(r){imageresolution="high"}}var activeRefspotNameIndex,refspotTitle,connection,ConnectionSpeed;(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",r;for(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),f,r;for(r in i)i.hasOwnProperty(r)&&(f=u(i[r],t),f!==-1&&i[r].splice(f,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("eventEmitter"),require("eventie")):n.imagesLoaded=t(n,n.EventEmitter,n.eventie)}(this,function(n,t,i){function s(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=s({},this.options),typeof t=="function"?i=t:s(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,h=n.console,c=typeof h!="undefined",l=Object.prototype.toString,o;return r.prototype=new t,r.prototype.options={},r.prototype.getImages=function(){var n,u,t,r,i,f,e;for(this.images=[],n=0,u=this.elements.length;n<u;n++)for(t=this.elements[n],t.nodeName==="IMG"&&this.addImage(t),r=t.querySelectorAll("img"),i=0,f=r.length;i<f;i++)e=r[i],this.addImage(e)},r.prototype.addImage=function(n){var t=new e(n);this.images.push(t)},r.prototype.check=function(){function f(n){return t.options.debug&&c,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="ws-"+n;var i=$.cookie(n);return typeof i=="undefined"?t:i},n.prototype.Save=function(n,t){n="ws-"+n;$.cookie(n,t,this.settingsparam)},n.prototype.Delete=function(n){n="ws-"+n;$.removeCookie(n)},n.prototype.SaveLimited=function(n,t,i){var r,u;n="ws-"+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("meteoradarspot1"));this.refspot2=this.parseCookie($.fn.cookie("meteoradarspot2"));this.refspot3=this.parseCookie($.fn.cookie("meteoradarspot3"))}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("meteoradarspot1",this.refspot1.toString(),{expires:9999,path:"/"});this.refspot2!=null&&$.fn.cookie("meteoradarspot2",this.refspot2.toString(),{expires:9999,path:"/"});this.refspot3!=null&&$.fn.cookie("meteoradarspot3",this.refspot3.toString(),{expires:9999,path:"/"})},n}(),UrlShare=function(){function n(){}return n.prototype.getUrlFull=function(){var i=parseFloat(settings.GetValue("centerX",zoomAction._defaultCenterX)).toFixed(0),r=parseFloat(settings.GetValue("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=2e3;this._defaultImageHeight=1450;this._defaultCenterX=570;this._defaultCenterY=780;this._mouseDown=!1;this._zoomAbleImageTypes=["actueel","verwacht","bliksem","mist","sneeuw","minuutradar","motregen","motregenradar","actuelebuienradar","bewolkingdagmetfilter","actueelverwachtebuien"];this._viewPort=n;this._image=t;hostname=="weerslag.be"&&(this._defaultCenterY=1080);(imageType=="radareuropa"||imageType=="radareuropabliksem"||imageType=="radareuropaverwacht"||imageType=="radareuropasneeuw"||imageType=="radareuropasatelliet")&&(this._defaultImageHeight=1450,this._defaultImageWidth=2e3,this._defaultCenterX=1270,this._defaultCenterY=880);imageType=="satellietradareuropavisual"&&(this._defaultCenterX=978,this._defaultCenterY=766);imageType.indexOf("lt")==0&&(imageType.indexOf("europe")>=0&&(this._defaultImageHeight=540*1.78,this._defaultImageWidth=632*1.36,this._defaultCenterX=this._defaultImageWidth/2,this._defaultCenterY=this._defaultImageHeight/2,this._maxwidth=632),imageType.indexOf("asia")>=0&&(this._defaultImageHeight=432*1.4,this._defaultImageWidth=600*1.5,this._defaultCenterX=this._defaultImageWidth/2,this._defaultCenterY=this._defaultImageHeight/2,this._maxwidth=600),imageType.indexOf("nam")>=0&&(this._defaultImageHeight=861,this._defaultImageWidth=861,this._defaultCenterX=this._defaultImageWidth/2,this._defaultCenterY=this._defaultImageHeight/2),imageType.indexOf("sam")>=0&&(this._defaultImageHeight=1134,this._defaultImageWidth=861,this._defaultCenterX=this._defaultImageWidth/2,this._defaultCenterY=this._defaultImageHeight/2,this._maxwidth=861),imageType.indexOf("africa")>=0&&(this._defaultImageHeight=900,this._defaultImageWidth=861,this._defaultCenterX=this._defaultImageWidth/2,this._defaultCenterY=this._defaultImageHeight/2,this._maxwidth=861),imageType.indexOf("oceanic")>=0&&(this._defaultImageHeight=632,this._defaultImageWidth=1e3,this._defaultCenterX=this._defaultImageWidth/2,this._defaultCenterY=this._defaultImageHeight/2,this._maxwidth=1e3))}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,a;t===void 0&&(t=!1);u=this._defaultImageWidth*n;o=this._defaultImageHeight*n;$("#map_gfsforecastnavigation:visible").val()!="undefined"?(this._viewPort.height($(window).height()-this._viewPort.offset().top),this._viewPort.width($(window).width()-this._viewPort.offset().left-$("#map_gfsforecastnavigation:visible").width())):(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{var n=new webcams;n.updateWebcamspots(u,i,r)}catch(t){}l.updateImageMap($("#radarimg"),u,o);$(".info").css("visibility","visible")});this.updateRefspots(u,i,r);try{a=new webcams;a.updateWebcamspots(u,i,r)}catch(v){}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(y){}},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.checkgfsforecastnav=function(){if(imageType.indexOf("lt")==0?($("#map_gfsforecastnavigation").css("display","block"),$(".controlpanelContainer").addClass("hidden")):($("#map_gfsforecastnavigation").css("display","none"),$(".controlpanelContainer").removeClass("hidden")),typeof $("#map_gfsforecastnavigation:visible").val()!="undefined"){var n=$(".info").width()-$("#map_gfsforecastnavigation").width();n>this._defaultImageWidth&&(n=this._defaultImageWidth);$(".info").width(n);$("#map_gfsforecastnavigation").css("left",$(".info").offset().left+$(".info").width())}},n.prototype.initialize=function(n){var t,i;hostname=="weerslag.be"?(this._level=settings.GetValue(imageType+"_zoomlevel",n.defaultZoom+1),this._level>4&&(this._level=4)):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)));this.checkgfsforecastnav();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==-1,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);this.checkgfsforecastnav();urlshare=(new UrlShare).getUrlFull();this.initialiseControls()},n.prototype.initialiseControls=function(){var n=this,s=new UrlHelper,t=this,h=s.getParameterQuery("webcams"),r,u,f,e,o,i;$(".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(){r=setInterval(function(){n.panup(20)},150)}).mouseup(function(){clearInterval(r)}),$(".iabuttons .pandown").on("mousedown",function(){u=setInterval(function(){n.pandown(20)},150)}).mouseup(function(){clearInterval(u)}),$(".iabuttons .panleft").on("mousedown",function(){f=setInterval(function(){n.panleft(20)},150)}).mouseup(function(){clearInterval(f)}),$(".iabuttons .panright").on("mousedown",function(){e=setInterval(function(){n.panright(20)},150)}).mouseup(function(){clearInterval(e)}),o=this._zoomAbleImageTypes.indexOf(imageType.toLowerCase())>-1,o){$("#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{i=new webcams;(settings.GetValue(i._showWebcamCookieName,!1)=="true"||h=="1")&&i.getWebcams2(function(){i.showWebcams()})}catch(c){}},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=-0,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{var n=new webcams;n.updateWebcamspots(u,i,r)}catch(t){}})},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").width():0;($(".info").width()+n<$(window).width()-20||$(".info").width()+n>$(window).width())&&$(".info").width($(window).width()-n-10);typeof $("#map_gfsforecastnavigation:visible").val()!="undefined"&&(t=$(".info").width()-$("#map_gfsforecastnavigation").width(),$("#radarimg").width()<t&&(t=$("#radarimg").width()),$(".info").width(t),$("#map_gfsforecastnavigation").css("left",$(".info").offset().left+$(".info").width()),$("#map_gfsforecastnavigation").css("height",$(".body-content").css("height")));$("#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=-12;this._longitudeEnd=15.5;this._latitudeStart=60;this._latitudeEnd=46.95;this._defaultImageWidth=2e3;this._defaultImageHeight=1450;this.options={enableHighAccuracy:!0,timeout:5e3,maximumAge:0};(imageType=="radareuropa"||imageType=="radareuropabliksem"||imageType=="radareuropaverwacht"||imageType=="radareuropasneeuw")&&(this._latitudeStart=72,this._longitudeStart=-19.625,this._latitudeEnd=32.6257,this._longitudeEnd=51.25);imageType=="satellietradareuropavisual"&&(this._latitudeStart=63.648,this._longitudeStart=-15.129411764705882,this._latitudeEnd=35.568,this._longitudeEnd=31.811764705882354);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(imageType+"_centerX"),settings.Delete(imageType+"_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"));initChart(null)},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,t,n=1;n<4;n++)if(f=(n-1).toString(),t=$.cookie("meteoradarspot"+n),t&&typeof t!="undefined")try{var i=t.split("|")[0],r=t.split("|")[1],e=Math.round(parseFloat(i.replace(",","."))*100)/100,o=Math.round(parseFloat(r.replace(",","."))*100)/100,u=t.split("|")[2];if(u==""||i=="0"||r=="0")continue;this.displayRefspot(e,o,u,!1,n)}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;windowsPhoneHack.initialize();var Messages=function(){function n(){}return n.prototype.displayCookieMessage=function(){if(!(window.location.pathname.toLowerCase().indexOf("gratisradar")>-1)){var n="<div id='cookie-message'>"+hostname+" uses cookies. Why? Click <a href='/service/privacy/'>HERE<\/a> for more information. <span>Close.<\/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.prototype.displayAlert=function(){var t=$(".notification").length>0,n;t&&settings.GetValue("alertseen","false")!="true"&&($(".notification").show(),n=$(".notification p").css("color"),$(".notification").css("color",n));$(".notification .glyphicon").on("click",function(){$(".notification").hide("fast");settings.SaveLimited("alertseen","true",1440)})},n}(),showChart=!1,raining=!1,firstRainType=" ",firstRainTime="",lastRainTime="",firstRainVal=0,refPosCookValue=null,precipData=[],maxPrecip=0;precipData[0]=[];precipData[0]=["Tijd","mm",{role:"style"}];var refPosCookieName="ws-mylocation",selectedRefspot="ws-selectedRefspot",refspotNames=["ws-mylocation","meteoradarspot1","meteoradarspot2","meteoradarspot3"],refspotIDs=["refspot-0","refspot-1","refspot-2","refspot-3"],precipForecastURL="https://api.themeteocompany.com/precipitation/getforecastbylatlon/?lat={lat}&lon={lon}&radius=2&format=jsonp";google.charts.load("current",{packages:["corechart","bar"]});google.charts.setOnLoadCallback(function(){drawAll()});activeRefspotNameIndex=0;$(document).ready(function(){});connection=function(){function n(){}return n}();ConnectionSpeed=function(){function n(){this.downloadSize=35040;this.download=null;this.resolutionAdvise="high";this.download=new Image}return n.prototype.getSpeed=function(){try{var t=window.performance.getEntriesByType("resource"),n,i;if(t!=null)for(n=0;n<t.length;n++)i=t[n].name,i.indexOf(this.imageAddr)>=0&&(this.duration=t[n].duration/1e3,n=t.length)}catch(r){}this.bitsLoaded=this.downloadSize*8;this.speedBps=this.bitsLoaded/this.duration;this.speedKbps=this.speedBps/1024;this.speedMbps=this.speedKbps/1024;this.speedKbps<=30?this.resolutionAdvise="low":this.speedKbps<=260&&(this.resolutionAdvise="medium");settings.SaveLimited("resolutionAdvise",this.resolutionAdvise,3);settings.SaveLimited("connectionspeedKBps",this.speedKbps,3)},n.prototype.getTime=function(){try{this.endTimeHS=window.performance.now();this.durationHS=(this.endTimeHS-this.startTimeHS)/1e3}catch(n){}this.endTime=(new Date).getTime();this.duration=(this.endTime-this.startTime)/1e3;this.duration=isNaN(this.durationHS)?this.duration/5:this.durationHS/3;this.getSpeed()},n.prototype.measure=function(n){var t=this;this.startTime=(new Date).getTime();try{this.startTimeHS=window.performance.now()}catch(i){}this.imageAddr="/content/images/connectiontest.png?n="+Math.random();this.download.onload=function(){t.getTime();n(t.resolutionAdvise)};this.download.src=this.imageAddr},n}();!function(n){var t=function(t){var r,i;(this.origHtmlMargin=parseFloat(n("html").css("margin-top")),this.options=n.extend({},n.smartbanner.defaults,t),r=navigator.standalone,this.options.force?this.type=this.options.force:navigator.userAgent.match(/iPad|iPhone|iPod/i)!=null?navigator.userAgent.match(/Safari/i)!=null&&(navigator.userAgent.match(/CriOS/i)!=null||window.Number(navigator.userAgent.substr(navigator.userAgent.indexOf("OS ")+3,3).replace("_","."))<6)&&(this.type="ios"):navigator.userAgent.match(/Android/i)!=null&&(this.type="android"),!this.type||r||this.getCookie("sb-closed")||this.getCookie("sb-installed"))||(this.scale=this.options.scale=="auto"?n(window).width()/window.screen.width:this.options.scale,this.scale<1&&(this.scale=1),i=n(this.type=="android"?'meta[name="google-play-app"]':'meta[name="apple-itunes-app"]'),i.length!=0)&&(this.appId=/app-id=([^\s,]+)/.exec(i.attr("content"))[1],this.title=this.options.title?this.options.title:i.data("title")||n("title").text().replace(/\s*[|\-Â·].*$/,""),this.author=this.options.author?this.options.author:i.data("author")||(n('meta[name="author"]').length?n('meta[name="author"]').attr("content"):window.location.hostname),this.iconUrl=i.data("icon-url"),this.price=i.data("price"),this.create(),this.show(),this.listen())};t.prototype={constructor:t,create:function(){var t,u=this.options.url?this.options.url:(this.type=="android"?"market://details?id=":"https://itunes.apple.com/"+this.options.appStoreLanguage+"/app/id")+this.appId,i=this.price||this.options.price,f=i?i+" - "+(this.type=="android"?this.options.inGooglePlay:this.options.inAppStore):"",r=this.options.iconGloss===null?this.type=="ios":this.options.iconGloss;n("body").append('<div id="smartbanner" class="'+this.type+'"><div class="sb-container"><a href="#" class="sb-close">&times;<\/a><span class="sb-icon"><\/span><div class="sb-info"><strong>'+this.title+"<\/strong><span>"+this.author+"<\/span><span>"+f+'<\/span><\/div><a href="'+u+'" class="sb-button"><span>'+this.options.button+"<\/span><\/a><\/div><\/div>");this.options.icon?t=this.options.icon:this.iconUrl?t=this.iconUrl:n('link[rel="apple-touch-icon-precomposed"]').length>0?(t=n('link[rel="apple-touch-icon-precomposed"]').attr("href"),this.options.iconGloss===null&&(r=!1)):n('link[rel="apple-touch-icon"]').length>0&&(t=n('link[rel="apple-touch-icon"]').attr("href"));t?(n("#smartbanner .sb-icon").css("background-image","url("+t+")"),r&&n("#smartbanner .sb-icon").addClass("gloss")):n("#smartbanner").addClass("no-icon");this.bannerHeight=n("#smartbanner").outerHeight()+2;this.scale>1&&(n("#smartbanner").css("top",parseFloat(n("#smartbanner").css("top"))*this.scale).css("height",parseFloat(n("#smartbanner").css("height"))*this.scale),n("#smartbanner .sb-container").css("-webkit-transform","scale("+this.scale+")").css("-msie-transform","scale("+this.scale+")").css("-moz-transform","scale("+this.scale+")").css("width",n(window).width()/this.scale));n(".navbar-fixed-top").css("top",n("#smartbanner").outerHeight(!0))},listen:function(){n("#smartbanner .sb-close").on("click",n.proxy(this.close,this));n("#smartbanner .sb-button").on("click",n.proxy(this.install,this))},show:function(t){n("#smartbanner").stop().animate({top:0},this.options.speedIn).addClass("shown");n("html").animate({marginTop:this.origHtmlMargin+this.bannerHeight*this.scale},this.options.speedIn,"swing",t)},hide:function(t){n("#smartbanner").stop().animate({top:-1*this.bannerHeight*this.scale},this.options.speedOut).removeClass("shown");n("html").animate({marginTop:this.origHtmlMargin},this.options.speedOut,"swing",t);n(".navbar-fixed-top").css("top",0)},close:function(n){n.preventDefault();this.hide();this.setCookie("sb-closed","true",this.options.daysHidden)},install:function(){this.hide();this.setCookie("sb-installed","true",this.options.daysReminder)},setCookie:function(n,t,i){var r=new Date;r.setDate(r.getDate()+i);t=escape(t)+(i==null?"":"; expires="+r.toUTCString());document.cookie=n+"="+t+"; path=/;"},getCookie:function(n){for(var r,u,i=document.cookie.split(";"),t=0;t<i.length;t++)if(r=i[t].substr(0,i[t].indexOf("=")),u=i[t].substr(i[t].indexOf("=")+1),r=r.replace(/^\s+|\s+$/g,""),r==n)return unescape(u);return null},switchType:function(){var t=this;this.hide(function(){t.type=t.type=="android"?"ios":"android";var i=n(t.type=="android"?'meta[name="google-play-app"]':'meta[name="apple-itunes-app"]').attr("content");t.appId=/app-id=([^\s,]+)/.exec(i)[1];n("#smartbanner").detach();t.create();t.show()})}};n.smartbanner=function(i){var u=n(window),r=u.data("typeahead"),f=typeof i=="object"&&i;r||u.data("typeahead",r=new t(f));typeof i=="string"&&r[i]()};n.smartbanner.defaults={title:null,author:null,price:"FREE",appStoreLanguage:"us",inAppStore:"On the App Store",inGooglePlay:"In Google Play",icon:null,iconGloss:null,button:"VIEW",url:null,scale:"auto",speedIn:300,speedOut:400,daysHidden:15,daysReminder:90,force:null};n.smartbanner.Constructor=t}(window.jQuery)