var absolute = false;

function adjustPosForAnchor() {
	if (window.attachEvent != undefined && window.XMLHttpRequest == undefined && window.opera == undefined || absolute) {
	} else {
		if (window.location.hash) {
			if (window.location.hash != hash) {
				var anchor = document.getElementById(window.location.hash.substr(1));
				if (anchor == null) {
					anchor = document.getElementsByName(window.location.hash.substr(1));
				}
				window.scroll(0, findPosY(anchor));
				return false;
			}
		}
	}
}

function setHash() {
	hash = window.location.hash;
}
addEventHandler(window,"load", function() {

	if (window.attachEvent != undefined && window.XMLHttpRequest == undefined && window.opera == undefined) {
		setAbsolute();
	} else {
		if (window.location.hash) {
			if (!absolute) {
				var anchor = document.getElementById(window.location.hash.substr(1));
				if (anchor == null) {
					anchor = document.getElementsByName(window.location.hash.substr(1));
				}
				window.scroll(0, findPosY(anchor));
			}
		}
	}
});

function setAbsolute() {
	document.getElementById("top_banners").style.position = "absolute";
	document.getElementById("left_banner").style.position = "absolute";
	document.getElementById("right_banner").style.position = "absolute";
	document.getElementById("side_banner_curve").style.position = "absolute";
	document.getElementById("side_banner").style.position = "absolute";
	document.getElementById("top_nav").style.position = "absolute";
	if (document.getElementById("bottom_nav") != undefined) {
		document.getElementById("bottom_nav").style.position = "absolute";
	}
	
	if (document.getElementById("nav_drop")!= undefined) {
		document.getElementById("nav_drop").style.position = "absolute";
	}
	document.getElementById("main").style.top = "225px";
	absolute = true;
}

function CheckAbsoluteCookie() {
	var cookieValues = readCookie("swviii_js");
	if (cookieValues != null) {
		if (cookieValues["fixed"] != undefined) {
			if (cookieValues["fixed"] == "false") {
				setAbsolute();
			}
			return cookieValues["fixed"];
		} else {
			return ""
		}
	} else {
		return "";
	}
}

addEventHandler(window,"load", CheckAbsoluteCookie);
