// JavaScript Document// JavaScript Document

function getSize() {
  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;
  }

  return myHeight;
}

var firstPos = 0;
var isSet = false;

function moveFooter() {
	var	footer = document.getElementById("footer");
	var	position = footer.offsetTop+footer.offsetHeight;
	var position2 = getSize()-26;

	
	position = (!isSet)? position : position-30;
		
	if(position > firstPos && (position > position2)) {
		footer.style.top = position + "px";	
		firstPos = position;
	}
			
	else if (position2 > firstPos){
	/*			footer.style.bottom = "0px";	*/
		footer.style.top = position2 + "px";
		firstPos = position2;
	}
	footer.style.visibility='visible';
	isSet = true;	
}

window.onresize = moveFooter; 