var amostra_atual;
var total_perguntas;

function esconder(qtd){
	total_perguntas = qtd;
	for (x=1;x<=qtd ; x++){
			document.getElementById('resp'+x).style.display = 'none';
	}
}
function estilos(qtd){
	for (x=1;x<=qtd ;x++){
		document.getElementById('quest'+x).className = "resp_fechada";
	}
}

function abre(resp, perg){
	esconder(total_perguntas);
	estilos(total_perguntas);
	if(amostra_atual != perg){
	document.getElementById(resp).style.display = '';
	document.getElementById(perg).className = "resp_aberta";
	amostra_atual=perg;
	}else{
	amostra_atual=null;
	}
	
}

function doClear(theText) {
     if (theText.value == theText.defaultValue) {
         theText.value = ""
     }
 }
 function doBackClear(theText) {
     if (theText.value == "") {
         theText.value = theText.defaultValue
     }
 }
 
 function voltar() 
{
	history.go(-1);
}

function imprimir() 
{
	window.print();
}

function abrirpopup( pagina, largura, altura)
{
	window.open(pagina,"","scrollbars=yes, resizable=no, width="+ largura +", height="+ altura);
}
