// trata a resposta do servidor
function trataDados()
{
 var resposta = ajax.responseText;
 var saida = document.getElementById("homeleitor");
 saida.innerHTML = resposta;
}

function trataDados1()
{
 var resposta = ajax.responseText;
 var saida = document.getElementById("homecomentario");
 saida.innerHTML = resposta;
}

function trataDados2()
{
 var resposta = ajax.responseText;
 var saida = document.getElementById("centro");
 saida.innerHTML = resposta;
}

function trataDados3()
{
 var resposta = ajax.responseText;
 var saida = document.getElementById("areaenquete");
 saida.innerHTML = resposta;
}

function twist( sid )
{
 imgobj = document.getElementById( "img_"+sid );
 divobj = document.getElementById( sid );
 if ( imgobj.src.match( "img/up.gif" ) )
 {
  imgobj.src = "img/down.gif";
  divobj.style.visibility = "visible";
  divobj.style.display = "inline";
 }
 else
 {
  imgobj.src = "img/up.gif";
  divobj.style.visibility = "hidden";
  divobj.style.display = "none";
 }
}

function alteraVisibilidade()
{
 cam = document.getElementById('c1');
 if(cam.style.display=='inline')
 {
  cam.style.display='none';
 }
 else
 {
  cam.style.display='inline';
 }
}

function registroleitor()
{
 imgobj2 = document.getElementById( "sinal" );
 if ( imgobj2.src.match( "img/positivo.png" ) )
 {
  imgobj2.src = "img/negativo.png";
 }
 else
 {
  imgobj2.src = "img/positivo.png";
 }

 cam = document.getElementById('registro');
 if(cam.style.display=='inline')
 {
  cam.style.display='none';
 }
 else
 {
  cam.style.display='inline';
 }
}

function comentarioleitor( sid3 )
{
 cam = document.getElementById( "coment_"+sid3 );
 if(cam.style.display=='inline')
  cam.style.display='none';
 else
  cam.style.display='inline';
}

var janela
function AbreJanela(janarq,jantit,janparam)
{
 janela=window.open(janarq,jantit,janparam)
}

function goToUrl(selObj, goToLocation)
{
 eval("document.location.href = '" + goToLocation + "&pagina=" + selObj.options[selObj.selectedIndex].value + "'");
}

function verify(nomeform)
{
   var themessage = "Você não escolheu nenhuma das opções disponíveis.";
   var aei = 0;
   for (var i = 0; i <= nomeform.opcao.length; i++)
   {
       var abc = nomeform.opcao[i].checked;
	   if(abc)
	   {
        aei = aei + 1;
	   }
	   else
	   {
        aei = aei + 0;
	   }

       if( i == (nomeform.opcao.length-1) )
	   {
		if( aei == 0 )
		{
		 alert(themessage);
         return false;
		}
	   }
   }
}

