//Inicio do Arquivo
function AbreMural()
{
 window.open('./mural/',"Recados","width=800,height=600,scrollbars=yes");	
}
function EditNoticia(id)
{
 window.open("./edit_noticia.php?cod="+ id,"Recados","width=800,height=600,scrollbars=yes");	
}
function EditEntrevista(id)
{
 window.open("./edit_entrevista.php?cod="+ id,"Recados","width=800,height=600,scrollbars=yes");	
}
function AbreComente(tipo, id)
{
 window.open("./comentario.php?tipo="+ tipo +"&cod="+ id,"Comentário","width=600,height=600,scrollbars=yes");	
}
function AbreImg(url)
{
 var altura = document.getElementById('tamanho').offsetHeight;
 var largura = document.getElementById('tamanho').offsetWidth;
 document.getElementById('divFundo').style.height=altura;
 document.getElementById('divFundo').style.width=largura;
 document.getElementById('divFundo').style.visibility='visible';
 document.getElementById('divZoom').style.visibility='visible';
 document.getElementById('divZoom').style.top=document.body.scrollTop +100;
 document.getElementById('imgZoom').src=url;
 window.setTimeout("img()",3000);
}
function img()
{
 if(document.getElementById('divZoom').style.visibility=='visible')
 {
  document.getElementById('imgZoom').style.visibility='visible';
 }
}

function AbreImgOff()
{
 document.getElementById('divFundo').style.height=0;
 document.getElementById('divFundo').style.width=0;	
 document.getElementById('divFundo').style.visibility='hidden';
 document.getElementById('divZoom').style.visibility='hidden';
 document.getElementById('imgZoom').style.visibility='hidden';
}
//Menu Admin
function MostraMenu(id)
{
 	if(document.getElementById(id).style.display == 'none')
 	{
 	document.getElementById(id).style.display = 'block';
 	}else{
 	document.getElementById(id).style.display = 'none';
 	}
}


//Validar o Cpf
function validacpf(){ 
  
 var i; 
  
 s = document.getElementById("cpf").value;
 camp = document.getElementById("cpf");
  
 var c = s.substr(0,9); 
  
 var dv = s.substr(9,2); 
  
 var d1 = 0; 
  
 for (i = 0; i < 9; i++) 
  {   
    d1 += c.charAt(i)*(10-i); 
  } 
  
 if (d1 == 0){ 
    setTimeout("camp.focus()",250);
    camp.value=""; 
    alert("CPF Invalido"); 
    return false; 
 } 
  
 d1 = 11 - (d1 % 11); 
  
 if (d1 > 9) d1 = 0; 
 if (dv.charAt(0) != d1)  
 { 
     setTimeout("camp.focus()",250);
     camp.value="";  
     alert("CPF Invalido"); 
     return false; 
 } 
   
 d1 *= 2; 
  
 for (i = 0; i < 9; i++)  
 {  
     d1 += c.charAt(i)*(11-i); 
 } 
  
 d1 = 11 - (d1 % 11); 
  
 if (d1 > 9) d1 = 0; 
  
 if (dv.charAt(1) != d1) 
 { 
    setTimeout("camp.focus()",250);
    camp.value="";  
    alert("CPF Invalido"); 
    return false; 
} 
  
return true; 
  
} 
