jQuery(document).ready(function($){getForecast();function buildForecast(forecasts){if(typeof forecasts=='undefined'||forecasts.length===3){$("forecast").toggleClass("error");}
else{for(var i=0;i<forecasts.length;i++){var currentDay=forecasts[i];$("#wuforecasts").append("<div id='wuforecast'><h1 id='weekday'>"+currentDay.date.weekday_short+"  "+currentDay.date.day+"</h1><img id='icon' src='css/icons/"+currentDay.icon+".png'></img>"+"<span style='color:#677672;font-size:12px;'> "+currentDay.high.celsius+"°</span> | "+"<span style='color:#66a1ba;font-size:12px;'> "+currentDay.low.celsius+"° "+"</span><br>"+"<span style='color:#66a1ba;font-size:10px;font-family:Helvetica, Arial;'> "+currentDay.pop+"% <span style='font-size:9px;font-family:Helvetica, Arial;'> precip</span></span><span style='color:#677672;padding-right:3px;font-size:11px;font-family:Helvetica, Arial;'><br> "+currentDay.maxwind.kph+"kmh <br><span style='color:66a1ba;padding-right:3px;font-size:11px;font-family:Helvetica, Arial;'>"+currentDay.snow_allday.cm+" <span style='color:#66a1ba;font-size:9px;font-family:Helvetica, Arial;'> cm <div class='wi wi-snowflake-cold'></div><div class='wi wi-snowflake-cold'></div>");}}}
function scopedForecast(forecast){return _.reject(forecast,function(weather){});}
function getForecast(){$.ajax({url:"./jsondata/forecast10day.json",dataType:"json",success:function(json){var forecastData=json.forecast.simpleforecast.forecastday;var forecasts=scopedForecast(forecastData);buildForecast(forecasts);}});}
function getParameter(theParameter){var params=window.location.search.substr(1).split('&');for(var i=0;i<params.length;i++){var p=params[i].split('=');if(p[0]==theParameter){return decodeURIComponent(p[1]);}}
return false;}});