window.onload = function() {
	var pagesize = getDocumentHeight();
	var maincontent = document.getElementById('maincontent');
	var footer = document.getElementById('footer');
	var bottomnav = document.getElementById('bottomnav');
	maincontent.style.height = pagesize - 97 - bottomnav.offsetHeight - footer.offsetHeight +'px';

	var topmenu = document.getElementById('topmenu');
   if (topmenu != null) {
  	  var lis = topmenu.getElementsByTagName('li');
	  for(i = 0; i < lis.length; i++) {
		 lis[i].onmouseover = function() {
			var ul = this.getElementsByTagName('ul')[0];
			if(ul) {
			    var pointA = this.firstChild;
				while(pointA.tagName != 'A') {
                    pointA = nextSibling;
				}
				pointA.style.color = '#087112';
				ul.style.display = 'block';
			}
		}
		lis[i].onmouseout = function() {
			var ul = this.getElementsByTagName('ul')[0];
			if(ul) {
			    var pointA = this.firstChild;
				while(pointA.tagName != 'A') {
                    pointA = nextSibling;
				}
				pointA.style.color = '#010d5a';
				ul.style.display = 'none';
			}
		}
	}
}
}
var ua = navigator.userAgent.toLowerCase();
var isOpera = (ua.indexOf('opera')  > -1);
var isIE = (!isOpera && ua.indexOf('msie') > -1);

function getDocumentHeight() {
  return Math.max(document.compatMode != 'CSS1Compat' ? document.body.scrollHeight : document.documentElement.scrollHeight, getViewportHeight());
}

function getViewportHeight() {
  return ((document.compatMode || isIE) && !isOpera) ? (document.compatMode == 'CSS1Compat') ? document.documentElement.clientHeight : document.body.clientHeight : (document.parentWindow || document.defaultView).innerHeight;
}
