function writeWeather()
{
	try {
		if(perth && perth[3] && perth[3] != "-") {
			if(document.getElementById("temperature")) {
				document.getElementById("temperature").innerHTML = "Temp " + perth[3] + " &deg;C";
			}  
			if(perth[5]) {
				if(document.getElementById("humidity")) {
					document.getElementById("humidity").innerHTML = "Humidity " + perth[5] + "%";
				}
			}
			if(perth[12] && perth[12] != "-") {
				if(document.getElementById("rainfall")) {
					document.getElementById("rainfall").innerHTML = "Rainfall " + perth[12] + " mm";
				}
			} 
			if(document.getElementById("weather_icon")) {
				document.getElementById("weather_icon").src = "/pluginkids/weather/sprites/display/" + perthsprite;
			}
		}
	} catch(err) {
	}
	
	var summerTips = new Array();

	summerTips[0] = "Set your air conditioner to 24 degrees Celsius or above.";
	summerTips[1] = "Close all curtains to prevent the sun from heating up your home.";
	summerTips[2] = "Use your major appliances before 4pm or after 9pm.";
	summerTips[3] = "Unless you are swimming, avoid running your pool pump between 4 pm and 9 pm.";
	summerTips[4] = "Close windows and external doors to keep the cool air inside.";
	summerTips[5] = "Install ceiling insulation to reduce your cooling requirements.";
	
	var winterTips = new Array();
	
	winterTips[0] = "Use compact fluorescent lights.";
	winterTips[1] = "Buy gas or solar hot water systems.";
	winterTips[2] = "Turn off appliances at the wall.";
	winterTips[3] = "Use the fan-forced setting on your oven.";
	winterTips[4] = "Close windows and external doors to keep the warm air inside.";
	winterTips[5] = "Install ceiling insulation to reduce your heating requirements.";
	
	if (parseInt(perth[3]) <=24) {
		var randomWinterTip = Math.floor(Math.random()*winterTips.length);
		document.getElementById("tip").innerHTML = "Tip: " + summerTips[randomWinterTip];
	}
	
	if (parseInt(perth[3]) >24) {
		
		var randomSummerTip = Math.floor(Math.random()*summerTips.length);
		document.getElementById("tip").innerHTML = "Tip: " + summerTips[randomSummerTip];
		
		if (parseInt(perth[3]) >35) {
			document.getElementById("peakday").innerHTML = "Today it's a Peak Day";
		}
	}

}
