/**
	This script resizes the page to fit the window if it's too small.
*/
function getStyle( elem, name ) {
	if (elem.style[name])
		return elem.style[name];
	else if (elem.currentStyle)
		return elem.currentStyle[name];
	else if (document.defaultView && document.defaultView.getComputedStyle) {
		name = name.replace(/(A-Z)/g,"-$1");
		name = name.toLowerCase();
		
		var s = document.defaultView.getComputedStyle(elem, "");
		return s && s.getPropertyValue(name);
	}
	else
		return null;
}
/**
	Gets height as set via CSS.
*/
function getHeight( elem ) {
	return parseInt(getStyle( elem, 'height' ) );
}
function resetCSS( elem, prop ) {
	var old = {};
	for ( var i in prop) {
		old[i] = elem.style[i];
		elem.style[i] = prop[i];
	}
	
	return old;
}
function fullHeight( elem ) {
	if (getStyle( elem, 'display' ) != 'none' )
		return elem.offsetHeight || getHeight( elem );
		
	var old = resetCSS( elem, {
		display: '',
		visibility: 'hidden',
		position: 'absolute'
	});
}
function posY(elem) {
	return parseInt( getStyle( elem, "top" ) );
}
/** 
	Gets the size of the window as set by the user's desktop resolution
*/
function getWindowHeight() {
	//Non-IE
	if( typeof( window.innerWidth ) == 'number' )
		return window.innerHeight;
	//IE 6+ in 'standards compliant mode'
	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) )
		return document.documentElement.clientHeight;
	//IE 4 compatible
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) )
		return document.body.clientHeight;
		
	return null;
}