var g_tips = new Array(
	"Remember, <b><i>your geyser is responsible for roughly 40% of your household's energy</i></b> consumption. By using GeyserWise, this can be significantly reduced.",
	"To manage the energy used by your geyser, <b><i>fit a GeyserWise digital timer</i></b>.",
	"Lower your geyser's temperature to 55° and <b><i>reduce its energy usage by 20%</i></b>. Intelligently control your energy usage with GeyserWise.",
	"<b><i>Use GeyserWise to switch your geyser off</i></b> whenever hot water is not needed. E.g. weekends away, during holidays and when you are at work to save energy.",
	"Heat water, use it and then switch the geyser off. This will reduce standing losses, <b><i>saving you energy and money</i></b>.",
	"Use the timers on your GeyserWise unit to automatically manage water temperature so you can <b><i>save energy and never worry about coming home to cold water</i></b>.",
	"Fit a solar geyser so the sun can <b><i>heat your water for free</i></b>."
);
var currentTip = Math.floor(Math.random() * g_tips.length);
function nextTip()
{
	$("#energyBox").fadeOut("slow", function() {
		$(this).html(g_tips[currentTip]);
		$(this).fadeIn("slow");
	});
	currentTip++;
	currentTip %= g_tips.length;
}

$(document).ready(function() 
{
	centerWindow();
	
	nextTip();
	intervalHandle = setInterval("nextTip()", 10000);

});

$(window).resize(function() 
{
	centerWindow();
});

var centerWindow = function()
{
	$("#divMain").css("left", Math.max(0, $(window).width() / 2 - 390));
};

function loadSection(section)
{
	$("#sections > div").each(function() {
		$(this).hide();
		id = $(this).attr("id");
		$("#" + id + "Image").attr("src", "images/" + id + ".jpg");
	});
	
	$("#" + section).show();
	$("#" + section + "Image").attr("src", "images/" + section + "Selected.jpg");
}

function loadSection2(section)
{
	$("#sections2 > div").each(function() {
		$(this).hide();
		id = $(this).attr("id");
		$("#" + id + "Image").attr("src", "images/" + id + ".jpg");
	});
	
	$("#" + section).show();
	$("#" + section + "Image").attr("src", "images/" + section + "Selected.jpg");
}

function loadSection2b(section)
{
	$("#sections2b > div").each(function() {
		$(this).hide();
		id = $(this).attr("id");
		$("#" + id + "Image").attr("src", "images/" + id + ".jpg");
	});
	
	$("#" + section).show();
	$("#" + section + "Image").attr("src", "images/" + section + "Selected.jpg");
}

