

function alertSize() {
  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;
  }
  window.alert( 'Width = ' + myWidth );
  window.alert( 'Height = ' + myHeight );
}

/**
* This will immediately size the HTML frame to the specified height
*/
function sizeNow(height) {

	$('wrapper').setStyle({height: height + 'px'});
}

/**
* Called when the Flash has been resized. Triggered by the Flash movie
*/
function checkSize(){
	if(document.documentElement.clientHeight <= 750){
		document.getElementById('wrapper').style.height = "151%";
	}
	
	if(window.innerHeight <= 900){

		document.getElementById('wrapper').style.height = "151%";
//		var wrap = document.getElementById('wrapper')style.height = "151%";
//		wrap.style.height = "151%";
	}
}

function onFlashResize(height) {

	var newHeight = Math.max(height, document.viewport.getHeight());
	sizeNow(newHeight);
}


/**
* Function for tweening page height - utilizes Tween.js library. As is, this is not IE6-safe
*/
function resizeAndAnimate(finalHeight) {

	viewerTween = new Tween(new Object(), 'height', Tween.strongEaseOut, document.viewport.getHeight(), finalHeight, 2, 'px');
	viewerTween.onMotionChanged = function(e) {
		var height = Math.ceil(e.target.prevPos);
		sizeNow(height);
	};
	viewerTween.start();
}



/**
* Simple function for animating the page's height
*/
function resizePage(height) {

	var newHeight = 1600;
	var el = document.body.style;
	//var resizeElements = new Array($(containerId).style);
	
	var t = new Tween(document.body.style, 'height', Tween.strongEaseOut, 900, newHeight, 2, 'px');
	t.onMotionChanged = function(e) {
		var numeric = el.height.replace(/px/, '');
		$('wrapper').height = numeric + "px";
		//if(IE6) setIeObjectHeight(numeric);
	};
	t.start();
}

/**
*	Used as a workaround for setting the <object> height in IE 6, otherwise flash area will not expand properly
*/
function setIeObjectHeight(num) {
	$(objectId).style.height = num + "px";
}
