/* 
Methods for resizing the flash stage at runtime.

setFlashWidth(divid, newW)
divid: id of the div containing the flash movie.
newW: new width for flash movie

setFlashWidth(divid, newH)
divid: id of the div containing the flash movie.
newH: new height for flash movie

setFlashSize(divid, newW, newH)
divid: id of the div containing the flash movie.
newW: new width for flash movie
newH: new height for flash movie

canResizeFlash()
returns true if browser supports resizing flash, false if not. 
*/

var flashSetWinWdt=750;
var flashSetWinHgt=507;



function canResizeFlash(){
	var ua = navigator.userAgent.toLowerCase();
	var opera = ua.indexOf("opera");
	if( document.getElementById ){
		if(opera == -1) return true;
		else if(parseInt(ua.substr(opera+6, 1)) >= 7) return true;
	}
	return false;
}

function getWindowWidth() {
	var windowWidth=0;
	if (typeof(window.innerWidth)=='number') {
		windowWidth=window.innerWidth;
	}else{
		if (document.documentElement &&	document.documentElement.clientWidth){
		windowWidth=document.documentElement.clientWidth;
		}else{
			if (document.body&&document.body.clientWidth){
				windowWidth=document.body.clientWidth;
			}
		}
	}
	return windowWidth;
}
function getWindowHeight() {
	var windowHeight=0;
	if (typeof(window.innerHeight)=='number') {
		windowHeight=window.innerHeight;
	}else{
		if (document.documentElement &&	document.documentElement.clientHeight){
		windowHeight=document.documentElement.clientHeight;
		}else{
			if (document.body&&document.body.clientHeight){
				windowHeight=document.body.clientHeight;
			}
		}
	}
	return windowHeight;
}

function resizeHtmlWin(){
	if(getWindowHeight()<flashSetWinHgt){
		document.getElementById('flashid').style.height = flashSetWinHgt+"px";
	}else{
		document.getElementById('flashid').style.height = getWindowHeight()+"px";
	}
	if(getWindowWidth()<flashSetWinWdt){
		document.getElementById('flashid').style.width = flashSetWinWdt+"px";
	}else{
		document.getElementById('flashid').style.width = getWindowWidth()+"px";
	}
}