	   function getWindowHeight() {
	       var windowHeight = 0;
	           if (window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight) {
	           windowHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
	           }
	       return windowHeight;
	       }
	
	   function setFooter() {
	       if (document.getElementById) {
	           var windowHeight = getWindowHeight();
	           if (windowHeight > 0) {
	               var contentHeight = document.getElementById('content').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();
	   }