window.onresize = twoCol;

function load() {
	twoCol();
	if (Array.every || (document.compatMode && document.all)) {
		//alert('You are using a modern browser.');
	}
}

function twoCol() {
  if (document.getElementById('l')) {
		var story = document.getElementById('content');
		var l = document.getElementById('l');
		var r = document.getElementById('r');
		var w = story.offsetWidth;
		w = w-30; // content padding
		w = w/2; // there's two
		w = w-20; // margin between columns (each column)
 		l.style.width = w + "px";
 		r.style.width = w + "px";
		var lh = l.clientHeight;
		var rh = r.clientHeight;
		if (lh <= rh) {
			l.style.height = rh + "px";
		}
		else {
			r.style.height = lh + "px";
		}
	}
	
	if (
		document.getElementById('lh') && // does the div exist
	 	( Array.every || (document.compatMode && document.all) )
	) {
		var s = document.getElementById('home');
		var r = document.getElementById('rh');
		var l = document.getElementById('lh');
		var t = document.getElementById('training');

/*
		if (offset <= 140) {
			if (l.setAttribute("style","float:none")) {
				l.setAttribute("style","float:none");
			}
			else if (l.style.styleFloat = "none") {
				l.style.styleFloat = "none";
			}
			t.style.marginLeft = 0;
			t.style.marginTop = 2 + "px";
			l.style.width = (storyWidth-2) + "px";
			r.style.width = (storyWidth-2) + "px";
		}
		else {
			if (l.setAttribute("style","float:left")) {
				r.setAttribute("style","float:right");
			}
			else {
				r.style.styleFloat = "right";
			}
			t.style.marginTop = 0;
			l.style.width = 362 + "px";
			r.style.width = offset + "px";
			t.style.height = 236 + "px";
		}
*/
//  alert('hi');
	var storyWidth = s.offsetWidth;
	offset = storyWidth-360; // image

	if (offset <= 140) {
		w = storyWidth - 2;
		t.style.marginLeft = 0;
		t.style.marginTop = 2 + "px";
		r.style.width = w + "px";
		t.style.height = 236 + "px";
		l.style.width = storyWidth + "px";
	}
	else {
		l.setAttribute("style","float:left");
		r.setAttribute("style","float:left");
		l.style.styleFloat = "left";
		r.style.styleFloat = "left";
		w = offset - 4;
		t.style.marginTop = 0;
		l.style.width = "auto";
		r.style.width = w + "px";
		t.style.height = 236 + "px";
	}


	}
}

function loadHTML(div) {
	document.getElementById(div).style.display = "block";
}

function unloadHTML(div) {
	document.getElementById(div).style.display = "none";
}
