/*** MP Medical Devices Functions     ***/
/*** Copyright 2007 Figureseven, Inc. ***/
/*** Requires PrototypeJS v 1.5.1     ***/


var ScreenHeight = 0;
var ScreenWidth = 0;

window.onload = function() { screenSize(); };
window.onresize = function() { screenSize(); };



// Sets screenHeight and screenWidth
	function screenSize() {
		  if( typeof( window.innerWidth ) == 'number' ) {
			// Non-IE
			ScreenWidth = window.innerWidth;
			ScreenHeight = window.innerHeight;
		  } else {
			if( document.documentElement &&
				( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			  // IE 6+ in 'standards compliant mode'
			  ScreenWidth = document.documentElement.clientWidth;
			  ScreenHeight = document.documentElement.clientHeight;
			} else {
			  if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
				// IE 4 compatible
				ScreenWidth = document.body.clientWidth;
				ScreenHeight = document.body.clientHeight;
			  } // end if
			} // end else
		  } // end else

		if ($('main').getHeight() <= ScreenHeight) {
			//alert(ScreenHeight + ' ' + $('mainSpacer').style.height);
			$('mainSpacer').style.height = ScreenHeight + 'px';
			$('leftCover').style.height = ScreenHeight + 'px';
		} else {
			$('mainSpacer').style.height = $('main').getHeight() + 'px';
			$('leftCover').style.height = $('main').getHeight() + 'px';
		} //end if

		return true;
	} //end screenSize function
	

