function popup(link,larg,alt)
{
	winleft = (screen.width-larg)/2;
	wintop  = (screen.height-alt)/2;
	showing = window.open(link,'','width='+ larg +',height='+ alt +',resizable=no,scrollbars=yes');
	showing.window.moveTo(winleft,wintop);
	showing.focus();
}

function escrevePopup(content,larg,alt)
{
	winleft = (screen.width-larg)/2;
	wintop  = (screen.height-alt)/2;
 	top.consoleRef=window.open('','','width='+ larg +',height='+ alt +',resizable=no,scrollbars=yes');
 	top.consoleRef.document.writeln
 	(
		'<html><head><title>Console</title></head>'
		+'<body bgcolor=white onLoad="self.focus()">'
		+content
		+'</body></html>'
	)
	top.consoleRef.window.moveTo(winleft,wintop);
	top.consoleRef.focus();
 	top.consoleRef.document.close();
}

function popup2(endereco,larg,alt)
{
     winleft = (screen.width-larg)/2;
     wintop  = (screen.height-alt)/2;
     showing = window.open(endereco,'Pesquisa','width='+ larg +',height='+ alt +',resizable=no,scrollbars=yes');
     showing.window.moveTo(winleft,wintop);
     showing.focus();
}


arrSemana = new Array("Domingo","Segunda Feira","Terça Feira","Quarta Feira","Quinta Feira","Sexta Feira","Sábado");
arrMes = new Array("janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro");
function data() {
hoje = new Date();
dia = hoje.getDate(); if (dia==1) dia+="&ordm";
diaSem = arrSemana[hoje.getDay()];
mes = arrMes[hoje.getMonth()];
ano = hoje.getYear();
if (ano<1900) ano+=1900;
hora = hoje.getHours(); if (hora.toString().length<2) hora = "0"+hora;
mins = hoje.getMinutes(); if (mins.toString().length<2) mins = "0"+mins;
document.write(diaSem +", "+ dia +" de "+ mes +" de "+ ano +" - "+ hora +"h"+ mins);
}


function dataDeclara()
{
	var d = new Date()
	var h = d.getHours()
	var retornadata= "";

	if (h < 12 && h > 1 )
	{
		retornadata= "Bom dia";
	}
	else if (h < 18)
	{
		retornadata= "Boa tarde";
	}
	else if (h < 23)
	{
		return "Boa noite";
	}
	else
	{
		retornadata =  "Boa madrugada";
	}
	document.write(retornadata+", ");
}
function quiz_verif(questao)
{
	var msg_certa = "Parabéns, resposta certa!.";
	var msg_errada = "Resposta incorreta!, tente novamente.";
	if(questao == "questao_1")
	{
		if(document.quiz.questao_1[1].checked)
		{ alert(msg_certa); }
		else
		{ alert(msg_errada);}
	}
	else if(questao == "questao_2")
	{
		if(document.quiz.questao_2[0].checked)
		{ alert(msg_certa); }
		else
		{ alert(msg_errada);}
	}
	else if(questao == "questao_3")
	{
		if(document.quiz.questao_3[1].checked)
		{ alert(msg_certa); }
		else
		{ alert(msg_errada);}
	}
	else if(questao == "questao_4")
	{
		if(document.quiz.questao_4[3].checked)
		{ alert(msg_certa); }
		else
		{ alert(msg_errada);}
	}
	else if(questao == "questao_5")
	{
		if(document.quiz.questao_5[0].checked)
		{ alert(msg_certa); }
		else
		{ alert(msg_errada);}
	}
	else if(questao == "questao_6")
	{
		if(document.quiz.questao_6[3].checked)
		{ alert(msg_certa); }
		else
		{ alert(msg_errada);}
	}
	else if(questao == "questao_7")
	{
		if(document.quiz.questao_7[4].checked)
		{ alert(msg_certa); }
		else
		{ alert(msg_errada);}
	}
	else if(questao == "questao_8")
	{
		if(document.quiz.questao_8[1].checked)
		{ alert(msg_certa); }
		else
		{ alert(msg_errada);}
	}
	else if(questao == "questao_9")
	{
		if(document.quiz.questao_9[1].checked)
		{ alert(msg_certa); }
		else
		{ alert(msg_errada);}
	}
	else if(questao == "questao_10")
	{
		if(document.quiz.questao_10[1].checked)
		{ alert(msg_certa); }
		else
		{ alert(msg_errada);}
	}
	else if(questao == "questao_11")
	{
		if(document.quiz.questao_11[3].checked)
		{ alert(msg_certa); }
		else
		{ alert(msg_errada);}
	}
	else if(questao == "questao_12")
	{
		if(document.quiz.questao_12[1].checked)
		{ alert(msg_certa); }
		else
		{ alert(msg_errada);}
	}
	else if(questao == "questao_13")
	{
		if(document.quiz.questao_13[3].checked)
		{ alert(msg_certa); }
		else
		{ alert(msg_errada);}
	}
	else if(questao == "questao_14")
	{
		if(document.quiz.questao_14[3].checked)
		{ alert(msg_certa); }
		else
		{ alert(msg_errada);}
	}
	else if(questao == "questao_15")
	{
		if(document.quiz.questao_15[4].checked)
		{ alert(msg_certa); }
		else
		{ alert(msg_errada);}
	}
	else if(questao == "questao_16")
	{
		if(document.quiz.questao_16[0].checked)
		{ alert(msg_certa); }
		else
		{ alert(msg_errada);}
	}
	else if(questao == "questao_17")
	{
		if(document.quiz.questao_17[2].checked)
		{ alert(msg_certa); }
		else
		{ alert(msg_errada);}
	}	
	else if(questao == "questao_18")
	{
		if(document.quiz.questao_18[0].checked)
		{ alert(msg_certa); }
		else
		{ alert(msg_errada);}
	}
	else if(questao == "questao_19")
	{
		if(document.quiz.questao_19[3].checked)
		{ alert(msg_certa); }
		else
		{ alert(msg_errada);}
	}
	else if(questao == "questao_20")
	{
		if(document.quiz.questao_20[1].checked)
		{ alert(msg_certa); }
		else
		{ alert(msg_errada);}
	}
	else if(questao == "questao_21")
	{
		if(document.quiz.questao_21[4].checked)
		{ alert(msg_certa); }
		else
		{ alert(msg_errada);}
	}								
return false;
}
function fotos(content,larg,alt)
{
	winleft = (screen.width-larg)/2;
	wintop  = (screen.height-alt)/2;
 	top.consoleRef=window.open('','','width='+ larg +',height='+ alt +',resizable=no,scrollbars=yes');
 	top.consoleRef.document.writeln
 	(
		'<html><head><title>Sistema Nervoso</title></head>'
		+'<body bgcolor="#0E596B" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="self.focus()" scroll="no"><a href=javascript:self.close() title="fechar"><img src='+content+' border="no"></a></body></html>'
	)
	top.consoleRef.window.moveTo(winleft,wintop);
	top.consoleRef.focus();
 	top.consoleRef.document.close();
}
function popnobar(url,wid,hei) {
	var temp="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=0,resizable=no,menubar=no,width="+wid+",height="+hei;
	window.open(url,'pop_up',temp);
}
