
/**
* 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 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";
}
