var today = new Date();
var thisDay = today.getDay();

var topBackgrounds = new Array();
topBackgrounds[0] = "/img/sunday-top.jpg";
topBackgrounds[1] = "/img/monday-top.jpg";
topBackgrounds[2] = "/img/tuesday-top.jpg";
topBackgrounds[3] = "/img/wednesday-top.jpg";
topBackgrounds[4] = "/img/thursday-top.jpg";
topBackgrounds[5] = "/img/friday-top.jpg";
topBackgrounds[6] = "/img/saturday-top.jpg";

var bottomBackgrounds = new Array();
bottomBackgrounds[0] = "/img/sunday-bottom.jpg";
bottomBackgrounds[1] = "/img/monday-bottom.jpg";
bottomBackgrounds[2] = "/img/tuesday-bottom.jpg";
bottomBackgrounds[3] = "/img/wednesday-bottom.jpg";
bottomBackgrounds[4] = "/img/thursday-bottom.jpg";
bottomBackgrounds[5] = "/img/friday-bottom.jpg";
bottomBackgrounds[6] = "/img/saturday-bottom.jpg";

var isDHTML = 0;
var isID = 0;
var isAll = 0;
var isLayers = 0;

if(document.getElementById) {
	isID = 1;
	isDHTML = 1;
}
else {
	if(document.all) {
		isAll = 1;
		isDHTML = 1;
	}
	else {
		browserVersion = parseInt(navigator.appVersion);
		if((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)) {
			isLayers = 1;
			isDHTML = 1;
		}
	}
}

function findDOM(objectID, withStyle) {
	if (withStyle == 1) {
		if (isID) {
			return (document.getElementById(objectID).style);
		}
		else {
			if (isAll) {
				return (document.all[objectID].style);
			}
			else {
				if (isLayers) {
					return (document.layers[objectID]);
				}
			}
		}
	}
	else {
		if (isID) {
			return (document.getElementById(objectID));
		}
		else {
			if (isAll) {
				return (document.all[objectID]);
			}
			else {
				if (isLayers) {
					return (document.layers[objectID]);
				}
			}
		}
	}
}

function setPageBackgrounds() {
	topBgObj = findDOM("hptopbg", 1);
	bottomBgObj = findDOM("hpbottombg", 1);

	if (topBgObj) {
		topBgObj.background = "url(" + topBackgrounds[thisDay]+ ") no-repeat";
	}

	if (bottomBgObj) {
		bottomBgObj.background = "url(" + bottomBackgrounds[thisDay]+ ") no-repeat";
	}
}