// JavaScript Document

//javascript by ArrowGraphics The Netherlands 2007 www.arrowgraphics.nl
var width01_small = 700;
var width02_small = 700;
var width03_small = 700;
var width04_small = 510;
var width05_small = 690;
var width06_small = 510;

var display06_small = 'none';

var availW = 0;
var availH = 0;

var currentW = 0;

var crucialWidth = 946

function resizeWindow() {
	if(document.all) {
		currentW = document.body.clientWidth;
	}
	else {
		currentW = innerWidth;
	}
	if (currentW >= crucialWidth && availW < crucialWidth || currentW < crucialWidth && availW >= crucialWidth) {
		location.href = location.href;
	}
}

function changeWidthByClass (className,newwidth) {
	var all = document.all ? document.all :
	document.getElementsByTagName('*');
	var elements = new Array();
	for (var e = 0; e < all.length; e++) {
		if (all[e].className == className) {
			all[e].style.width = newwidth + 'px';
		}
	}
	return elements;
}

function setTableWidth() {
	
	if(document.all) {
		availW = document.body.clientWidth;
		availH = document.body.clientHeight;
	}
	else {
		availW = innerWidth;
		availH = innerHeight;
	}
	
	//if (screen.width) {
	if (availW < crucialWidth) {
		
		if (document.getElementById('table01')) {
			document.getElementById('table01').style.width = width01_small;
		}
		if (document.getElementById('table02')) {
			document.getElementById('table02').style.width = width02_small;
		}
		if (document.getElementById('table03')) {
			document.getElementById('table03').style.width = width03_small;
		}
		if (document.getElementById('table04')) {
			document.getElementById('table04').style.width = width04_small;
		}
		if (document.getElementById('table05')) {
			document.getElementById('table05').style.width = width05_small;
		}
		if (document.getElementById('table06')) {
			document.getElementById('table06').style.width = width06_small;
		}
		if (document.getElementById('display06')) {
			document.getElementById('display06').style.display = display06_small;
		}
		
		changeWidthByClass ('setwidthto495','495')
	}
	//}
}

