var browserinfos = navigator.userAgent 
var ie5 = document.all && document.getElementById && !browserinfos.match(/Opera/)
var ns6 = document.getElementById && !document.all
var opera = browserinfos.match(/Opera/)  
var browserok = (ie5 || ns6 || opera)

function doresize() {
	if (document.getElementById) {
		chairliftObj = document.getElementById("chairlift")
		chairliftMaskObj = document.getElementById("chairliftMask")
		if (chairliftObj != null && chairliftMaskObj != null &&
			parseInt(chairliftObj.style.left) > 0) {
			chairliftMaskObj.style.left = (document.body.clientWidth - parseInt(chairliftMaskObj.style.width)) + "px"
	   	}
    }
   
    doc_height = document.body.clientHeight;
    doc_width = document.body.clientWidth;
    if (ie5) {
    	marginbottom = document.body.scrollHeight
		marginright = document.body.scrollWidth
    } else if (opera) {
		marginbottom = document.body.clientHeight
		marginright = document.body.clientWidth
	} else if (ns6) {
		marginbottom = window.innerHeight
		marginright = window.innerWidth
	}
}
window.onresize = doresize;

// This function is called on every page.
function init() {
	ACELoadMenu()
	doresize()
	// resizeInterval = setInterval("doresize()",1000)
	if (browserok)
   		initsnow()
}

// keep this for reusability later
var globalQuoteRegex = new RegExp ("'", 'gi');
function waitUntilTrue(booleanCommand, expressionToRun) {
	if (!eval(booleanCommand)) {
		setTimeout("waitUntilTrue(" +
			"'" + booleanCommand.replace(globalQuoteRegex,"\"") + "'," +
			"'" + expressionToRun + "')",50)
	} else {
		eval(expressionToRun)
	}
}
