// JavaScript Document

	// TimHinck.com - Reset height of bg_bottom div to fill entire window height
	
		function resetBgBottom() {
			var bottomSetting = document.getElementById('bg_bottom');
			var contentsHeight = getObjectSize('top', 'height') + getObjectSize('middle', 'height')/* + getObjectSize('bottom', 'height')*/;
			var winHeight = getWindowSize('height');
			
			bottomSetting.style.height = winHeight - contentsHeight + 'px';
		}
		

	// Get the height or width of an OBJECT
		// Some code from: http://www.devarticles.com/c/a/Web-Design-Standards/Matching-div-heights-with-CSS-and-JavaScript/3/
		
		function getObjectSize(id, dimension) { // dimension should be "width" or "height", depending on what you want returned
			var myobject = document.getElementById(id);
			if (dimension == "width") { return myobject.offsetWidth;
			} else if (dimension == "height") { return myobject.offsetHeight;
			}
		}


	// Get the height or width of the WINDOW
		// Original script from: http://www.howtocreate.co.uk/tutorials/javascript/browserwindow
	
		function getWindowSize(dimension) { // dimension should be "width" or "height", depending on what you want returned
		  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;
		  }
		  
		  if (dimension == "width") { return myWidth;
		  } else if (dimension == "height") { return myHeight;
		  }
		  
		  //window.alert( 'Width = ' + myWidth );
		  //window.alert( 'Height = ' + myHeight );
		}

function home_fade() {
	if (home_fade_delta == 0) return;
	var im = document.getElementById('home_fade_img');
	home_fade_cur += home_fade_delta * 5;
	if (home_fade_cur > 99) {
		home_fade_cur = 99;
		home_fade_delta = 0;
	} else if (home_fade_cur < 0) {
		home_fade_cur = 0;
		home_fade_delta = 0;
	}
	im.style.opacity = home_fade_cur/100;
	im.style.filter = 'alpha(opacity='+home_fade_cur+')';
}
function home_over() {
	home_fade_delta = -1;
}
function home_out() {
	home_fade_delta = 1;
}
