function PegaBotao(BOTAO){
var MENSAGEM = 'Todos os direitos reservados a Radio Cultura Musical';
	if (document.all) {
		if (event.button == 2){
	alert(MENSAGEM);
		}
	}
}
document.onmousedown = PegaBotao;


function over() {

         var sfEls = document.getElementById("nav1").getElementsByTagName("LI");
		     for (var i=0; i<sfEls.length; i++) {
					sfEls[i].onmouseover=function() {
						this.className+=" over";
					}
					sfEls[i].onmouseout=function() {
						//for(x=0; x<100000; x++);
						this.className=this.className.replace(new RegExp(" over\\b"), "");
					}
  		   }
}
if (window.attachEvent) window.attachEvent("onload", over);




function pegaData(){
            	hoje = new Date()
             	dia = hoje.getDate()
                dias = hoje.getDay()
                mes = hoje.getMonth()
                ano = hoje.getYear()
                if (dia < 10)
                dia = "0" + dia
                if (ano < 2000)
                ano = "2" + ano -"100"
                function CriaArray (n) {
                this.length = n }
                NomeDia = new CriaArray(7)
                NomeDia[0] = "Domingo"
                NomeDia[1] = "Segunda-feira"
                NomeDia[2] = "Ter&ccedil;a-feira"
                NomeDia[3] = "Quarta-feira"
                NomeDia[4] = "Quinta-feira"
                NomeDia[5] = "Sexta-feira"
                NomeDia[6] = "S&aacute;bado"
                NomeMes = new CriaArray(12)
                NomeMes[0] = "Janeiro"
                NomeMes[1] = "Fevereiro"
                NomeMes[2] = "Mar&ccedil;o"
                NomeMes[3] = "Abril"
                NomeMes[4] = "Maio"
                NomeMes[5] = "Junho"
                NomeMes[6] = "Julho"
                NomeMes[7] = "Agosto"
                NomeMes[8] = "Setembro"
                NomeMes[9] = "Outubro"
                NomeMes[10] = "Novembro"
                NomeMes[11] = "Dezembro"
                function WriteDate() {
                if(MINUTO>9){
                document.write ("Curitiba, " + NomeDia[dias] + ", " + dia + " de " + NomeMes[mes] + " de " + ano+"&nbsp;&nbsp;-&nbsp;&nbsp;"+HORA+":"+MINUTO)
                }else{
                document.write ("Curitiba, " + NomeDia[dias] + ", " + dia + " de " + NomeMes[mes] + " de " + ano+"&nbsp;&nbsp;-&nbsp;&nbsp;"+HORA+":0"+MINUTO)
                }
                }
//hORA
var RELOGIO = new Date();
var HORA = RELOGIO.getHours();
var MINUTO = RELOGIO.getMinutes();
var SEGUNDO = RELOGIO.getSeconds();
WriteDate();
}

function Validar()
{
   if (document.envmensagem.nome.value == "")
   {
      alert("Informe seu nome!");
      return;
   }
   if (document.envmensagem.email.value == "")
   {
      alert("Informe seu email!");
      return;
   }
   if (document.envmensagem.mensagem.value == "")
   {
      alert("O email deve possuir algum conteúdo\npara ser enviado!");
      return;
   }
   document.envmensagem.submit();
}

function MandaEmail(condicao)
{
   if (condicao == true)
   {
      alert ("Mensagem enviada corretamente!","Rádio Cultura Músical");
      document.location.href = ".#tabs-6";
   }
   else
   {
      alert ("A mensagem não foi enviada corretamente.\nPor favor tente novamente!");
      history.back();
   }
}

function criaAnuncioApoiadores(colunas,linhas){
	var qtd = colunas*linhas;
	var resto;
	var j;
	
	for (var i=0; i<qtd; i++) {

		resto = eval(i%colunas);
		if(resto == 0 && i>0){
			document.write ("<br>");		  
		}		
		
		if(i<9){
			j = i+1;	
			document.write ("<img src='./anuncios/apoio/0"+j+".gif' onClick=mostraDadosAnunciantes(); style='cursor:pointer;'>")
		}else{
			j = i+1;
			document.write ("<img src='./anuncios/apoio/"+j+".gif' onClick=mostraDadosAnunciantes(); style='cursor:pointer;'>")
		}		
    }
}

function criaCensura(texto, alinhamento){
		document.write ("<img src='./censura/"+texto+".png' align='"+alinhamento+"'>")

}

//Anuncios de 30 segundos
function criaAnuncioPrincipal(){

p = 0;
numImgs = 3;
p = parseInt(Math.random()*numImgs);

AnuncioPrincipal = new Array();
AnuncioPrincipal[0] = 'anuncios/principal/00.gif';
AnuncioPrincipal[1] = 'anuncios/principal/01.gif';
AnuncioPrincipal[2] = 'anuncios/principal/02.gif';
}

function AnunciosPrincipal() {
document.getElementById('principal').src = AnuncioPrincipal[p];

setTimeout('AnunciosPrincipal()',  30000);
p += 1;
if(p == numImgs) p = 0;
}

function criaAnuncioRadio(){

r = 0;
numImgsRadio = 3;
r = parseInt(Math.random()*numImgsRadio);
AnuncioRadio = new Array();
AnuncioRadio[0] = 'anuncios/radio/00.gif'; 
AnuncioRadio[1] = 'anuncios/radio/01.gif';
AnuncioRadio[2] = 'anuncios/radio/02.gif';
}

function AnunciosRadio() {
document.getElementById('radio').src = AnuncioRadio[r];

setTimeout('AnunciosRadio()',  30000);
r += 1;
if(r == numImgsRadio) r = 0;
}

function criaAnuncioVideo(){

v = 0;
numImgsVideo = 3;
v = parseInt(Math.random()*numImgsVideo);

AnuncioVideo = new Array();
AnuncioVideo[0] = 'anuncios/videos/00.gif';
AnuncioVideo[1] = 'anuncios/videos/01.gif';
AnuncioVideo[2] = 'anuncios/videos/02.gif';
	
}

function AnunciosVideo() {
document.getElementById('video').src = AnuncioVideo[v];

setTimeout('AnunciosVideo()',  30000);
v += 1;
if(v == numImgsVideo) v = 0;
}

function MM_reloadPage(init) {  //carregando o windowms no Nav4 resize
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4))
	{
		document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
		else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
	}
MM_reloadPage(true);


function mostraDadosAnunciantes(){
open("anuncio.html","DefaultWindow","width=500,height=500,toolbar=no,scroll=no,status=no");
}


