/****************************************************************
SCRIPT PARA VALIDAR AS FORMS DAS PAGINAS
NUNO COSTA 2004
******************************************************************/
<!--
function CheckTabuForm () {
	
	if (document.frmtabu.tabu.value==""){
		alert("Insere o título");
		document.frmtabu.tabu.focus();
		return false;
	}
	
	if (document.frmtabu.desc.value==""){
	alert("Insere a descrição");
	document.frmtabu.desc.focus();
	return false;
	}	
	return true;
}
//-->
<!--
function CheckCrendicesForm () {
	
	if (document.frmcrendices.titulo.value==""){
		alert("Insere o título");
		document.frmcrendices.titulo.focus();
		return false;
	}
	
	if (document.frmcrendices.desc.value==""){
	alert("Insere a descrição");
	document.frmcrendices.desc.focus();
	return false;
	}	
	return true;
}
//-->
<!--
function CheckContoForm () {
	
	if (document.frmconto.titulo.value==""){
		alert("Insere o título");
		document.frmconto.titulo.focus();
		return false;
	}
	
	if (document.frmconto.conto.value==""){
	alert("Insere o conto");
	document.frmconto.conto.focus();
	return false;
	}	
	return true;
}
//-->
<!--
function CheckCadeiraForm () {
	
	if (document.frmcadeira.nome.value==""){
		alert("Insere o nome do personagem");
		document.frmcadeira.nome.focus();
		return false;
	}
	
	if (document.frmcadeira.desc.value==""){
	alert("Insere uma descrição");
	document.frmcadeira.desc.focus();
	return false;
	}	
	return true;
}
//-->
<!--
function CheckUplForm () {
	
	if (document.Form1.File1.value==""){
		alert("Insere a imagem");
		document.Form1.File1.focus();
		return false;
	}
		
	return true;
}
//-->
<!--
function CheckFormConteudos() {
	
	if (document.frmconteudos.biografia.value==""){
		alert("Insere o descrição para a Biografia");
		document.frmconteudos.biografia.focus();
		return false;
	}
	
	if (document.frmconteudos.editorial.value==""){
		alert("Insere a descrição para o Editorial");
		document.frmconteudos.editorial.focus();
		return false;
	}
	
	if (document.frmconteudos.bibliografia.value==""){
		alert("Insere a descrição a Bibliografia");
		document.frmconteudos.bibliografia.focus();
		return false;
	}
	
	if (document.frmconteudos.tabus.value==""){
		alert("Insere a descrição para os Tabus");
		document.frmconteudos.tabus.focus();
		return false;
	}
	
	if (document.frmconteudos.cadeira.value==""){
		alert("Insere a descrição para a Cadeira Inclinada");
		document.frmconteudos.cadeira.focus();
		return false;
	}
			
	return true;
}
//-->
<!--
function CheckLinkForm () {
	
	if (document.frmlink.url.value=="HTTP://"){
		alert("Insere o endereço");
		document.frmlink.url.focus();
		return false;
	}
	
	if (document.frmlink.url_desc.value==""){
		alert("Insere a descrição");
		document.frmlink.url_desc.focus();
		return false;
	}
		
	return true;
}
//-->
<!--
function CheckLoginForm () {
	
	if (document.formlogin.userlogin.value==""){
		alert("Insere o nome do utilizador");
		document.formlogin.userlogin.focus();
		return false;
	}
	
	if (document.formlogin.passlogin.value==""){
		alert("Insere a password");
		document.formlogin.passlogin.focus();
		return false;
	}
		
	return true;
}
//-->
<!--
function AddCadeiraCode(code,promptText, InsertText) {

	if (code != "") {
		insertCode = prompt(promptText + "\n[" + code + "]xxx[/" + code + "]", InsertText);
			if ((insertCode != null) && (insertCode != "")){
				document.frmSignCadeira.comments.value += "[" + code + "]" + insertCode + "[/"+ code + "] ";
			}
	}		
	document.frmSignCadeira.comments.focus();
}
//-->
<!--
function AddCadeiraSmileyIcon(iconCode) {	
		document.frmSignCadeira.comments.value += iconCode + " ";
		document.frmSignCadeira.comments.focus();
}
//-->
<!--
function CheckFormCadeira () {

	var errorMsg = "";
	var errorMsgLong = "";


	if (document.frmSignCadeira.name.value == ""){
		errorMsg += "\n\tNome \t\t- Digite o seu nome";
	}
	

	if (document.frmSignCadeira.comments.value == ""){
		errorMsg += "\n\tComentário \t- Insira o seu comentário";
	}
	
	
	if (document.frmSignCadeira.comments.value.length >= 150){
		errorMsgLong += "\n- O seu comentário tem " + document.frmSignCadeira.comments.value.length + " caracteres, o máximo permitido é 150.";
	}	
	
		
	for (var count = 0; count <= 7; ++count){
		if ((document.frmSignCadeira.elements[count].value.indexOf("<", 0) >= 0) && (document.frmSignCadeira.elements[count].value.indexOf(">", 0) >= 0)){
			errorMsgLong += "\n- TAGS HTML não são permitidas.";
		}			
	}
	
	if ((errorMsg != "") || (errorMsgLong != "")){
		msg = "___________________________________________________________________\n\n";
		msg += "Campos obrigatórios:\n";
		
		errorMsg += alert(msg + errorMsg + "\n" + errorMsgLong);
		return false;
	}
	
	return true;
}
//-->

