// JavaScript Document

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('contentfull').offsetHeight;
					var footerElement = document.getElementById('footer');
					var footerHeight  = footerElement.offsetHeight;
					if (windowHeight - (contentHeight + footerHeight) >= 0) {
						footerElement.style.top = (windowHeight - (contentHeight + footerHeight)) + 'px';
					}
					else {
						footerElement.style.top = '0px';
					}
				}
			}
		}
		window.onload = function() {
			setFooter();
		}
		window.onresize = function() {
			setFooter();
		}









//------------------- Son-Of-Sucker-Fish IE Hack -------------------//

sfHover = function() {
          var sfEls = document.getElementById("nav").getElementsByTagName("li");
          // for each list item in the menu...
          for (var i=0; i < sfEls.length; i++) {
                   // Is this IE7?  If so, use onmouseleave to fix the fact that onmouseout won't fire
                   is_IE7 = navigator.appVersion.indexOf("MSIE 7.0") != -1;
                   sfEls[i].onmouseover = function() {
                             this.className+=" sfHover";
                             // is this a top-level menu item?
                             var child_ul = this.getElementsByTagName('ul')[0];
                             if (child_ul && is_IE7){
                                      // fix for IE7
                                      child_ul.style.position = 'static';
                             }
                   }
                   sfEls[i].onmouseleave = function() {
                             // is this a top-level menu item?
                             var child_ul = this.getElementsByTagName('ul')[0];
                             if (child_ul && is_IE7){
                                      // fix for IE7
                                      child_ul.style.position = 'absolute';
                                      child_ul.style.left = '-9000px';
                             }
                   }
                   sfEls[i].onmouseout = function() {
                             this.className=this.className.replace(new RegExp(" sfHover\\b"), "");
                   }
          }
}
if (window.attachEvent) window.attachEvent("onload", sfHover);