$(document).ready(function() {
	$("body").css("background-color", "#d1d1d1");
	makeBackground();
});

function makeBackground() {
	var headerElement = document.getElementById("headerDiv");
	var footerElement = document.getElementById("footerDiv");
	if (headerElement != null && footerElement != null) {
		var headerDiv = $(headerElement).parent();
		var footerDiv = $(footerElement).parent();
		$("body").append("<div id=\"content_background\" class=\"content_background\"><span /></div>");
		$("body").css("position", "relative").css("z-index", "0");
		var backgroundDiv = $("#content_background");
		backgroundDiv.css("position", "absolute");
		var top = headerDiv.offset().top + headerDiv.height();
		var left = headerDiv.offset().left;
		var width = headerDiv.width();
		var height = footerDiv.offset().top - top;
		if (jQuery.browser.msie) {
			
		}
		backgroundDiv.css("top", top);
		backgroundDiv.css("left", left);
		backgroundDiv.height(height);
		backgroundDiv.width(width);
		backgroundDiv.css("z-index", "-1");
		backgroundDiv.css("background-color", "#C53918");
	}
	
}

function toggleQuestions(id) {
	$("#" + id).toggle();
	resizeBackground();
}

function resizeBackground() {
	var backgroundElement = document.getElementById("content_background");
	if (backgroundElement != null) {
		var footerDiv = $("#footerDiv").parent();
		var backgroundDiv = $(backgroundElement);
		var headerDiv = $("#headerDiv").parent();
		var top = headerDiv.offset().top + headerDiv.height();
		var height = footerDiv.offset().top - top;
		backgroundDiv.height(height);
	}
}