// JavaScript Document

// Flash
function flash(URL,WIDTH,HEIGHT){
	
/*
Resolução do monitor: "screen.width" e "screen.height"
Área útil do monitor: "screen.availWidth" e "screen.availHeight"
*/
	
	if (window.innerWidth) {
	w = window.innerWidth;
	if (!window.opera && document.height > window.innerHeight) w -= 16;
	}
	else if (document.body) {
	if (document.body.clientWidth) w = document.body.clientWidth;
	}
	//alert("Width verdadeiro:"+w);
	
	
	if (window.innerHeight) {
	h = window.innerHeight;
	if (!window.opera && document.width > window.innerWidth) h -= 16;
	}
	else if (document.body) {
	if (document.body.clientHeight) h = document.body.clientHeight;
	}
	//alert("Height verdadeiro:"+h);
	
	// Verifica se o browser pode expandir e chama a função de expansão
	if(w < screen.width){
	maxWindow();
	}
	
	if (w < 778){
		SCALE = "noborder";
		WIDTH = 778;
	} else {
		SCALE = "noscale";
	}
	
	if (h < 470){
		SCALE = "noborder";
		HEIGHT = 470;
	} else {
		SCALE = "noscale";
	}
	
	document.write('<div  align="center"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" WIDTH='+WIDTH+' HEIGHT='+HEIGHT+'> <param name=movie VALUE="'+URL+'"><param name=quality VALUE=high><param name="menu" value="false"><param name=scale VALUE='+SCALE+'> <embed src="'+URL+'" quality=high scale='+SCALE+' WIDTH='+WIDTH+' HEIGHT='+HEIGHT+' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" menu="false"></embed></object></div>')
}

// Função de expansão do Browser
function maxWindow()
{
window.moveTo(0,0);

if (document.all)
{
  top.window.resizeTo(screen.availWidth,screen.availHeight);
}
else if (document.layers||document.getElementById)
{
  if (top.window.outerHeight<screen.availHeight||top.window.outerWidth<screen.availWidth)
  {
    top.window.outerHeight = screen.availHeight;
    top.window.outerWidth = screen.availWidth;
  }
}
}