function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	}
	else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		}
		else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}
function setFooter() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		if (windowHeight > 0) {
			var contentHeight = document.getElementById('main').offsetHeight;
			var footerElement = document.getElementById('footer');
			var footerHeight  = footerElement.offsetHeight;
			
			if (windowHeight - (contentHeight + footerHeight) >= 0) {
				footerElement.style.position = 'absolute';
				footerElement.style.top = (windowHeight - footerHeight) + 'px';
			}
			else {
				footerElement.style.position = 'absolute';
				footerElement.style.top = contentHeight + 'px';
			}
		}
	}
}

window.onload = function() {
	setFooter();
}
window.onresize = function() {
	setFooter();
}

function ViewLayers (id)
{
 	if (document.getElementById) {
		var sublevelElement = document.getElementById('sublevel_'+id);
		var styleGroupElement = document.getElementById('style_group_'+id);
//		var imgElement = document.getElementById('img_'+id);
		
		if (sublevelElement.style.display == 'none') {
			sublevelElement.style.display = '';
			styleGroupElement.className = 'group-active'
//			imgElement.src = '/_img/v_menu_minus.gif';
			setFooter();
		}
		else {
			sublevelElement.style.display = 'none';
			styleGroupElement.className = 'group'
//			imgElement.src = '/_img/v_menu_plus.gif';
			setFooter();
		}
	}
	return false;
}

function openwin(page, x, y){
	window.open(page, "_blank", "width=" + x + ", height=" + y + ", Scrollbars=no,Resizable=no")
}