<!--
function CheckFormguestbook () {

	var errorMsg = "";
	var errorMsgLong = "";


	if (document.frmSignGuestbook.name.value == ""){
		errorMsg += "\n\tNome \t\t- Digite o seu nome";
	}
	

	if (document.frmSignGuestbook.country.value == ""){
		errorMsg += "\n\tPaís \t\t- Escolha o seu país";
	}
	

	if (document.frmSignGuestbook.comments.value == ""){
		errorMsg += "\n\tComentário \t- Insira o seu comentário";
	}
	
	
	if (document.frmSignGuestbook.comments.value.length >= 150){
		errorMsgLong += "\n- O seu comentário tem " + document.frmSignGuestbook.comments.value.length + " caracteres, o máximo permitido é 150.";
	}	
	
		
	for (var count = 0; count <= 7; ++count){
		if ((document.frmSignGuestbook.elements[count].value.indexOf("<", 0) >= 0) && (document.frmSignGuestbook.elements[count].value.indexOf(">", 0) >= 0)){
			errorMsgLong += "\n- TAGS HTML não são permitidas.";
		}			
	}
	
	if ((errorMsg != "") || (errorMsgLong != "")){
		msg = "___________________________________________________________________\n\n";
		msg += "Campos obrigatórios:\n";
		
		errorMsg += alert(msg + errorMsg + "\n" + errorMsgLong);
		return false;
	}
	
	return true;
}
//-->
<!--
function AddMessageCode(code,promptText, InsertText) {

	if (code != "") {
		insertCode = prompt(promptText + "\n[" + code + "]xxx[/" + code + "]", InsertText);
			if ((insertCode != null) && (insertCode != "")){
				document.frmSignGuestbook.comments.value += "[" + code + "]" + insertCode + "[/"+ code + "] ";
			}
	}		
	document.frmSignGuestbook.comments.focus();
}
//-->
<!--
function AddSmileyIcon(iconCode) {	
		document.frmSignGuestbook.comments.value += iconCode + " ";
		document.frmSignGuestbook.comments.focus();
}
//-->
<!--
function CheckPollForm () {
	
	if (document.frmNewWeeklyPoll.Question.value==""){
		alert("Insere uma questão");
		document.frmNewWeeklyPoll.Question.focus();
		return false;
	}
	
	if (document.frmNewWeeklyPoll.choice1.value==""){
		alert("Insere a opcção 1");
		document.frmNewWeeklyPoll.choice1.focus();
		return false;
	}
	
	if (document.frmNewWeeklyPoll.choice2.value==""){
		alert("Insere a opcção 2");
		document.frmNewWeeklyPoll.choice2.focus();
		return false;
	}
		
	return true;
}
//-->

//DATA


        hoje = new Date()


        dia = hoje.getDate()


        dias = hoje.getDay()


        mes = hoje.getMonth()


        ano = hoje.getYear()


        if (dia < 10)


                dia = "0" + dia


        if (ano < 2000)


                ano = "19" + ano


        function CriaArray (n) {


        this.length = n }


        NomeDia = new CriaArray(7)


        NomeDia[0] = "Domingo"


        NomeDia[1] = "Segunda-feira"


        NomeDia[2] = "Ter&ccedil;a-feira"


        NomeDia[3] = "Quarta-feira"


        NomeDia[4] = "Quinta-feira"


        NomeDia[5] = "Sexta-feira"


        NomeDia[6] = "S&aacute;bado"


 
        NomeMes = new CriaArray(12)


        NomeMes[0] = "Janeiro"


        NomeMes[1] = "Fevereiro"


        NomeMes[2] = "Março"


        NomeMes[3] = "Abril"


        NomeMes[4] = "Maio"


        NomeMes[5] = "Junho"


        NomeMes[6] = "Julho"


        NomeMes[7] = "Agosto"


        NomeMes[8] = "Setembro"


        NomeMes[9] = "Outubro"


        NomeMes[10] = "Novembro"


        NomeMes[11] = "Dezembro"





function WriteDate() {

        document.write (NomeDia[dias] + ", " + dia + " de " + NomeMes[mes] + " de " + ano)
}

//FIM DA DATA
