window.onload = init;

var menu;

function init() {
	writeControls(); // in textResizer.js
	if (document.getElementByIfd) {
		menu = new Menu();
		menu.addSection('navDIVcontentIn');
		menu.addSection('navDIVWelcome');
		menu.addSection('navDIVcontentOut');
		menu.addSection('preferences');
		if (menu.halt=='n') {
			menu.calibrate();
			menu.addLinks();
			}
		}
	
	
	
		
	window.onresize = resize;
	}

function resize() {
	resizeFix();
	//menu.moveEm();
	}
	
function getMyProperty(obj,prop) {
	//if (obj.style.position=='absolute') return parseInt(eval("obj.style."+prop))
	if (document.all) {
		if (prop=='top') return obj.offsetTop//+document.body.scrollTop;
		if (prop=='left') return obj.offsetLeft;
		if (prop=='height') return obj.offsetHeight;
	} else {
		if (prop=='top') return (parseInt(document.defaultView.getComputedStyle(obj,'').getPropertyValue('top')));
		if (prop=='left') return parseInt(document.defaultView.getComputedStyle(obj,'').getPropertyValue('left'));
		if (prop=='height') return parseInt(document.defaultView.getComputedStyle(obj,'').getPropertyValue('height'));
		}
	}



/********************************************************************
	cookie functions modified from code found at Alexei Kourbatov's
	javascripter.net/faq/
*/
function setCookie(cookieName,cookieValue) {
	document.cookie = cookieName+"="+escape(cookieValue) + ";expires="
	}
	
function readCookie(cookieName) {
	var theCookie=""+document.cookie;
	var ind=theCookie.indexOf(cookieName);
	if (ind==-1 || cookieName=="") return ""; 
	var ind1=theCookie.indexOf(';',ind);
	if (ind1==-1) ind1=theCookie.length; 
	return unescape(theCookie.substring(ind+cookieName.length+1,ind1));
	}
	
/* from http://javascriptworld.com/scripts/chap09/script02.html */
if (document.layers) {
		origWidth = window.innerWidth
		origHeight = window.innerHeight
	}

	function resizeFix() {
		if (document.layers) {
			if (window.innerWidth != origWidth || window.innerHeight != origHeight) {
				window.location.reload()
			}
		}
	}



var agt = navigator.userAgent.toLowerCase();