/*
 * maxwidth.js - simulate CSS's "max-width" (JavaScript 1.2)
 *
 * 2001 - 2003
 * by Andreas Roth <a.roth@muenster.de>
 *
 * last modified: 2003-07-31 by a.rt
 *
 * How to exclude browsers which do support CSS's "max-width"?
 *
 */

	window.onerror = null;

	var winWidth = 0;
	var treshold = 800;
	var fixwidth = '<div class="fixwidth">';
	var maxwidth = '<div class="maxwidth">';
	var closeTag = '<\/div>';

	// evaluate inner window width
	function getWinWidth() {
		var w = window.innerWidth;
		if (w)
			return w > treshold ? 1 : -1;
		else if (document.body && (w = document.body.offsetWidth))
			return w > treshold ? 2 : -2;
		else return 0;
	}

	// refresh page when necessary.
	function winRefresh() {
		if (winWidth != getWinWidth())
			window.history.go(0);
	}

	// initialize and open constrained element
	if(!winWidth)
		winWidth = getWinWidth();
	if(winWidth)
		window.onresize = winRefresh;
	if (winWidth > 0)
		document.write(fixwidth);
	else
		document.write(maxwidth);


/* ---- External file maxwidth-end.js

	window.onerror = null;

	if (closeTag) {
		document.write(closeTag);
	}

*/

