// JavaScript Document
// Utilizado para evitar de digitar: document.getElementById toda hora, tornando o processo mais prático
function gE(ID) {
	return document.getElementById(ID);
}

// Utilizado para evitar de digitar: document.getElementsByTagName toda hora, tornando o processo mais prático
function gEs(tag) {
	return document.getElementsByTagName(tag);
}

function valida(){	
	with(document.comentario){
		
		var txt = new Array();
		txt[0]  = gE('txt_nome');
		txt[1]  = gE('txt_comentario');
		
		var forms = new Array();
		forms[0]   = com_nome.value;
		forms[1]   = com_comentario.value;
		
		var i;
		var erro = 0;
		for(i=0; i<txt.length; i++){
			txt[i].style.color = !forms[i] ? "#FF0000" : "#666666";
			if(!forms[i]){
				erro = 1;
			}
		}
		
		if(erro){
			alert("Todos os campos em vermelho são de preenchimento obrigatório.");
			return false;
		}
	}		
}

function EscreveFlash(width, height, src, id){
	var Swf;
	
	Swf = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" id="+id+" width="+width+" height="+height+">";
	Swf += "<param name=\"movie\" value="+src+" />";
	//Swf += "<param name=\"allowScriptAccess\" value=\"sameDomain\" />";
	Swf += "<param name=\"quality\" value=\"high\" />";
	Swf += "<param name=\"wmode\" value=\"transparent\" />";
	Swf += "<param name=\"menu\" value=\"false\" />";
	Swf += "<embed id="+id+" name="+id+" allowScriptAccess=\"sameDomain\" swLiveConnect=\"true\" src="+src+" quality=\"high\" wmode=\"transparent\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width="+width+" height="+height+"></embed></object>";
	
	this.document.write(Swf);
} 

function PlayClick(){
	document.WMPlay.Play();
}

function StopClick(){
	numero = 1;
	document.WMPlay.Stop();
	if (navigator.appName.indexOf('Iexplorer') != -1) {
		document.WMPlay.SetCurrentPosition(0);
	} else {
		document.WMPlay.CurrentPosition = 0;
	}
	
}

/*
var rand = 1 + Math.floor(Math.random() * 4);
alert(rand);

switch(rand){
	case 1: 
		document.body.style.backgroundImage = "url(imagens/topo-atual.jpg)";
		document.getElementById('linktop').setAttribute('href','http://pb.ongame.com.br/downloads?utm_source=Teamplay&utm_medium=Background&utm_content=Fundo%2B-%2BTarantula&utm_campaign=PB%2B-%2BTeamplay')
	break;	
	
	case 2: 
		document.body.style.backgroundImage = "url(topo-vilao.jpg)";
		document.getElementById('linktop').setAttribute('href','http://pb.ongame.com.br/downloads?utm_source=Teamplay&utm_medium=Background&utm_content=Fundo%2B-%2BVilao&utm_campaign=PB%2B-%2BTeamplay')
	break;	
	
	case 3: 
		document.body.style.backgroundImage = "url(imagens/topo-heroi.jpg)"; 
		document.getElementById('linktop').setAttribute('href','http://pb.ongame.com.br/downloads?utm_source=Teamplay&utm_medium=Background&utm_content=Fundo%2B-%2BHeroi&utm_campaign=PB%2B-%2BTeamplay')
	break;	
	
	case 4: 
		document.body.style.backgroundImage = "url(imagens/topo-tarantula.jpg)"; 
		document.getElementById('linktop').setAttribute('href','http://pb.ongame.com.br/downloads?utm_source=Teamplay&utm_medium=Background&utm_content=Fundo%2B-%2BTarantula&utm_campaign=PB%2B-%2BTeamplay')
	break;	
}



*/
