﻿function fullwidth (){

	m = document.getElementById("nav");
	li = m.getElementsByTagName("li");
	
	for (var i = 0; i < li.length; i++){
		
		li[i].onmouseover = function () {
			if (document.getElementById("dyn_window") != undefined) {
				document.getElementById("nav").className = (document.getElementById("nav").className == "showall") ? "" : "showall";
				if (document.getElementById("nav").className == "showall") {
					this.className = (this.className == "showall") ? "" : "showall";
				}
			}
		}
		
		li[i].onmouseout = function () {
			if (document.getElementById("dyn_window") != undefined) {
				document.getElementById("nav").className = (document.getElementById("nav").className == "showall") ? "" : "showall";
				this.className = (this.className == "showall") ? "" : "showall";
			}
		}
		
	}
	
}








function init() {

	//navigation
	fullwidth();

	//window
	var wi = document.createElement("div");
	wi.id='dyn_window';
	document.getElementsByTagName("body")[0].appendChild(wi);




	//show-bg-only button
	if ( document.getElementById("supersize") != undefined) {
		var bgo = document.createElement("div");
		bgo.id='bgonly';
		document.getElementsByTagName("body")[0].appendChild(bgo);
		document.getElementById("bgonly").innerHTML = "hide text";
		document.getElementById("bgonly").onclick = function () {
			document.getElementsByTagName("body")[0].className = (document.getElementsByTagName("body")[0].className == "showbg") ? "" : "showbg";
			this.innerHTML = (this.innerHTML == "hide text") ? "show text" : "hide text";
		}
	}

}





/* Init
----------------------------------*/
window.onload = init;

