var minWidth=-1;
var minHeight=-1;
		
function setFlashSize(flashWidth,flashHeight)
{
	minWidth = flashWidth;
	minHeight = flashHeight;
	divResize();
	window.scrollTo(0,0);
}

window.onload=function()
{
	divResize();
}
window.onresize=function()
{
	divResize();
}


function getWindowSize()
{
	var winH, winW;
	if (parseInt(navigator.appVersion)>3) {
		if ( document.body.offsetWidth ){ // Gecko / WebKit
			winW = document.body.offsetWidth;
			winH = document.body.offsetHeight;
		} else if ( document.body.offsetWidth ){ // MS
			winW = document.body.offsetWidth;
			winH = document.body.offsetHeight;
		}
	}
	return { height: winH, width: winW };
}
function divResize()
{
	var winSize = getWindowSize();
	var w, h, min_w, min_h;
	
	if(minWidth == -1 )
	{
		min_w = "0px";
		w="100%"
	}else{
		w = winSize.width < minWidth ? minWidth+"px" : "100%";
		min_w = minWidth+"px";
	}
	
	if(minHeight == -1)
	{
		min_h = "0px";
		h = "100%";
	}else{
		h = winSize.height < minHeight ? minHeight+"px" : "100%";
		min_h = minHeight+"px";		
	}
	if( document.all ) document.body.scroll = ( w!="100%" || h!="100%" )? "auto" : "no";
	
	document.getElementById("flashContainer").style.minWidth = min_w;
	document.getElementById("flashContainer").style.minHeight = min_h;
	document.getElementById("flashContainer").style.width = w;
	document.getElementById("flashContainer").style.height = h;
}

window.onscroll = function()
{
    var iebody=(document.compatMode && document.compatMode != "BackCompat")? document.documentElement : document.body
	var dsocleft=document.all? iebody.scrollLeft : window.pageXOffset
	var dsoctop=document.all? iebody.scrollTop : window.pageYOffset
	for(var i=0; i<swfObjArr.length; i++ )
	{
		obj = swfobject.getObjectById(swfObjArr[i]);
		if( typeof( obj.setScrollOffset ) == 'function' )
		{
			obj.setScrollOffset( dsoctop , dsocleft);
		}
	}
}
