function verificaMes(valorCampo)
{
	if(valorCampo > 12)
	{
		alert('Mês Inválido');
	}
}

function verificaDia(valorCampo)
{
	if(valorCampo > 31)
	{
		alert('Dia Inválido');
	}
}

function verificaAno(valorCampo)
{
	if(valorCampo)
	{
		if(valorCampo == 0 || valorCampo == 0000 || valorCampo == 1111 || valorCampo == 2222 || valorCampo == 3333 || valorCampo == 4444 || valorCampo == 5555 || valorCampo == 6666 || valorCampo == 7777 || valorCampo == 8888 || valorCampo == 9999 || valorCampo == 0123 || valorCampo == 1234)
		{
			alert('Ano Inválido');
		}
	}
}

function campoNumerico(evt,campo) 
{
		evt = (evt) ? evt : window.event
		var digito = campo.value
		if (isNaN (digito))
		{
			var mainString = campo.value
			var param1 = 0
			var param2 = -1
			campo.value = mainString.slice(param1, param2)
			alert ("Este campo só aceita números.")
			campo.focus()
		}
}

function validarExclusao(URL, textoconfirm)
{
	if(confirm(textoconfirm))
	{
		document.location.href = URL;
	}
	else
	{
    	return false;
	}
}

function escreveData() 
{ 
  day = new Date() 
  num_dia = day.getDate() 
  dia = day.getDay() 
  mes = day.getMonth() 
  ano = day.getYear() 

  diaSemana = new Array("Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado") 
  nomeMes = new Array("janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro") 
  dataext = diaSemana[dia] + ", " + num_dia + " de " + nomeMes[mes] + " de " + ano 

  return dataext; 
} 


function limpa_espaco(campoV){
	for (var i = 0; i < campoV.length; i++){
		campoV[i].value = Trim(campoV[i].value)
	} 
}

function ativo(src) {
if (!src.contains(event.fromElement))
 {
    src.bgColor = '#cccccc';
	src.style.color = '#000000';
	src.style.cursor = "hand";
 }
}
function inativo(src) {
if (!src.contains(event.toElement))
 {
	  src.bgColor = '#ffffff';
	  src.style.color = '#000000';
	  src.style.cursor = "default";
 }
}

function aZaga()
{
	document.all.zagueiro_s.style.display='';
	document.all.zagueiro_n.style.display='none';
}
function dZaga()
{
	document.all.zagueiro_s.style.display='none';
	document.all.zagueiro_n.style.display='';
}

function aLateral()
{
	document.all.lateral1_s.style.display='';
	document.all.lateral2_s.style.display='';
	document.all.lateral1_n.style.display='none';
	document.all.lateral2_n.style.display='none';
}
function dLateral()
{
	document.all.lateral1_s.style.display='none';
	document.all.lateral2_s.style.display='none';
	document.all.lateral1_n.style.display='';
	document.all.lateral2_n.style.display='';
}

function aMeio()
{
	document.all.meio_s.style.display='';
	document.all.meio_n.style.display='none';
}
function dMeio()
{
	document.all.meio_s.style.display='none';
	document.all.meio_n.style.display='';
}

function aAtaque()
{
	document.all.ataque_s.style.display='';
	document.all.ataque_n.style.display='none';
}
function dAtaque()
{
	document.all.ataque_s.style.display='none';
	document.all.ataque_n.style.display='';
}

function mudarMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function ValidaCadastro()
{
	if (document.cadastro.de_email.value == '')
	{
		alert('Preencha o Campo Email');
		document.cadastro.de_email.focus();
		return false;
	}
	if (document.cadastro.de_email.value!=document.cadastro.de_email.defaultValue)
	{
		if (document.cadastro.de_email.value.indexOf('@',0)==-1 ||
			document.cadastro.de_email.value.indexOf('.',0)==-1) 
		{
			alert('E-mail inválido !'); 
			document.cadastro.de_email.select();
			document.cadastro.de_email.focus();
			return false;
		}
	}
	if (document.cadastro.de_senha.value == '')
	{
		alert('Preencha o Campo Senha');
		document.cadastro.de_senha.focus();
		return false;
	}
	if (document.cadastro.de_nome.value == '')
	{
		alert('Preencha o Campo Nome');
		document.cadastro.de_nome.focus();
		return false;
	}
	if (document.cadastro.dia.value == '')
	{
		alert('Preencha o Campo Dia');
		document.cadastro.dia.focus();
		return false;
	}
	if (document.cadastro.mes.value == '')
	{
		alert('Preencha o Campo Mês');
		document.cadastro.mes.focus();
		return false;
	}
	if (document.cadastro.ano.value == '')
	{
		alert('Preencha o Campo Ano');
		document.cadastro.ano.focus();
		return false;
	}
	if (document.cadastro.fk_id_pais.value == '0')
	{
		alert('Preencha o Campo Pais');
		document.cadastro.fk_id_pais.focus();
		return false;
	}
	if (document.cadastro.fk_id_denominacao.value == '')
	{
		alert('Preencha o Campo Denominação');
		document.cadastro.fk_id_denominacao.focus();
		return false;
	}
}

//Funções TV

function UpVolumeClick()
{
	if (document.WMPlay.Volume <= -300) {
	document.WMPlay.Volume = document.WMPlay.Volume + 300;
	}
}
function DownVolumeClick()
{
	if (document.WMPlay.Volume >= -8000) {
	document.WMPlay.Volume = document.WMPlay.Volume - 300;
	}
}
function reconnect() {
	document.location.reload();
}
function goodc(url) {
	if (url!="") {
		if (parent.frames.length==4) {
			if (parent.parent.frames['playersr'].document.BrowserControl) {
				parent.parent.frames['playersr'].document.BrowserControl.navigate(url);
			} else {
				parent.parent.frames['playersr'].document.location.href = url;
			}
		} else {
			if (parent.frames['playersr'].document.BrowserControl) {
				parent.frames['playersr'].document.BrowserControl.navigate(url);
			} else {
				parent.frames['playersr'].document.location.href = url;
			}
		}
	} 
}
function gohelp(url) {
if (url!="") {

	if (parent.frames.length==4) {
		if (parent.parent.frames['playersr'].document.BrowserControl) {
			parent.parent.frames['playersr'].document.BrowserControl.navigate(url);
		} else {
			if (parent.parent.frames['playersr']) {
			parent.parent.frames['playersr'].location.href = url;
			} else {
			window.open(url);
			}
			
		}
	} else {
		if (parent.frames['playersr']) {
		if (parent.frames['playersr'].document.BrowserControl) {
			parent.frames['playersr'].document.BrowserControl.navigate(url);
		} else {
			if (parent.frames['playersr']) {
			parent.frames['playersr'].location.href = url;
			} else {
			window.open(url);
			}
		}
		} else {
		window.open(url);
		}
	}
}
}

function telaCheia()
{
	document.getElementById("MediaPlayer").fullScreen = true;
}

function alertaTela()
{
	alert('Para votar para o modo de exibição precione a tecla ESC.');
}

function mascaraAltura(campoAltura){             
	var altura = campoAltura.value;              
	if (altura.length == 1){
		altura = altura + '.';                  
		document.formBusca.altura.value = altura;      
		return true;                            
	}     
}

function pgResultados(pagina){
	document.paginacao.pg.value=pagina;
	document.paginacao.submit();
}

function abreJanela(url, nome, caracteristicas)
{ 
	window.open(url, nome, caracteristicas);
}

function popEmailAgentes(agente){
	var urlDestino = 'ninc/emailAgente.php?ag='+agente;
	window.open(urlDestino,'popEmail','width=400,height=550');
}
function popMovies(movies){
	var urlDestino = 'ninc/popMovies.php?mv='+movies;
	window.open(urlDestino,'popMovies','width=450,height=440');
}

function closepop()
{
	document.all.bannerflutuante.style.display='none';
}