/* Turns Ellington's weather_text string to an image url */
function getWeatherImageFilename(weatherDescriptionStr, isDayTime) {
	
	var currentDate = new Date();
	var currentHour = currentDate.getHours();
	var weatherImageUrl;
	
	if (weatherDescriptionStr == "Lightning Observed") {
		// Account for an annoying issue where lightning is reported although it isn't local
		// local lightning should report thunder in the vicinity at least
		weatherImageUrl = "clear.png";
	} else if (weatherDescriptionStr.search(/snow/i) >= 0) {
		weatherImageUrl = "snowy.png";
	} else if (weatherDescriptionStr.search(/fog/i) >= 0) {
		weatherImageUrl = "hazy.png"; 
	} else if (weatherDescriptionStr.search(/hail/i) >= 0) {
		weatherImageUrl = "hail.png";
	} else if (weatherDescriptionStr.search(/clear sky/i) >= 0) {
		weatherImageUrl = "clear.png";
	} else if (weatherDescriptionStr.search(/mist/i) >= 0) {
		weatherImageUrl = "hazy.png";
	} else if (weatherDescriptionStr.search(/overcast/i) >= 0) {
		weatherImageUrl = "overcast.png";
	} else if (weatherDescriptionStr.search(/lightning/i) >= 0 || weatherDescriptionStr.search(/thunder/i) >= 0) {
		weatherImageUrl = "stormy.png";
	} else if (weatherDescriptionStr.search(/rain/i) >= 0 || weatherDescriptionStr.search(/precipitation/i) >= 0) {
		weatherImageUrl = "rainy.png";
	} else if (weatherDescriptionStr.search(/partly cloud/i) >= 0) {
			weatherImageUrl = "partlycloudy.png";
	} else if (weatherDescriptionStr.search(/cloud/i) >= 0) {
		weatherImageUrl = "cloudy.png";
	} else if (weatherDescriptionStr.search(/drizzle/i) >= 0) {
		weatherImageUrl = "overcast.png";
	} else {
		weatherImageUrl = "clear.png";
	}
	
	if (isDayTime != "True") {
		weatherImageUrl = "night" + weatherImageUrl;
	}
	
	weatherImageUrl = "http://media.oudaily.com/img/weather/newicons/" + weatherImageUrl;
	return weatherImageUrl;
}