/*
   window_size.js - v2.1 - http://gowiki/index.php/Window_size.js

 - footer: ID da div que contem todo o footer.
 - elemento: ID da div que contem todo o conteudo excepto a div footer.

 - NOTA: a div do footer terá de ficar FORA da div que tem o conteudo.
*/
/*
	function getHeight(id){
		if (document.all) {
			gh = document.getElementById(id).offsetHeight+10;
		} else {
			document.getElementById(id).style.height="auto";
			gh = document.getElementById(id).offsetHeight;
		}
		return gh;
	}

	var elemento = "container";
	var footer = "footer";
	function adjustPage(){
	    var footer_h = getHeight(footer);

		  var width_container = 0, height_container = 0;
		  if( typeof( window.innerWidth ) == 'number' ) {
		    //Non-IE
		    width_container = window.innerWidth;
		    height_container = window.innerHeight;
		  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		    //IE 6+ in 'standards compliant mode'
		    width_container = document.documentElement.clientWidth;
		    height_container = document.documentElement.clientHeight;
		  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		    //IE 4 compatible
		    width_container = document.body.clientWidth;
		    height_container = document.body.clientHeight;
		  }

	    var height_cont = getHeight(elemento);
        var total = height_cont + footer_h;
        if (Browser.is_gecko) total -= 20;

	    if ((total) < height_container) {
	    	//alert('resize');
	        var alt_wrapper = height_container - footer_h;
	        if (Browser.is_gecko) alt_wrapper -= 20;
	        if (Browser.is_opera) alt_wrapper -= 12;
	        document.getElementById(elemento).style.height = alt_wrapper + 'px';
	    }
	}
window.onload=adjustPage;
window.onresize=adjustPage;






	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 adjustPage() {
		if (document.getElementById) {
			var windowHeight = getWindowHeight();
			if (windowHeight > 0) {
				var contentHeight = document.getElementById('container').offsetHeight;
				var footerElement = document.getElementById('footer');
				var footerHeight  = footerElement.offsetHeight;
				if (windowHeight - (contentHeight + footerHeight) >= 0) {
					footerElement.style.position = 'absolute';
					footerElement.style.top = (windowHeight - footerHeight-13) + 'px';
				}
				else {
					footerElement.style.position = 'static';
				}
			}
		}
	}
	
	
	
	window.onload = function() {
		adjustPage();
	}
	window.onresize = function() {
		adjustPage();
	}










//if (Browser.is_ie) alert('Por favor escolha um browser decente!');*/
