// JavaScript Document
window.onload = resizeSplitWndw;
window.onresize = resizeSplitWndw;
window.onbeforeprint = set_to_print;
window.onafterprint = reset_form;

function resizeSplitWndw() {
var onsr = document.getElementById("nsr");
var omainbody = document.getElementById("mainbody");

omainbody.style.width= 0; //IE6 reload bug
if (omainbody ==null) return;
if (onsr != null){
	omainbody.style.overflow= "auto";
	onsr.style.width= document.body.offsetWidth;
	omainbody.style.width= document.body.offsetWidth;
	omainbody.style.top= onsr.offsetHeight;
		if (document.body.offsetHeight > onsr.offsetHeight)
		omainbody.style.height= document.body.offsetHeight - onsr.offsetHeight;
		else omainbody.style.height=0;
	}
}

//used to modify the topic page layout temporarily so it is printable... js
function set_to_print(){
	var i;
	var onsr = document.getElementById("nsr");
	var omainbody = document.getElementById("mainbody");
	
	omainbody.style.height = "auto";
	omainbody.style.width = "auto";
	omainbody.style.overflow = "visible";
	for (i=0; i < document.all.length; i++){
		if (document.all[i].tagName == "BODY") { document.all[i].scroll = "auto"; }
	}
top.hmcontent.focus();
top.hmcontent.print();
}

//used after a topic page is printed, this code restores the divs... js
function reset_form() { document.location.reload(); }