var WWWRootPath = "/~stamaste";

var preloadimages=false;
function PreloadImages()
{
	if (!preloadimages)
	{
		SectionTextPic = new Image();
		SectionTextPic.src = WWWRootPath+"/pictures/SectionText.jpg"
		SectionSelectPic = new Image();
		SectionSelectPic.src = WWWRootPath+"/pictures/SectionSelect.jpg"
		Section2SelectPic = new Image();
		Section2SelectPic.src = WWWRootPath+"/pictures/SectionSelect2.jpg"
		Section3SelectPic = new Image();
		Section3SelectPic.src = WWWRootPath+"/pictures/SectionSelect3.jpg"
		Section4SelectPic = new Image();
		Section4SelectPic.src = WWWRootPath+"/pictures/SectionSelect4.jpg"
		Section5SelectPic = new Image();
		Section5SelectPic.src = WWWRootPath+"/pictures/SectionSelect5.jpg"
		Section6SelectPic = new Image();
		Section6SelectPic.src = WWWRootPath+"/pictures/SectionSelect6.jpg"
		Main1Pic = new Image();
		Main1Pic.src = WWWRootPath+"/pictures/Main.jpg"
		Main2Pic = new Image();
		Main2Pic.src = WWWRootPath+"/pictures/Main2.jpg"
		Main3Pic = new Image();
		Main3Pic.src = WWWRootPath+"/pictures/Main3.jpg"
		Main4Pic = new Image();
		Main4Pic.src = WWWRootPath+"/pictures/Main4.jpg"
		Main5Pic = new Image();
		Main5Pic.src = WWWRootPath+"/pictures/Main5.jpg"
		Main6Pic = new Image();
		Main6Pic.src = WWWRootPath+"/pictures/Main6.jpg"
		preloadimages = true;
	}
}

var ParseWeather = function(oXML)
{
	var ResponseText = oXML.responseText;
	var WeatherArray = /\<Desc\>(.+?)\<\/Desc\>\<DegF\>(.+?)\<\/DegF\>\<DegC\>(.+?)\<\/DegC\>\<MPH\>(.+?)\<\/MPH\>\<KPH\>(.+?)\<\/KPH\>/g.exec(ResponseText);
	var Desc = WeatherArray[1];
	var DegF = WeatherArray[2];
	var DegC = WeatherArray[3];
	var MPH = WeatherArray[4];
	var KPH = WeatherArray[5];
	var WeatherInnerHTML = "North<i>WIND</i> Weather: " + Desc + " | Temp: " + DegF + " &#176;F / " + DegC + " &#176;C | Wind Gust: " + MPH + " mph / " + KPH + " km/h";
//alert(WeatherInnerHTML);
	document.getElementById("WeatherBox").innerHTML = WeatherInnerHTML;
}

var OnError = function(oXML)
{
//	alert(oXML.responseText);
}

window.setInterval(function(){Net.get({url: "http://www.northwindiceboats.com/cgi-bin/weather.xml.pl", onsuccess: ParseWeather, onerror: OnError})}, 90000);
