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 headerHeight = document.getElementById('header').offsetHeight;
	var contentHeight = document.getElementById('middle').offsetHeight;
	var footerElement = document.getElementById('footer');
	var footerHeight  = footerElement.offsetHeight;
	if (windowHeight - (contentHeight + footerHeight + headerHeight) >= 0) {
footerElement.style.top = (windowHeight - (contentHeight + footerHeight + headerHeight)) + 'px';
document.getElementById('leftbg').style.height = windowHeight + 'px';
document.getElementById('rightbg').style.height = windowHeight + 'px';
	}
	else {
footerElement.style.top = '0px';
	}
}
	}
}

  var p=0;
  var speed=50;   // vary this to suit, larger value - slower speed

function clouds() {

   document.getElementById('toppics').style.backgroundPosition=p+'px 0';

   p--;    //change this to p-- for right to left direction

setTimeout('clouds()',speed);
 }

window.onload = function() {
	setFooter();
	clouds();
}
window.onresize = function() {
	setFooter();
}