Event.observe(window, "load", analize);
Event.observe(window, "load", clearBackground);
//Event.observe(window, "resize", analize);

function clearBackground() {
	//Retira imagem de fundo no caso de o usuário não ter o flash/javascript abilitado
	document.body.style.backgroundImage = "none";
}

function analize() 
{
	var divSwf = document.getElementById("flash_main");
	var myWidth = 0;
	var myHeight = 0;
	var minWidth  = 1010;
	var minHeight = 625;
	
	//Pega tamanho da area do navegador
	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;
	}	
	
	
	if (myHeight < minHeight || myWidth < minWidth) {
		//MENOR
		
		// height menor
		if (myHeight < minHeight) {
			divSwf.style.height	= minHeight + "px";
			document.body.style.overflowY = "scroll";
		}
		else {
			divSwf.style.height	= "100%";
			document.body.style.overflowY = "hidden";
		}
		
		// width menor
		if (myWidth < minWidth) {
			divSwf.style.width = minWidth + "px";
			document.body.style.overflowX = "scroll";
		}
		else {
			divSwf.style.width	= "100%";
			document.body.style.overflowX = "hidden";
		}
	}
	else {
		//MAIOR
		divSwf.style.height	= "100%";
		divSwf.style.width	= "100%";
		document.body.style.overflow = "hidden";
	}
	
	//document.title = "Height = " + myHeight + " | Width = " + myWidth;
}function openLayerBonus() {	$('layer-bonus').show();}function closeLayerBonus() {	$('layer-bonus').hide();}function openLayerInvite(){	$('wrapper-layer').show();}function closeLayerInvite() {	$('wrapper-layer').hide();}