function getPageHeight() {
  var myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }
  return myHeight;
}

function getPageWidth() {
  var myWidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
  }
  return myWidth;
}

function alertSize() {
  window.alert( 'Width = ' + getPageWidth() );
  window.alert( 'Height = ' + getPageHeight() );
}

function ResizeBoxElement(element, imgWidth, imgHeight) {

// get current height and width
wCur = element.offsetWidth;
hCur = element.offsetHeight;

// scalars based on change from old to new
this.xScale = ((imgWidth) / wCur) * 100;
this.yScale = ((imgHeight) / hCur) * 100;

// calculate size difference between new and old image, and resize if necessary
wDiff = wCur - imgWidth;
hDiff = hCur - imgHeight;

if(!( hDiff == 0)){ new Effect.Scale(element, this.yScale, {scaleContent: false, scaleX: false, duration: 0.4, queue: 'ResizeBoxElement'}); }
if(!( wDiff == 0)){ new Effect.Scale(element, this.xScale, {scaleContent: false, scaleY: false, delay: 0.2, duration: 0.4, queue: 'ResizeBoxElement'}); }

}

function debug(content, clear) {
		if (clear){
			$('debugBox').innerHTML = '';
		}
	
		$('debugBox').innerHTML = $('debugBox').innerHTML+content;
}

function showDebug() {
	Effect.toggle('debugBox', 'blind');
	//setTimeout('resizeElements()', 1500);
}