// 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="wmode" value="transparent"><param name="menu" value="false"><param name=scale VALUE='+SCALE+'> <embed src="'+URL+'" quality=high scale='+SCALE+' WIDTH='+WIDTH+' HEIGHT='+HEIGHT+' wmode=transparent 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;
  }
}
}

// Cadeado
function dno(){
	return false
}

function omu(e){
	if(e.which==1){
		window.releaseEvents(Event.MOUSEMOVE);
		window.onmousemove=null
	}
}

function jk(){
	return false
}

function kj(e){
	if(e.which==1){
		window.captureEvents(Event.MOUSEMOVE);
		window.onmousemove=dno
	}
	if(e.which==3){
		return jk()
	}
}

function ct(){
	hg=event.button;
	if(hg==2||hg==3){
		jk()
	}
}

vc=document.all;
qb=document.getElementById;

if(vc){
	if(qb){
	document.oncontextmenu=jk;
	document.onselectstart=dno
	} else {
	document.onmousedown=ct
	}
}

if(qb&&!vc){
	document.onmousedown=dno;
	document.onmouseup=kj;
	document.oncontextmenu=dno
}

if(document.layers){
	window.captureEvents(Event.MOUSEUP|Event.MOUSEDOWN);
	window.onmousedown=kj;
	window.onmouseup=omu
}



