function getPageHeight() {
	var pageHeight;
	if( typeof( window.innerHeight ) == 'number' ) {
	  //Non-IE
	  pageHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	  //IE 6+ in 'standards compliant mode'
	  pageHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
	  //IE 4 compatible
	  pageHeight = document.body.clientHeight;
	}
	
	return pageHeight;
}

function scrollToBottom() {
    window.scroll(0,(getPageHeight() + 500));
}

function loadCommentForm() {
	var o = document.getElementById('commentFormSection');
	if(!o) return;
	
	if (document.getElementById) {
		var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
	}
	if (x)	{
		x.onreadystatechange = function() {
			if (x.readyState == 4 && (x.status && x.status == 200)) {
				el = document.getElementById('commentFormSection');
				el.innerHTML = x.responseText;
				setTimeout(scrollToBottom,100);
			}
		}
		x.open("GET", 'comment-form.php', true);
		x.send(null);
	}	
}

function updateYear(o) {
	if(!o) return;
	window.location=('index.php?year='+o.options[o.selectedIndex].value);
}
