var allHeadings = document.getElementsByTagName('div');
for(var i=0;i<allHeadings.length;i++) {
	// Get at the ID for any <strong> elements
	var headingId = allHeadings[i].getAttribute("id");
	if(headingId != null) {
		if(headingId.indexOf("expand") != -1) {
			var headingArr = headingId.split('expand');

			if(window.addEventListener) {
				// Add onClick event
				allHeadings[i].addEventListener("click",
					function(num) {
						return function() {
							ShowContent(num);
						}
					}(headingArr[1]),
				false);
			} else {
				// Microsoft way
				allHeadings[i].attachEvent("onclick",
					function(num) {
						return function() {
							ShowContent(num);
						}
					}(headingArr[1]));
			}
		}
	}
} // End loop

// Shows the element with id="expandContentX" where X is the id supplied
function ShowContent(id) {
	var headingDiv = document.getElementById("expand" + id);
	var content = document.getElementById("expandContent" + id);

	// Toggle Content
	if(content.style.display == 'block') {
		content.style.display = 'none';
		headingDiv.className = "plusBg";
	} else {
		content.style.display = 'block';
		headingDiv.className = "minusBg";
	}
}

