(function() {
	var glow,
		simages;
	
	gloader.load(
	["glow", "1", "glow.dom", "glow.events"],
	{
		async: false,
		onLoad: function(fetchedGlow) {
			glow = fetchedGlow;
			glow.ready(init);
		}
	});
	
function init() {
	simages = glow.dom.get("div#unemployment_in_the_uk img");
	simages.css("display", "none");
	glow.dom.get("div#unemployment_in_the_uk_controls").css("display", "block");
	// def aug-oct
	simages.each(function(i) {
		if (this.src.match(/2008\-08\_to\_2008\-10/)) {
			this.style.display = "block";
		}
	});
	glow.dom.get("div#unemployment_in_the_uk_controls").children().filter(
	function(i) { return glow.dom.get(this).is("input"); }).each(
	function(i) {
			glow.events.addListener(
			this,
			"click",
			trigger,
			this);
	});
}

function trigger() {
	var elm = glow.dom.get(this);
	var rg = new RegExp(this.id);
	simages.each(function(i) {
		if (this.src.match(rg)) {
			this.style.display = "block";
		} else {
			this.style.display = "none";
		}
	});
}

})();