Layout = new (function () {
	this.fix = function (firstTime) {
		var nav = document.getElementById ("BottomNav");
		var layout = document.getElementById ("Layout");
		var nodes = nav.childNodes;
		var size = this.getWindowSize ();
		var largeWindow = (size.resizable && size.width >= 1045 && size.height >= 900 ? true : false);
		
		if (firstTime) {
			for (var i = nodes.length - 1; i >= 0; i--) {
				if (nodes [i].nodeName.toLowerCase () != 'a') {
					nav.removeChild (nodes [i]);
				}
			}
			
			if (!size.resizable) {
				layout.style.paddingTop = '0px';
			}
			
			if (window.ActiveXObject) {
				document.getElementById ("CallToday").style.position =
				document.getElementById ("Logos").style.position = 'static';
				
				document.getElementById ("CallToday").style.position =
				document.getElementById ("Logos").style.position = 'absolute';
			}
		}
		
		if (largeWindow) {
			nav.className = 'large-window';
			document.body.appendChild (nav);
		} else {
			nav.className = '';
			layout.insertBefore (nav, document.getElementById ("Content"));
		}
	};
	
	this.getWindowSize = function () {
		if (window.innerWidth) {
			return { width : window.innerWidth, height : window.innerHeight, resizable : true };
		} else if (document.documentElement && document.documentElement.clientWidth) {
			return { width : document.documentElement.clientWidth, height : document.documentElement.clientHeight, resizable : true };
		} else {
			return { width : document.body.clientWidth, height : document.body.clientHeight, resizable : false };
		}
	};
}) ();
