// (c) 2006 Gladkoborodov Igor

onLoad = function() {
    initWidthFix();
    //try { initSnow(); } catch (e) { }
}

onResize = function () {
	fixBody();
}

initWidthFix = function() {
	if (document.getElementsByTagName) {
		body = document.getElementsByTagName('body')[0];
		fixBody();
	}
}

fixBody = function() {
	if (self.body && (body.offsetWidth < 880 || body.style.width == '880px')) {
		body.style.width = (getWindowWidth() < 880) ? '880px' : '100%';
	}

}


// http://www.quirksmode.org/viewport/compatibility.html
getWindowWidth = function() {
	if (self.innerHeight) {
		return self.innerWidth;
	}
	else if (document.documentElement && document.documentElement.clientHeight) {
		return document.documentElement.clientWidth;
	}
	else if (document.body) {
		return document.body.clientWidth;
	}
}



window.onload = onLoad;
window.onresize = onResize;

