// JavaScript Document
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  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 MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

	function abrefoto(img,cod){
		window.open ("image.php?cod="+cod+"&img="+img,"foto","height=540,width=760,left=1,top=1,noresizable,noscrollbars")
	}
	
	function sintonizarTV(){
		window.open ("comosintonizar.php","sintonizarTV","height=426,width=800,left=1,top=1,noresizable,noscrollbars")
	}	
	
	function sintonizarRadio(){
		window.open ("comosintonizarradio.php","sintonizarRadio","height=474,width=778,left=1,top=1,noresizable,noscrollbars")
	}	
	
	function abreplayer(){
		window.open ("radioplayer.php","player","height=560,width=800,left=1,top=1,noresizable,noscrollbars")
	}
	
	function abreplayerextra(){
		window.open ("player/player.htm","playere","height=580,width=778,left=1,top=1,noresizable,noscrollbars")
	}		
	

	function abrecomentarios(cod){
		window.open ("comentarios.php?cod="+cod,"comentario","height=500,width=650,left=1,top=1,noresizable,scrollbars")
	}

	function abrecomentar(cod){
		window.open ("comentar.php?cod="+cod,"comentario","height=500,width=650,left=1,top=1,noresizable,scrollbars")
	}


function jPopup(pag,acao){
if(acao==1){
acao='block';
}else{
acao='none';
}
document.getElementById("jPopup").style.display  = acao;
document.getElementById("fPopup").src  = pag;
}


var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i
function checkmail(e){
var returnval=emailfilter.test(e.value)
if (returnval==false){
alert("Favor preencher com um e-mail válido")
e.select()
}
return returnval
}


function enviaRecado(){
var f = document.formRecado;
var retorno = true;
retorno = checkmail(f.email);

if(f.nome.value == ''){
alert('Favor preencher o campo Nome');
f.nome.select();
retorno = false;
}
if(f.recado.value == ''){
alert('Favor preencher o campo Recado');
f.recado.select();
retorno = false;
}

return retorno;

}

function enviaContato(){
var f = document.formcontato;
var retorno = true;
retorno = checkmail(f.email);

if(f.nome.value == ''){
alert('Favor preencher o campo Nome');
f.nome.select();
retorno = false;
}
if(f.mensagem.value == ''){
alert('Favor preencher o campo Recado');
f.recado.select();
retorno = false;
}
if(retorno){
f.submit();
}

}




function ajusteJanela(largura,altura){
parent.document.getElementById("fPopup").width  = largura;
parent.document.getElementById("fPopup").height = altura;
parent.document.getElementById("iPopup").style.top = '10px';
parent.document.getElementById("iPopup").style.left = '50%';
parent.document.getElementById("iPopup").style.marginLeft = '-'+(largura/2)+'px';
}

function fechaJanela(){
parent.document.getElementById("fPopup").src  = '';
parent.document.getElementById("jPopup").style.display = 'none';
}