//To adjust heights
function allocateHeight() 
{
	var main = document.getElementById("main");
	var left = document.getElementById("left");
	var right = document.getElementById("right");
	if (main.offsetHeight > left.offsetHeight) 
	{
		left.style.height = main.offsetHeight + "px";
		right.style.height = main.offsetHeight + "px";
	}

	//content
	var contentmain = document.getElementById("contentmain");
	var contentleft = document.getElementById("contentleft");
	var contentright = document.getElementById("contentright");

	var maxheight = contentleft.offsetHeight;
	if (maxheight < contentmain.offsetHeight) { maxheight = contentmain.offsetHeight; }
	if (maxheight < contentright.offsetHeight) { maxheight = contentright.offsetHeight; }

	contentleft.style.height = maxheight + "px";
	contentmain.style.height = maxheight -5 + "px";
	contentright.style.height = maxheight -20 + "px";
}
function fixHeight()
{
	if (document.all && document.getElementById) 
	{
		navRoot = document.getElementById("left");
		for (i = 0; i < navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName == "LI") {
				node.onmouseover = function () { this.className += " over"; }
				node.onmouseout = function () { this.className = this.className.replace(" over", ""); } 
			} 
		} 
	}
	allocateHeight();
}

function SwitchImage(val) {
	document.getElementById("imgBig").src = "thumbnail.aspx?q=100&w=312&i=" + val;
}

function hov(loc, cls) { if (loc.className) loc.className = cls; }

function KeyDownHandler(btn) {
	// process only the Enter key
	if (event.keyCode == 13) {
		// cancel the default submit
		event.returnValue = false;
		event.cancel = true;
		// submit the form by programmatically clicking the specified button
		btn.click();
	}
	else if (document.getElementById) {
		if (event.which == 13) {
			event.returnValue = false;
			event.cancel = true;
			btn.click();
		}
	}
	else if (document.layers) {
		if (event.which == 13) {
			event.returnValue = false;
			event.cancel = true;
			btn.click();
		}
	}
}

function setFocus(obj) {
	document.getElementById(obj).focus();
	return false;
}

function OpenNew(strPage) {
	window.open(strPage, "", "width=416,height=400,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,dependent=no,screenX=50,screenY=50,left=50,top=50");
}

function Print(strHide) {
	x = document.getElementById(strHide);

	x.style.visibility = "hidden";
	window.print();
	x.style.visibility = "visible";
}
