﻿function gId(id) {
	return document.all ? eval("document.all['" + id + "']") : document.getElementById(id);
}

function ToggleDisplay(id) {
	obj = gId(id);
	obj.style.display = obj.style.display == "" ? "none" : "";
}

function PerformanceTable(id, year) {
	for (var i = 2007; i <= 2010; i++) {
		if (i == year)
			gId(id + "_" + i).style.display = "";
		else
			gId(id + "_" + i).style.display = "none";
	}
}

function ToggleCaseStudy(id) {
	obj = gId('casestudy_' + id);
	imgobj = gId('casestudyimg_' + id);
	if (obj.style.display == "") {
		obj.style.display = "none"
		imgobj.src = "/sustainable_development/imgs/icons/add_icon.jpg";
	}
	else {
		obj.style.display = "";
		imgobj.src = "/sustainable_development/imgs/icons/minus_icon.jpg";
	}
}

function ToggleNewsDisplay(id) {
	obj = gId("news_" + id);
	sourceobj = gId("newssource_" + id);
	if (sourceobj.style.display == "") {
		sourceobj.style.display = "none"
		obj.style.backgroundColor = "";
	}
	else {
		sourceobj.style.display = "";
		obj.style.backgroundColor = "#fff06e";
	}
}

function ToggleBox(id) {
	obj = gId('box_' + id);
	imgobj = gId('boxctl_' + id);
	if (obj.style.display == "") {
		obj.style.display = "none"
		imgobj.src = "/sustainable_development/imgs/icons/add_icon.jpg";
	}
	else {
		obj.style.display = "";
		imgobj.src = "/sustainable_development/imgs/icons/minus_icon.jpg";
	}
}
