window.onload = checkFooter;
window.onresize = checkFooter;

function checkFooter() {

		windowwidth = window.innerWidth;
		pagewidth = document.getElementById("pagewrapper").offsetWidth;

		if (!windowwidth) { 
			windowwidth = document.documentElement.clientWidth;
		}

		if (!windowwidth || windowwidth == 0) { 
			windowwidth = document.body.clientWidth;
			pagewidth = document.getElementById("pagewrapper").offsetWidth;
		}

		if(windowwidth > 1000) {
			document.getElementById("pagewrapper").style.width = 1000 + "px";
			document.getElementById("pagewrapper").style.marginLeft = "auto";
			document.getElementById("pagewrapper").style.marginRight = "auto";
		}


/*
		difference = windowwidth - pagewidth;

		if(difference > 0) {
			pagewidth = pagewidth - footerwidth;
			document.getElementById('pagewrapper').style.width = pagewidth + difference + "px";
		} else if (difference < 0) {
			pagewidth = pagewidth - footerwidth;
			if((pagewidth + difference) > 650) {
				document.getElementById('pagewrapper').style.width = pagewidth + difference + "px";
			}
		}
*/

}


// STORE REQUIRED ACTIONS IN VARIABLE //

var W3CDOM = (document.getElementsByTagName);

function init() {

	// IF ACTIONS ARE NOT SUPPORTED STOP SCRIPT //
	if (!W3CDOM) return;

	var menu = document.getElementById('menu');

	if(menu) {

		var ptags = menu.getElementsByTagName('p');

		for (var i=0;i<ptags.length;i++) {

			if(ptags[i].className == "nav") {

				ptags[i].onmouseover = mousegoesover;
				ptags[i].onmouseout = mousegoesout;

			}

		}

	}

}


function mousegoesover() {
	this.className = "over";
	this.style.cursor = "pointer";
}

function mousegoesout() {
	this.className = "nav";
}

