/*
   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 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';
					document.getElementById('container').style.height = (windowHeight - footerHeight) + 'px';
//					footerElement.style.top = (windowHeight - footerHeight-13) + 'px';
				}
			}
		}
	}
	
	
	
	window.onload = function() {
		adjustPage();
	}
	window.onresize = function() {
		adjustPage();
	}


*/

function dosizeSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  
  var contentHeight = $('content').offsetHeight;
  var headerHeight = 306;
  var contents = contentHeight + headerHeight;
  
  if(Prototype.Browser.IE){
		//contents = contents+1;
		//myHeight = myHeight+1;
  }

  

  //alert(contentHeight + ' ' + myHeight);
 if(contents > myHeight){
 	var footerHeight = contents+54;
 } else {
 	var footerHeight = myHeight-54;
 }
 
 
 
 $('footer').style.top = footerHeight+'px';

 
}

