// JavaScript Document
 function initialize() {
		  var feed = new google.feeds.Feed("http://webservice.weatherzone.com.au/rss/wx.php?u=13145&lt=aploc&lc=5465&obs=0&fc=1&warn=0");
		  feed.load(function(result) {
				if (!result.error) {
				  	var container = document.getElementById("feed");
					for (var i = 0; i < result.feed.entries.length; i++) {
						var entry = result.feed.entries[i];
						if(entry.title == "Parkes weather forecast")
						{
						var parseString = entry.content;

						printString = parseString.replace("<b>","<div class='weatherday'>");
						printString = printString.replace("</b><br>","</div>");
						printString = printString.replace("<b>","<div class='weatherday'>");
						printString = printString.replace("</b><br>","</div>");

						printString = printString.replace('<img src="http://www.weatherzone.com.au/images/icons/fcast_30/rain.gif">','<img src="/images/weather-app/showers.gif" alt="Rain" class="weathericon"/><div class="weatherdata">');						
						printString = printString.replace('<img src="http://www.weatherzone.com.au/images/icons/fcast_30/clearing_shower.gif">','<img src="/images/weather-app/showers.gif" alt="Clearing Shower" class="weathericon"/><div class="weatherdata">');
						printString = printString.replace('<img src="http://www.weatherzone.com.au/images/icons/fcast_30/possible_thunderstorm.gif">','<img src="/images/weather-app/storms.gif" alt="Possible Thunderstorms" class="weathericon"/><div class="weatherdata">');
						printString = printString.replace('<img src="http://www.weatherzone.com.au/images/icons/fcast_30/windy.gif">','<img src="/images/weather-app/windy.gif" alt="windy" class="weathericon"/><div class="weatherdata">');
						printString = printString.replace('<img src="http://www.weatherzone.com.au/images/icons/fcast_30/sunny.gif">','<img src="/images/weather-app/sunny.gif" alt="Sunny" class="weathericon"/><div class="weatherdata">');
						printString = printString.replace('<img src="http://www.weatherzone.com.au/images/icons/fcast_30/mostly_sunny.gif">','<img src="/images/weather-app/pcloudy.gif" alt="Mostly Sunny" class="weathericon"/><div class="weatherdata">');
						printString = printString.replace('<img src="http://www.weatherzone.com.au/images/icons/fcast_30/mostly_cloudy.gif">','<img src="/images/weather-app/mcloudy.gif" alt="Mostly Cloudy" class="weathericon"/><div class="weatherdata">');
						printString = printString.replace('<img src="http://www.weatherzone.com.au/images/icons/fcast_30/showers_increasing.gif">','<img src="/images/weather-app/rain.gif" alt="Showers Increasing" class="weathericon"/><div class="weatherdata">');
						printString = printString.replace('<img src="http://www.weatherzone.com.au/images/icons/fcast_30/possible_shower.gif">','<img src="/images/weather-app/showers.gif" alt="Possible Shower" class="weathericon"/><div class="weatherdata">');
						printString = printString.replace('<img src="http://www.weatherzone.com.au/images/icons/fcast_30/thunderstorms_clearing.gif">','<img src="/images/weather-app/storms.gif" alt="Storms Clearing" class="weathericon"/><div class="weatherdata">');
						printString = printString.replace('<img src="http://www.weatherzone.com.au/images/icons/fcast_30/windy_with_showers.gif">','<img src="/images/weather-app/windyrain.gif" alt="Windy with Showers" class="weathericon"/><div class="weatherdata">');
						printString = printString.replace('<img src="http://www.weatherzone.com.au/images/icons/fcast_30/cloud_and_wind_increasing.gif">','<img src="/images/weather-app/windycloudy.gif" alt="Cloud And Wind" class="weathericon"/><div class="weatherdata">');
						
/* DOUBLE UP THE REPLACEMENTS SO WE DONT GET MISSED ICONS */
						printString = printString.replace('<img src="http://www.weatherzone.com.au/images/icons/fcast_30/rain.gif">','<img src="/images/weather-app/showers.gif" alt="Rain" class="weathericon"/><div class="weatherdata">');
						printString = printString.replace('<img src="http://www.weatherzone.com.au/images/icons/fcast_30/clearing_shower.gif">','<img src="/images/weather-app/showers.gif" alt="Clearing Shower" class="weathericon"/><div class="weatherdata">');
						printString = printString.replace('<img src="http://www.weatherzone.com.au/images/icons/fcast_30/possible_thunderstorm.gif">','<img src="/images/weather-app/storms.gif" alt="Possible Thunderstorms" class="weathericon"/><div class="weatherdata">');
						printString = printString.replace('<img src="http://www.weatherzone.com.au/images/icons/fcast_30/windy.gif">','<img src="/images/weather-app/windy.gif" alt="windy" class="weathericon"/><div class="weatherdata">');
						printString = printString.replace('<img src="http://www.weatherzone.com.au/images/icons/fcast_30/sunny.gif">','<img src="/images/weather-app/sunny.gif" alt="Sunny" class="weathericon"/><div class="weatherdata">');
						printString = printString.replace('<img src="http://www.weatherzone.com.au/images/icons/fcast_30/mostly_sunny.gif">','<img src="/images/weather-app/pcloudy.gif" alt="Mostly Sunny" class="weathericon"/><div class="weatherdata">');
						printString = printString.replace('<img src="http://www.weatherzone.com.au/images/icons/fcast_30/mostly_cloudy.gif">','<img src="/images/weather-app/mcloudy.gif" alt="Mostly Cloudy" class="weathericon"/><div class="weatherdata">');
						printString = printString.replace('<img src="http://www.weatherzone.com.au/images/icons/fcast_30/showers_increasing.gif">','<img src="/images/weather-app/rain.gif" alt="Showers Increasing" class="weathericon"/><div class="weatherdata">');
						printString = printString.replace('<img src="http://www.weatherzone.com.au/images/icons/fcast_30/possible_shower.gif">','<img src="/images/weather-app/showers.gif" alt="Possible Shower" class="weathericon"/><div class="weatherdata">');
						printString = printString.replace('<img src="http://www.weatherzone.com.au/images/icons/fcast_30/thunderstorms_clearing.gif">','<img src="/images/weather-app/storms.gif" alt="Storms Clearing" class="weathericon"/><div class="weatherdata">');
						printString = printString.replace('<img src="http://www.weatherzone.com.au/images/icons/fcast_30/windy_with_showers.gif">','<img src="/images/weather-app/windyrain.gif" alt="Windy with Showers" class="weathericon"/><div class="weatherdata">');
						printString = printString.replace('<img src="http://www.weatherzone.com.au/images/icons/fcast_30/cloud_and_wind_increasing.gif">','<img src="/images/weather-app/windycloudy.gif" alt="Cloud And Wind" class="weathericon"/><div class="weatherdata">');

						printString = printString.replace("<br><br>","</div><br class='clear' />");

						/*Replace each image according to its valu*/
						try{
						if(console)
						{
						console.log(parseString);
						}
						}catch(e){
						}
						
						document.getElementById("feed").innerHTML = "<div class='weatherapp'>"+printString+"</div>";
						}
			
					  }
				}
		  });
    }