//IMAGEOPEN

function display(myimage, w, h) {
	var html = "<html><head><title>image</title></head><body style='margin:0px;padding:0px;'><a href='javascript:window.close()'><img src='" + myimage + "' border=0/></a></body></html>";
	popup=window.open('','image','toolbar=0,width='+w+',height='+h+'location=0,directories=0,menuBar=0,scrollbars=0,resizable=0');
	popup.document.open();
	popup.document.write(html);
	popup.document.close();
	return false;
}

//BGALIGN

function getheight() {
	var myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
		myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		myHeight = document.body.clientHeight;
	}
	return myHeight;
}

rendered = 0;
function loaded () {
	rendered = 1;
	fixbottom();
}

function fixbottom () {
	if (rendered != 1) return;
	var doch = getheight()-200;
	if (document.getElementById("block3")) {
		var block2h = document.getElementById("block2").clientHeight;
		var block3h = document.getElementById("block3").clientHeight;
		var blockh = Math.max(block2h, block3h);
	} else {
		var blockh = document.getElementById("block2").clientHeight;
	}
	document.getElementById("footer").style.top = Math.max(blockh, doch)+"px";
	document.getElementById("footer").style.display = "block";
}