//----------------------------------------- BUNGALLOWS-----------------------------------
function verifica_bungallows_en(){

	if (document.registo.t_nacionalidade.value=="Enter your Nationality"){
		msg= "Have to fill in the field Nationality." ;
		window.alert (msg);
		document.registo.t_nacionalidade.focus(); 
		return false;
	} else if (document.registo.t_nacionalidade.value==""){
		msg= "Have to fill in the field Nationality." + "\n" ;
		window.alert (msg);
		document.registo.t_nacionalidade.focus(); 
		return false;
	}
	
	if (document.registo.t_nome.value=="Enter your name"){
		msg= "Have to fill in the field NAME." ;
		window.alert (msg);
		document.registo.t_nome.focus(); 
		return false;
	} else if (document.registo.t_nome.value==""){
		msg= "Have to fill in the field NAME." + "\n" ;
		window.alert (msg);
		document.registo.t_nome.focus(); 
		return false;
	}
	
	if (isNaN(document.registo.n_contribuinte.value)){
		msg= "Tax File Number field must be numeric." + "\n" ;
		window.alert (msg);
		document.registo.n_contribuinte.focus(); 
		return false;
	}else if (document.registo.n_contribuinte.value=="Enter your Tax File Number"){
		msg= "Have to fill in the field Tax File Number." + "\n" ;
		window.alert (msg);
		document.registo.n_contribuinte.focus(); 
		return false;
	}else if (document.registo.n_contribuinte.value==""){
		msg= "Have to fill in the field Tax File Number." + "\n" ;
		window.alert (msg);
		document.registo.n_contribuinte.focus(); 
		return false;
	}
	
	if (document.registo.t_morada.value=="Enter your Address"){
		msg= "Have to fill in the field Address." ;
		window.alert (msg);
		document.registo.t_morada.focus(); 
		return false;
	} else if (document.registo.t_morada.value==""){
		msg= "Have to fill in the field Address." + "\n" ;
		window.alert (msg);
		document.registo.t_morada.focus(); 
		return false;
	}
	
	if (isNaN(document.registo.n_cp4.value)){
		msg= "ZIP CODE field must be numeric." + "\n" ;
		window.alert (msg);
		document.registo.n_cp4.focus(); 
		return false;
	}else if (document.registo.n_cp4.value=="0000"){
		msg= "Have to fill in the field ZIP CODE." + "\n" ;
		window.alert (msg);
		document.registo.n_cp4.focus(); 
		return false;
	}else if (document.registo.n_cp4.value==""){
		msg= "Have to fill in the field ZIP CODE." + "\n" ;
		window.alert (msg);
		document.registo.n_cp4.focus(); 
		return false;
	}
	
	if (isNaN(document.registo.n_cp3.value)){
		msg= "ZIP CODE field must be numeric." + "\n" ;
		window.alert (msg);
		document.registo.n_cp3.focus(); 
		return false;
	}else if (document.registo.n_cp3.value=="000"){
		msg= "Have to fill in the field ZIP CODE." + "\n" ;
		window.alert (msg);
		document.registo.n_cp3.focus(); 
		return false;
	}else if (document.registo.n_cp3.value==""){
		msg= "Have to fill in the field ZIP CODE." + "\n" ;
		window.alert (msg);
		document.registo.n_cp3.focus(); 
		return false;
	}

	if (document.registo.t_localidade.value=="Enter your Location"){
		msg= "Have to fill in the field Location." ;
		window.alert (msg);
		document.registo.t_localidade.focus(); 
		return false;
	} else if (document.registo.t_localidade.value==""){
		msg= "Have to fill in the field Location." + "\n" ;
		window.alert (msg);
		document.registo.t_localidade.focus(); 
		return false;
	}
	
	if (document.registo.t_telef.value=="Enter your Phone Number"){
		msg= "Have to fill in the field Phone Number." + "\n" ;
		window.alert (msg);
		document.registo.n_telef.focus(); 
		return false;
	}else if (document.registo.t_telef.value==""){
		msg= "Have to fill in the field Phone Number." + "\n" ;
		window.alert (msg);
		document.registo.t_telef.focus(); 
		return false;
	}else if ((document.registo.t_telef.value!=0) && (document.registo.t_telef.value.length<9)){
		msg= "The Phone Number field must have at least nine digits." + "\n" ;
		window.alert (msg);
		document.registo.t_telef.focus(); 
		return false;
	} 
	/*  O formulário só permite o envio caso aceite as condições
	if (document.registo.k_cond.value!="1"){
		msg= "You do not accept the booking conditions?" + "\n" ;
		window.alert (msg);
		document.registo.k_cond.focus(); 
		return false;
	}	*/	
	
	msg= "Your reservation request will be sent and validated." + "\n" ;
	window.alert(msg);	

	return true
}
function verifica_bungallows_pt(){

	if (document.registo.t_nome.value=="Insira o seu nome"){
		msg= "Tem que preencher o campo NOME." ;
		window.alert (msg);
		document.registo.t_nome.focus(); 
		return false;
	} else if (document.registo.t_nome.value==""){
		msg= "Tem que preencher o campo NOME." + "\n" ;
		window.alert (msg);
		document.registo.t_nome.focus(); 
		return false;
	}
	
	if (isNaN(document.registo.n_contribuinte.value)){
		msg= "O campo CONTRIBUINTE tem que ser numérico." + "\n" ;
		window.alert (msg);
		document.registo.n_contribuinte.focus(); 
		return false;
	}else if (document.registo.n_contribuinte.value=="Insira o seu contribuinte"){
		msg= "Tem que preencher o campo CONTRIBUINTE." + "\n" ;
		window.alert (msg);
		document.registo.n_contribuinte.focus(); 
		return false;
	}else if (document.registo.n_contribuinte.value==""){
		msg= "Tem que preencher o campo CONTRIBUINTE." + "\n" ;
		window.alert (msg);
		document.registo.n_contribuinte.focus(); 
		return false;
	}
	
	if (document.registo.t_morada.value=="Insira a sua morada"){
		msg= "Tem que preencher o campo MORADA" ;
		window.alert (msg);
		document.registo.t_morada.focus(); 
		return false;
	} else if (document.registo.t_morada.value==""){
		msg= "Tem que preencher o campo MORADA." + "\n" ;
		window.alert (msg);
		document.registo.t_morada.focus(); 
		return false;
	}
	
	if (isNaN(document.registo.n_cp4.value)){
		msg= "O campo CÓDIGO POSTAL tem que ser numérico." + "\n" ;
		window.alert (msg);
		document.registo.n_cp4.focus(); 
		return false;
	}else if (document.registo.n_cp4.value=="0000"){
		msg= "Tem que preencher o campo CÓDIGO POSTAL." + "\n" ;
		window.alert (msg);
		document.registo.n_cp4.focus(); 
		return false;
	}else if (document.registo.n_cp4.value==""){
		msg= "Tem que preencher o campo CÓDIGO POSTAL." + "\n" ;
		window.alert (msg);
		document.registo.n_cp4.focus(); 
		return false;
	}
	
	if (isNaN(document.registo.n_cp3.value)){
		msg= "O campo CÓDIGO POSTAL tem que ser numérico." + "\n" ;
		window.alert (msg);
		document.registo.n_cp3.focus(); 
		return false;
	}else if (document.registo.n_cp3.value=="000"){
		msg= "Tem que preencher o campo CÓDIGO POSTAL." + "\n" ;
		window.alert (msg);
		document.registo.n_cp3.focus(); 
		return false;
	}else if (document.registo.n_cp3.value==""){
		msg= "Tem que preencher o campo CÓDIGO POSTAL." + "\n" ;
		window.alert (msg);
		document.registo.n_cp3.focus(); 
		return false;
	}

	if (document.registo.t_localidade.value=="Insira a Localidade"){
		msg= "Tem que preencher o campo LOCALIDADE" ;
		window.alert (msg);
		document.registo.t_localidade.focus(); 
		return false;
	} else if (document.registo.t_localidade.value==""){
		msg= "Tem que preencher o campo LOCALIDADE." + "\n" ;
		window.alert (msg);
		document.registo.t_localidade.focus(); 
		return false;
	}
	
	if (document.registo.t_telef.value=="Insira o seu telefone"){
		msg= "Tem que preencher o campo TELEFONE." + "\n" ;
		window.alert (msg);
		document.registo.n_telef.focus(); 
		return false;
	}else if (document.registo.t_telef.value==""){
		msg= "Tem que preencher o campo TELEFONE." + "\n" ;
		window.alert (msg);
		document.registo.t_telef.focus(); 
		return false;
	}else if ((document.registo.t_telef.value!=0) && (document.registo.t_telef.value.length<9)){
		msg= "O campo TELEFONE tem que ter pelo menos 9 dígitos." + "\n" ;
		window.alert (msg);
		document.registo.t_telef.focus(); 
		return false;
	} 
	
	if (document.registo.t_nacionalidade.value=="Insira a sua Nacionalidade"){
		msg= "Tem que preencher o campo Nacionalidade" ;
		window.alert (msg);
		document.registo.t_nacionalidade.focus(); 
		return false;
	} else if (document.registo.t_nacionalidade.value==""){
		msg= "Tem que preencher o campo Nacionalidade." + "\n" ;
		window.alert (msg);
		document.registo.t_nacionalidade.focus(); 
		return false;
	}
	/*  O formulário só permite o envio caso aceite as condições
	if (document.registo.k_cond.value!="1"){
		msg= "Não aceita as condições de reserva?" + "\n" ;
		window.alert (msg);
		document.registo.k_cond.focus(); 
		return false;
	}*/
			
	msg= "O seu pedido de reserva vai ser enviado e validado." + "\n" ;
	window.alert(msg);	

	return true
}

function verifica_bungallows(){

	if (document.registo.t_nome.value=="Insira o seu nome"){
		msg= "Tem que preencher o campo NOME." ;
		window.alert (msg);
		document.registo.t_nome.focus(); 
		return false;
	} else if (document.registo.t_nome.value==""){
		msg= "Tem que preencher o campo NOME." + "\n" ;
		window.alert (msg);
		document.registo.t_nome.focus(); 
		return false;
	}
	
	if (isNaN(document.registo.n_contribuinte.value)){
		msg= "O campo CONTRIBUINTE tem que ser numérico." + "\n" ;
		window.alert (msg);
		document.registo.n_contribuinte.focus(); 
		return false;
	}else if (document.registo.n_contribuinte.value=="Insira o seu contribuinte"){
		msg= "Tem que preencher o campo CONTRIBUINTE." + "\n" ;
		window.alert (msg);
		document.registo.n_contribuinte.focus(); 
		return false;
	}else if (document.registo.n_contribuinte.value==""){
		msg= "Tem que preencher o campo CONTRIBUINTE." + "\n" ;
		window.alert (msg);
		document.registo.n_contribuinte.focus(); 
		return false;
	}
	
	if (document.registo.t_morada.value=="Insira a sua morada"){
		msg= "Tem que preencher o campo MORADA" ;
		window.alert (msg);
		document.registo.t_morada.focus(); 
		return false;
	} else if (document.registo.t_morada.value==""){
		msg= "Tem que preencher o campo MORADA." + "\n" ;
		window.alert (msg);
		document.registo.t_morada.focus(); 
		return false;
	}
	
	if (isNaN(document.registo.n_cp4.value)){
		msg= "O campo CÓDIGO POSTAL tem que ser numérico." + "\n" ;
		window.alert (msg);
		document.registo.n_cp4.focus(); 
		return false;
	}else if (document.registo.n_cp4.value=="0000"){
		msg= "Tem que preencher o campo CÓDIGO POSTAL." + "\n" ;
		window.alert (msg);
		document.registo.n_cp4.focus(); 
		return false;
	}else if (document.registo.n_cp4.value==""){
		msg= "Tem que preencher o campo CÓDIGO POSTAL." + "\n" ;
		window.alert (msg);
		document.registo.n_cp4.focus(); 
		return false;
	}
	
	if (isNaN(document.registo.n_cp3.value)){
		msg= "O campo CÓDIGO POSTAL tem que ser numérico." + "\n" ;
		window.alert (msg);
		document.registo.n_cp3.focus(); 
		return false;
	}else if (document.registo.n_cp3.value=="000"){
		msg= "Tem que preencher o campo CÓDIGO POSTAL." + "\n" ;
		window.alert (msg);
		document.registo.n_cp3.focus(); 
		return false;
	}else if (document.registo.n_cp3.value==""){
		msg= "Tem que preencher o campo CÓDIGO POSTAL." + "\n" ;
		window.alert (msg);
		document.registo.n_cp3.focus(); 
		return false;
	}

	if (document.registo.t_localidade.value=="Insira a Localidade"){
		msg= "Tem que preencher o campo LOCALIDADE" ;
		window.alert (msg);
		document.registo.t_localidade.focus(); 
		return false;
	} else if (document.registo.t_localidade.value==""){
		msg= "Tem que preencher o campo LOCALIDADE." + "\n" ;
		window.alert (msg);
		document.registo.t_localidade.focus(); 
		return false;
	}
	
	if ((document.registo.t_telef.value!=0) && (document.registo.t_telef.value.length<9)){
		msg= "O campo TELEFONE tem que ter pelo menos 9 dígitos." + "\n" ;
		window.alert (msg);
		document.registo.t_telef.focus(); 
		return false;
	}else if (document.registo.t_telef.value=="Insira o seu telefone"){
		msg= "Tem que preencher o campo TELEFONE." + "\n" ;
		window.alert (msg);
		document.registo.n_telef.focus(); 
		return false;
	}else if (document.registo.t_telef.value==""){
		msg= "Tem que preencher o campo TELEFONE." + "\n" ;
		window.alert (msg);
		document.registo.t_telef.focus(); 
		return false;
	}
	/*  O formulário só permite o envio caso aceite as condições
	if (document.registo.k_cond.value!=1){
		msg= "Não aceita as condições de reserva?" + "\n" ;
		window.alert (msg);
		document.registo.k_cond.focus(); 
		return false;
	}*/
	
	
	
	msg= "O seu pedido de reserva vai ser enviado e validado." + "\n" ;
	window.alert(msg);	

	return true
}
//--------------------------------------------------------------------------------------------------------------



function verifica_pw(){
	
	if (document.pw.t_pw.value==""){
		msg= "Tem que preencher o campo Password." + "\n" ;
		window.alert (msg);
		document.pw.t_pw.focus(); 
		return false;
	} else if (document.pw.t_pw.value.length<5){
		msg= "O campo Password tem que ter pelo menos 5 dígitos." + "\n" ;
		window.alert (msg);
		document.pw.t_pw.focus(); 
		return false;
	}
	if (document.pw.t_pw.value!=document.pw.b_pw.value){
		msg= "A Password de confirmação não coincide - ." + "\n" ;
		window.alert (msg);
		document.pw.t_pw.focus(); 
		return false;
	}
	
	return true
}

function verifica_pw_pt(){
	
	if (document.pw.t_pw.value==""){
		msg= "Tem que preencher o campo Password." + "\n" ;
		window.alert (msg);
		document.pw.t_pw.focus(); 
		return false;
	} else if (document.pw.t_pw.value.length<5){
		msg= "O campo Password tem que ter pelo menos 5 dígitos." + "\n" ;
		window.alert (msg);
		document.pw.t_pw.focus(); 
		return false;
	}
	if (document.pw.t_pw.value!=document.pw.b_pw.value){
		msg= "A Password de confirmação não coincide - ." + "\n" ;
		window.alert (msg);
		document.pw.t_pw.focus(); 
		return false;
	}
	
	return true
}
function verifica_pw_en(){
	
	if (document.pw.t_pw.value==""){
		msg= "Must complete the Password field." + "\n" ;
		window.alert (msg);
		document.pw.t_pw.focus(); 
		return false;
	} else if (document.pw.t_pw.value.length<5){
		msg= "The Password field must have at least five digits." + "\n" ;
		window.alert (msg);
		document.pw.t_pw.focus(); 
		return false;
	}
	if (document.pw.t_pw.value!=document.pw.b_pw.value){
		msg= "The password confirmation does not match -." + "\n" ;
		window.alert (msg);
		document.pw.t_pw.focus(); 
		return false;
	}
	
	return true
}

function verifica_login_topo(){
	
	if (document.login_topo.idu.value==""){
		msg= "Tem que preencher o campo IDENTIFICAÇÂO." + "\n" ;
		window.alert (msg);
		document.login_topo.idu.focus(); 
		return false;
	}	
	
	if (document.login_topo.pw.value==""){
		msg= "Tem que preencher o campo PASSWORD." + "\n" ;
		window.alert (msg); 
		document.login_topo.pw.focus(); 
		return false;
	}
	
	return true
}

function verifica_rec_pw(){
	
	if (!(valida_email(document.rec_pw.t_email.value))){
		document.rec_pw.t_email.focus(); 
		return false;
	}	
	
	return true
}
function verifica_rec_pw_pt(){
	
	if (!(valida_email(document.rec_pw.t_email.value))){
		document.rec_pw.t_email.focus(); 
		return false;
	}	
	
	return true
}
function verifica_rec_pw_en(){
	
	if (!(valida_email_en(document.rec_pw.t_email.value))){
		document.rec_pw.t_email.focus(); 
		return false;
	}	
	
	return true
}
function verifica_login_centro(){
	
	if (document.login_centro.idu.value==""){
		msg= "Tem que preencher o campo IDENTIFICAÇÂO." + "\n" ;
		window.alert (msg);
		document.login_centro.idu.focus(); 
		return false;
	}	
	
	if (document.login_centro.pw.value==""){
		msg= "Tem que preencher o campo PASSWORD." + "\n" ;
		window.alert (msg); 
		document.login_centro.pw.focus(); 
		return false;
	}
	
	return true
}

//-------------------------------------	registo ------------------------------------
function verifica_registo(){

	if (document.registo.t_username.value==""){
		msg= "Tem que preencher o campo USERNAME." + "\n" ;
		window.alert (msg);
		document.registo.t_username.focus(); 
		return false;
	} else if (document.registo.t_username.value=="Insira a sua identificação"){
		msg= "Tem que preencher o campo USERNAME." + "\n" ;
		window.alert (msg);
		document.registo.t_username.focus(); 
		return false;
	}else if (document.registo.t_username.value.length<5){
		msg= "O campo USERNAME tem que ter pelo menos 5 dígitos." + "\n" ;
		window.alert (msg);
		document.registo.t_username.focus(); 
		return false;
	}
	
	if (!(valida_email(document.registo.t_email.value))){
		document.registo.t_email.focus(); 
		return false;
	}
	
	if (document.registo.t_alcunha.value=="Insira o seu nick"){
		msg= "Tem que preencher o campo NICK ou apagar a mensagem de" + "\n ajuda que se encontra na caixa." ;
		window.alert (msg);
		document.registo.t_alcunha.focus(); 
		return false;
	}
	
	if (document.registo.t_nome.value=="Insira o seu nome"){
		msg= "Tem que preencher o campo NOME ou apagar a mensagem de" + "\n ajuda que se encontra na caixa." ;
		window.alert (msg);
		document.registo.t_nome.focus(); 
		return false;
	}
	
	if (document.registo.t_apelido.value=="Insira o seu apelido"){
		msg= "Tem que preencher o campo APELIDO ou apagar a mensagem de" + "\n ajuda que se encontra na caixa." ;
		window.alert (msg);
		document.registo.t_apelido.focus(); 
		return false;
	}
	
	if (document.registo.t_telef.value=="Insira o seu telefone"){
		msg= "Tem que preencher o campo TELEFONE ou apagar a mensagem de" + "\n ajuda que se encontra na caixa." ;
		window.alert (msg);
		document.registo.t_telef.focus(); 
		return false;
	}
	
	if (document.registo.t_morada.value=="Insira a sua morada"){
		msg= "Tem que preencher o campo MORADA ou apagar a mensagem de" + "\n ajuda que se encontra na caixa." ;
		window.alert (msg);
		document.registo.t_morada.focus(); 
		return false;
	}
	
	if (document.registo.t_localidade.value=="Insira a Localidade"){
		msg= "Tem que preencher o campo LOCALIDADE ou apagar a mensagem de" + "\n ajuda que se encontra na caixa." ;
		window.alert (msg);
		document.registo.t_localidade.focus(); 
		return false;
	}
	
	var dn=document.registo.d_d_nasc
	if (dn.value=="DD/MM/AAAA"){
		msg= "Tem que preencher o campo DATA DE NASCIMENTO ou apagar a mensagem de" + "\n ajuda que se encontra na caixa." ;
		window.alert (msg);
		dn.focus()
		return false;
	}	
	
	if (document.registo.t_obs.value=="Insira a sua observação"){
		msg= "Tem que preencher o campo OBSERVAÇÃO ou apagar a mensagem de" + "\n ajuda que se encontra na caixa." ;
		window.alert (msg);
		document.registo.t_obs.focus(); 
		return false;
	}
	
	return true
}

function verifica_registo_pt(){

	if (document.registo.t_username.value==""){
		msg= "Tem que preencher o campo Identificação." + "\n" ;
		window.alert (msg);
		document.registo.t_username.focus(); 
		return false;
	} else if (document.registo.t_username.value=="Insira a sua identificação"){
		msg= "Tem que preencher o campo Identificação." + "\n" ;
		window.alert (msg);
		document.registo.t_username.focus(); 
		return false;
	}else if (document.registo.t_username.value.length<5){
		msg= "O campo Identificação tem que ter pelo menos 5 dígitos." + "\n" ;
		window.alert (msg);
		document.registo.t_username.focus(); 
		return false;
	}
	
	if (!(valida_email(document.registo.t_email.value))){
		document.registo.t_email.focus(); 
		return false;
	}
	
	if (document.registo.t_alcunha.value=="Insira o seu nick"){
		msg= "Tem que preencher o campo NICK ou apagar a mensagem de" + "\n ajuda que se encontra na caixa." ;
		window.alert (msg);
		document.registo.t_alcunha.focus(); 
		return false;
	}
	
	if (document.registo.t_nome.value=="Insira o seu nome"){
		msg= "Tem que preencher o campo NOME ou apagar a mensagem de" + "\n ajuda que se encontra na caixa." ;
		window.alert (msg);
		document.registo.t_nome.focus(); 
		return false;
	}
	
	if (document.registo.t_apelido.value=="Insira o seu apelido"){
		msg= "Tem que preencher o campo APELIDO ou apagar a mensagem de" + "\n ajuda que se encontra na caixa." ;
		window.alert (msg);
		document.registo.t_apelido.focus(); 
		return false;
	}
	
	if (document.registo.t_telef.value=="Insira o seu telefone"){
		msg= "Tem que preencher o campo TELEFONE ou apagar a mensagem de" + "\n ajuda que se encontra na caixa." ;
		window.alert (msg);
		document.registo.t_telef.focus(); 
		return false;
	}
	
	if (document.registo.t_morada.value=="Insira a sua morada"){
		msg= "Tem que preencher o campo MORADA ou apagar a mensagem de" + "\n ajuda que se encontra na caixa." ;
		window.alert (msg);
		document.registo.t_morada.focus(); 
		return false;
	}
	
	if (document.registo.t_localidade.value=="Insira a Localidade"){
		msg= "Tem que preencher o campo LOCALIDADE ou apagar a mensagem de" + "\n ajuda que se encontra na caixa." ;
		window.alert (msg);
		document.registo.t_localidade.focus(); 
		return false;
	}
	
	var dn=document.registo.d_d_nasc
	if (dn.value=="DD/MM/AAAA"){
		msg= "Tem que preencher o campo DATA DE NASCIMENTO ou apagar a mensagem de" + "\n ajuda que se encontra na caixa." ;
		window.alert (msg);
		dn.focus()
		return false;
	}	
	
	if (document.registo.t_obs.value=="Insira a sua observação"){
		msg= "Tem que preencher o campo OBSERVAÇÃO ou apagar a mensagem de" + "\n ajuda que se encontra na caixa." ;
		window.alert (msg);
		document.registo.t_obs.focus(); 
		return false;
	}
	
	return true
}

function verifica_registo_en(){

	if (document.registo.t_username.value==""){
		msg= "Have to fill in the Username field." + "\n" ;
		window.alert (msg);
		document.registo.t_username.focus(); 
		return false;
	} else if (document.registo.t_username.value=="Enter your identification"){
		msg= "Have to fill in the Username field." + "\n" ;
		window.alert (msg);
		document.registo.t_username.focus(); 
		return false;
	}else if (document.registo.t_username.value.length<5){
		msg= "The Username field must have at least five digits." + "\n" ;
		window.alert (msg);
		document.registo.t_username.focus(); 
		return false;
	}
	
	if (!(valida_email_en(document.registo.t_email.value))){
		document.registo.t_email.focus(); 
		return false;
	}
	
	if (document.registo.t_alcunha.value=="Enter your nick"){
		msg= "Have to fill in the field NICK or delete the message from" + "\n help that is on the box." ;
		window.alert (msg);
		document.registo.t_alcunha.focus(); 
		return false;		
	}
	
	if (document.registo.t_nome.value=="Enter your name"){
		msg= "Have to fill in the field NAME or delete the message from" + "\n help that is on the box." ;
		window.alert (msg);
		document.registo.t_nome.focus(); 
		return false;
	}
	
	if (document.registo.t_apelido.value=="Enter your surname"){
		msg= "Have to fill in the field SURNAME or delete the message from" + "\n help that is on the box" ;
		window.alert (msg);
		document.registo.t_apelido.focus(); 
		return false;
	}
	
	if (document.registo.t_telef.value=="Enter your Phone Number"){
		msg= "Have to fill in the field Phone Number or delete the message from" + "\n help that is on the box" ;
		window.alert (msg);
		document.registo.t_telef.focus(); 
		return false;
	}
	
	if (document.registo.t_morada.value=="Enter your Address"){
		msg= "Have to fill in the field Address or delete the message from" + "\n help that is on the box" ;
		window.alert (msg);
		document.registo.t_morada.focus(); 
		return false;
	}
	
	if (document.registo.t_localidade.value=="Enter your Location"){
		msg= "Have to fill in the field Location or delete the message from" + "\n help that is on the box" ;
		window.alert (msg);
		document.registo.t_localidade.focus(); 
		return false;
	}
	
	var dn=document.registo.d_d_nasc
	if (dn.value=="DD/MM/AAAA"){
		msg= "Have to fill in the field Date of Birth or delete the message from" + "\n help that is on the box" ;
		window.alert (msg);
		dn.focus()
		return false;
	}	
	
	if (document.registo.t_obs.value=="Enter your comment"){
		msg= "Have to fill in the field Comment or delete the message from" + "\n help that is on the box" ;
		window.alert (msg);
		document.registo.t_obs.focus(); 
		return false;
	}
	
	return true
}
// ------------------------------------------------

function verifica_upd_registo(){


	if (!(valida_email(document.registo.t_email.value))){
		document.registo.t_email.focus(); 
		return false;
	}
	
	return true
}

function verifica_upd_registo_pt(){


	if (!(valida_email(document.registo.t_email.value))){
		document.registo.t_email.focus(); 
		return false;
	}
	
	return true
}
function verifica_upd_registo_en(){


	if (!(valida_email_en(document.registo.t_email.value))){
		document.registo.t_email.focus(); 
		return false;
	}
	
	return true
}

function valida_agenda(){

	if (document.frmAddMessage.t_titulo.value==""){
		msg= "Tem que preencher o campo TÍTULO." + "\n" ;
		window.alert (msg);
		document.frmAddMessage.t_titulo.focus(); 
		return false;
	}
	return true
}

//--------------------------------------- LIVRO VISITAS ---------------------------------------
function verifica_livro(){

	if (document.livro.t_nome.value=="Insira o seu nome"){
		msg= "Tem que preencher o campo Nome." + "\n" ;
		window.alert (msg);
		document.livro.t_nome.focus(); 
		return false;
	} else if (document.livro.t_nome.value==""){
		msg= "Tem que preencher o campo Nome." + "\n" ;
		window.alert (msg);
		document.livro.t_nome.focus(); 
		return false;
	} else if (document.livro.t_nome.value.length<3){
		msg= "O campo Nome tem que ter pelo menos 3 dígitos." + "\n" ;
		window.alert (msg);
		document.livro.t_nome.focus(); 
		return false;
	}		
		
	
	if (document.livro.t_email.value=="")
	{
		msg= "Tem que preencher o campo Email." + "\n" ;
		window.alert (msg);
		document.livro.t_email.focus(); 
		return false;
	}
	else if (document.livro.t_email.value=="Insira o seu e-mail")
	{
		msg= "Tem que preencher o campo Email." + "\n" ;
		window.alert (msg);
		document.livro.t_email.focus(); 
		return false;
	}		

	
	if (document.livro.t_email.value!="")
		{
			if (!(valida_email(document.livro.t_email.value)))
			{
				document.livro.t_email.focus(); 
				return false;
			}
		}
		
	if (document.livro.t_msg.value==""){
		msg= "Tem que introduzir uma Mensagem." + "\n" ;
		window.alert (msg); 
		document.livro.t_msg.focus(); 
		return false;
	} else if (document.livro.t_msg.value=="Insira a sua Mensagem"){
		msg= "Tem que introduzir uma Mensagem." + "\n" ;
		window.alert (msg); 
		document.livro.t_msg.focus(); 
		return false;
	}else if (document.livro.t_msg.value.length>256){
		msg= "O campo MENSAGEM não pode conter mais do que 256 caracteres." + "\n" ;
		window.alert (msg);
		document.livro.t_msg.focus(); 
		return false;	
	}			

	msg= "A sua mensagem vai ser enviada." + "\nIrá ser validada pela administração" + "\ne colocada no livro de visitas." ;
	window.alert(msg);	
	
	return true
}

function verifica_livro_pt(){

	if (document.livro.t_nome.value=="Insira o seu nome"){
		msg= "Tem que preencher o campo Nome." + "\n" ;
		window.alert (msg);
		document.livro.t_nome.focus(); 
		return false;
	} else if (document.livro.t_nome.value==""){
		msg= "Tem que preencher o campo Nome." + "\n" ;
		window.alert (msg);
		document.livro.t_nome.focus(); 
		return false;
	}
	else if (document.livro.t_nome.value.length<3){
		msg= "O campo Nome tem que ter pelo menos 3 dígitos." + "\n" ;
		window.alert (msg);
		document.livro.t_nome.focus(); 
		return false;
	}		
		
	
	if (document.livro.t_email.value=="")
	{
		msg= "Tem que preencher o campo Email." + "\n" ;
		window.alert (msg);
		document.livro.t_email.focus(); 
		return false;
	}else if (document.livro.t_email.value=="Insira o seu e-mail")
	{
		msg= "Tem que preencher o campo Email." + "\n" ;
		window.alert (msg);
		document.livro.t_email.focus(); 
		return false;
	}	
	
	if (document.livro.t_email.value!="")
		{
			if (!(valida_email(document.livro.t_email.value)))
			{
				document.livro.t_email.focus(); 
				return false;
			}
		}
		
	if (document.livro.t_msg.value==""){
		msg= "Tem que introduzir uma Mensagem." + "\n" ;
		window.alert (msg); 
		document.livro.t_msg.focus(); 
		return false;
	} else if (document.livro.t_msg.value=="Insira a sua Mensagem"){
		msg= "Tem que introduzir uma Mensagem." + "\n" ;
		window.alert (msg); 
		document.livro.t_msg.focus(); 
		return false;
	}
	else if (document.livro.t_msg.value.length>256){
		msg= "O campo MENSAGEM não pode conter mais do que 256 caracteres." + "\n" ;
		window.alert (msg);
		document.livro.t_msg.focus(); 
		return false;	
	}			

	msg= "A sua mensagem vai ser enviada." + "\nIrá ser validada pela administração" + "\ne colocada no livro de visitas." ;
	window.alert(msg);	
	
	return true
}

function verifica_livro_en(){

	if (document.livro.t_nome.value=="Enter your name"){
		msg= "Have to fill in the Name field." + "\n" ;
		window.alert (msg);
		document.livro.t_nome.focus(); 
		return false;
	} else if (document.livro.t_nome.value==""){
		msg= "Have to fill in the Name field." + "\n" ;
		window.alert (msg);
		document.livro.t_nome.focus(); 
		return false;
	} else if (document.livro.t_nome.value.length<3){
		msg= "The Name field must have at least three digits." + "\n" ;
		window.alert (msg);
		document.livro.t_nome.focus(); 
		return false;
	}		
		
	
	if (document.livro.t_email.value=="")
	{
		msg= "Have to fill in the Email field." + "\n" ;
		window.alert (msg);
		document.livro.t_email.focus(); 
		return false;
	}else if (document.livro.t_email.value=="Enter your e-mail")
	{
		msg= "Have to fill in the Email field." + "\n" ;
		window.alert (msg);
		document.livro.t_email.focus(); 
		return false;
	}

	
	if (document.livro.t_email.value!="")
		{
			if (!(valida_email(document.livro.t_email.value)))
			{
				document.livro.t_email.focus(); 
				return false;
			}
		}
		
	if (document.livro.t_msg.value==""){
		msg= "You must enter a message." + "\n" ;
		window.alert (msg); 
		document.livro.t_msg.focus(); 
		return false;
	} else if (document.livro.t_msg.value=="Enter your Message"){
		msg= "You must enter a message." + "\n" ;
		window.alert (msg); 
		document.livro.t_msg.focus(); 
		return false;
	}else if (document.livro.t_msg.value.length>256){
		msg= "The MESSAGE field can not contain more than 256 characters." + "\n" ;
		window.alert (msg);
		document.livro.t_msg.focus(); 
		return false;	
	}			

	msg= "Your message will be sent." + "\nIt will be validated by the administration" + "\nand placed on the guestbook." ;
	window.alert(msg);	
	
	return true
}
//------------------------------------------------ NEWSLETTER --------------------------------------
function verifica_newsletter(){

	if (document.mailling.nome.value=="Insira o seu nome"){
		msg= "Tem que preencher o campo Nome." + "\n" ;
		window.alert (msg);
		document.mailling.nome.focus(); 
		return false;
	} else if (document.mailling.nome.value==""){
		msg= "Tem que preencher o campo Nome." + "\n" ;
		window.alert (msg);
		document.mailling.nome.focus(); 
		return false;
	} 	else if (document.mailling.nome.value.length<3){
		msg= "O campo Nome tem que ter pelo menos 3 dígitos." + "\n" ;
		window.alert (msg);
		document.mailling.nome.focus(); 
		return false;	
	}
	
	if (document.mailling.email.value=="Insira o seu e-mail"){
		msg= "Tem que preencher o campo Email." + "\n" ;
		window.alert (msg);
		document.mailling.email.focus(); 
		return false;
	} else if (document.mailling.email.value==""){
		msg= "Tem que preencher o campo Email." + "\n" ;
		window.alert (msg);
		document.mailling.email.focus(); 
		return false;		
	}
	
	if (document.mailling.email.value!="")
		{
			if (!(valida_email(document.mailling.email.value)))
			{
				document.mailling.email.focus(); 
				return false;
			}
		}
	
	return true
}
function verifica_newsletter_pt(){

	if (document.mailling.nome.value=="Insira o seu nome"){
		msg= "Tem que preencher o campo Nome." + "\n" ;
		window.alert (msg);
		document.mailling.nome.focus(); 
		return false;
	} else if (document.mailling.nome.value==""){
		msg= "Tem que preencher o campo Nome." + "\n" ;
		window.alert (msg);
		document.mailling.nome.focus(); 
		return false;
	} 	else if (document.mailling.nome.value.length<3){
		msg= "O campo Nome tem que ter pelo menos 3 dígitos." + "\n" ;
		window.alert (msg);
		document.mailling.nome.focus(); 
		return false;	
	}
	
	if (document.mailling.email.value=="Insira o seu e-mail"){
		msg= "Tem que preencher o campo Email." + "\n" ;
		window.alert (msg);
		document.mailling.email.focus(); 
		return false;
	} else if (document.mailling.email.value==""){
		msg= "Tem que preencher o campo Email." + "\n" ;
		window.alert (msg);
		document.mailling.email.focus(); 
		return false;		
	}
	
	if (document.mailling.email.value!="")
		{
			if (!(valida_email(document.mailling.email.value)))
			{
				document.mailling.email.focus(); 
				return false;
			}
		}
	
	return true
}
function verifica_newsletter_en(){

	if (document.mailling.nome.value=="Enter your name"){
		msg= "Have to fill in the Name field." + "\n" ;
		window.alert (msg);
		document.mailling.nome.focus(); 
		return false;
	} else if (document.mailling.nome.value==""){
		msg= "Have to fill in the Name field." + "\n" ;
		window.alert (msg);
		document.mailling.nome.focus(); 
		return false;
	} 	else if (document.mailling.nome.value.length<3){
		msg= "The Name field must have at least three digits." + "\n" ;
		window.alert (msg);
		document.mailling.nome.focus(); 
		return false;	
	}
	
	if (document.mailling.email.value=="Enter your e-mail"){
		msg= "Have to fill in the Email field." + "\n" ;
		window.alert (msg);
		document.mailling.email.focus(); 
		return false;
	} else if (document.mailling.email.value==""){
		msg= "Have to fill in the Email field." + "\n" ;
		window.alert (msg);
		document.mailling.email.focus(); 
		return false;		
	}
	
	if (document.mailling.email.value!="")
		{
			if (!(valida_email(document.mailling.email.value)))
			{
				document.mailling.email.focus(); 
				return false;
			}
		}
	
	return true
}

//--------------------------- RECLAMAÇÕES/SUGESTÕES --------------------------------------------

function verifica_reclama(){

	if (document.reclama.t_nome.value=="Insira o seu nome"){
		msg= "Tem que preencher o campo NOME" ;
		window.alert (msg);
		document.reclama.t_nome.focus(); 
		return false;
	} else if (document.reclama.t_nome.value==""){
		msg= "Tem que preencher o campo NOME." + "\n" ;
		window.alert (msg);
		document.reclama.t_nome.focus(); 
		return false;
	}
	
	if (!(valida_email(document.reclama.t_email.value))){
		document.reclama.t_email.focus(); 
		return false;
	}
	
	if (document.reclama.t_assunto.value=="Insira o assunto"){
		msg= "Tem que preencher o campo ASSUNTO" ;
		window.alert (msg);
		document.reclama.t_assunto.focus(); 
		return false;
	}else if (document.reclama.t_assunto.value==""){
		msg= "Tem que preencher o campo ASSUNTO" + "\n" ;
		window.alert (msg);
		document.reclama.t_assunto.focus(); 
		return false;
	}
	
	if (document.reclama.t_descr.value=="Insira a descrição do assunto"){
		msg= "Tem que preencher o campo DESCRIÇÃO" ;
		window.alert (msg);
		document.reclama.t_descr.focus(); 
		return false;
	}else if (document.reclama.t_descr.value==""){
		msg= "Tem que preencher o campo DESCRIÇÃO" + "\n" ;
		window.alert (msg);
		document.reclama.t_descr.focus(); 
		return false;
	}
	
	return true
}

function verifica_reclama_pt(){

	if (document.reclama.t_nome.value=="Insira o seu nome"){
		msg= "Tem que preencher o campo NOME" ;
		window.alert (msg);
		document.reclama.t_nome.focus(); 
		return false;
	} else if (document.reclama.t_nome.value==""){
		msg= "Tem que preencher o campo NOME." + "\n" ;
		window.alert (msg);
		document.reclama.t_nome.focus(); 
		return false;
	}
	
	if (!(valida_email(document.reclama.t_email.value))){
		document.reclama.t_email.focus(); 
		return false;
	}else if (document.reclama.t_email.value=="Insira o seu email"){
		msg= "Tem que preencher o campo EMAIL." ;
		window.alert (msg);
		document.reclama.t_email.focus(); 
		return false;
	} else if (document.reclama.t_email.value==""){
		msg= "Tem que preencher o campo EMAIL." + "\n" ;
		window.alert (msg);
		document.reclama.t_email.focus(); 
		return false;
	}
	
	if (document.reclama.t_assunto.value=="Insira o assunto"){
		msg= "Tem que preencher o campo ASSUNTO" ;
		window.alert (msg);
		document.reclama.t_assunto.focus(); 
		return false;
	}else if (document.reclama.t_assunto.value==""){
		msg= "Tem que preencher o campo ASSUNTO" + "\n" ;
		window.alert (msg);
		document.reclama.t_assunto.focus(); 
		return false;
	}
	
	if (document.reclama.t_descr.value=="Insira a descrição do assunto"){
		msg= "Tem que preencher o campo DESCRIÇÃO" ;
		window.alert (msg);
		document.reclama.t_descr.focus(); 
		return false;
	}else if (document.reclama.t_descr.value==""){
		msg= "Tem que preencher o campo DESCRIÇÃO" + "\n" ;
		window.alert (msg);
		document.reclama.t_descr.focus(); 
		return false;
	}
	
	msg= "A sua sugestão vai ser enviada. Obrigado." + "\n" ;
	window.alert(msg);	
	return true
}

function verifica_reclama_en(){

	if (document.reclama.t_nome.value=="Enter your name"){
		msg= "Have to fill in the field NAME." ;
		window.alert (msg);
		document.reclama.t_nome.focus(); 
		return false;
	} else if (document.reclama.t_nome.value==""){
		msg= "Have to fill in the field NAME." + "\n" ;
		window.alert (msg);
		document.reclama.t_nome.focus(); 
		return false;
	}
	
	if (!(valida_email_en(document.reclama.t_email.value))){
		document.reclama.t_email.focus(); 
		return false;
	}else if (document.reclama.t_email.value=="Enter your email"){
		msg= "Have to fill in the field EMAIL." ;
		window.alert (msg);
		document.reclama.t_email.focus(); 
		return false;
	} else if (document.reclama.t_email.value==""){
		msg= "Have to fill in the field EMAIL." + "\n" ;
		window.alert (msg);
		document.reclama.t_email.focus(); 
		return false;
	}
	
	if (document.reclama.t_assunto.value=="Enter the subject"){
		msg= "Have to fill in the field SUBJECT." ;
		window.alert (msg);
		document.reclama.t_assunto.focus(); 
		return false;
	}else if (document.reclama.t_assunto.value==""){
		msg= "Have to fill in the field SUBJECT." + "\n" ;
		window.alert (msg);
		document.reclama.t_assunto.focus(); 
		return false;
	}
	
	if (document.reclama.t_descr.value=="Enter a description of the subject"){
		msg= "Have to fill in the field DESCRIPTION." ;
		window.alert (msg);
		document.reclama.t_descr.focus(); 
		return false;
	}else if (document.reclama.t_descr.value==""){
		msg= "Have to fill in the field DESCRIPTION." + "\n" ;
		window.alert (msg);
		document.reclama.t_descr.focus(); 
		return false;
	}
	
	msg= "Your suggestion will be sent. Thank you." + "\n" ;
	window.alert(msg);	
	return true
}
//--------------------------------- LEITURAS ONLINE -----------------------------------------

function verifica_leituras(){

	if (isNaN(document.leituras.n_cod_rua.value)){
		msg= "O campo ARRUAMENTO tem que ser numérico." + "\n" ;
		window.alert (msg);
		document.leituras.n_cod_rua.focus(); 
		return false;
	}else if (document.leituras.n_cod_rua.value=="Insira o Código do Arruamento"){
		msg= "Tem que preencher o campo ARRUAMENTO." + "\n" ;
		window.alert (msg);
		document.leituras.n_cod_rua.focus(); 
		return false;
	}else if (document.leituras.n_cod_rua.value==""){
		msg= "Tem que preencher o campo ARRUAMENTO." + "\n" ;
		window.alert (msg);
		document.leituras.n_cod_rua.focus(); 
		return false;
	}
	
	if (document.leituras.t_nome.value=="Insira o Nome do Titular"){
		msg= "Tem que preencher o campo NOME" ;
		window.alert (msg);
		document.leituras.t_nome.focus(); 
		return false;
	} else if (document.leituras.t_nome.value==""){
		msg= "Tem que preencher o campo NOME." + "\n" ;
		window.alert (msg);
		document.leituras.t_nome.focus(); 
		return false;
	}
	
	if (isNaN(document.leituras.n_nif.value)){
		msg= "O campo CONTRIBUINTE tem que ser numérico." + "\n" ;
		window.alert (msg);
		document.leituras.n_nif.focus(); 
		return false;
	}else if (document.leituras.n_nif.value=="Insira o Contribuinte do Titular"){
		msg= "Tem que preencher o campo CONTRIBUINTE." + "\n" ;
		window.alert (msg);
		document.leituras.n_nif.focus(); 
		return false;
	}else if (document.leituras.n_nif.value==""){
		msg= "Tem que preencher o campo CONTRIBUINTE." + "\n" ;
		window.alert (msg);
		document.leituras.n_nif.focus(); 
		return false;
	}
	
	if (document.leituras.n_leitura.value=="Insira a Leitura"){
		msg= "Tem que preencher o campo LEITURA." + "\n" ;
		window.alert (msg);
		document.leituras.n_leitura.focus(); 
		return false;
	}else if (isNaN(document.leituras.n_leitura.value)){
		msg= "O campo LEITURA tem que ser numérico." + "\n" ;
		window.alert (msg);
		document.leituras.n_leitura.focus(); 
		return false;
	}else if (document.leituras.n_leitura.value==""){
		msg= "Tem que preencher o campo LEITURA." + "\n" ;
		window.alert (msg);
		document.leituras.n_leitura.focus(); 
		return false;
	}
		 
	if (isNaN(document.leituras.n_telef.value)){
		msg= "O campo TELEFONE tem que ser numérico." + "\n" ;
		window.alert (msg);
		document.leituras.n_telef.focus(); 
		return false;
	} else if ((document.leituras.n_telef.value!=0) && (document.leituras.n_telef.value.length<9)){
		msg= "O campo TELEFONE tem que ter pelo menos 9 dígitos." + "\n" ;
		window.alert (msg);
		document.leituras.n_telef.focus(); 
		return false;
	}else if (document.leituras.n_telef.value=="Insira o Número do Telefone"){
		msg= "Tem que preencher o campo TELEFONE." + "\n" ;
		window.alert (msg);
		document.leituras.n_telef.focus(); 
		return false;
	}else if (document.leituras.n_telef.value==""){
		msg= "Tem que preencher o campo TELEFONE." + "\n" ;
		window.alert (msg);
		document.leituras.n_telef.focus(); 
		return false;
	}
	
	msg= "A sua leitura vai ser enviada." + "\n" ;
	window.alert(msg);	

	return true
}

function verifica_leituras_en(){

	if (isNaN(document.leituras.n_cod_rua.value)){
		msg= "The field STREET must be numeric." + "\n" ;
		window.alert (msg);
		document.leituras.n_cod_rua.focus(); 
		return false;
	}else if (document.leituras.n_cod_rua.value=="Enter the Street Code"){
		msg= "Have to fill in the STREET field." + "\n" ;
		window.alert (msg);
		document.leituras.n_cod_rua.focus(); 
		return false;
	}else if (document.leituras.n_cod_rua.value==""){
		msg= "Have to fill in the STREET field." + "\n" ;
		window.alert (msg);
		document.leituras.n_cod_rua.focus(); 
		return false;
	}
	
	if (document.leituras.t_nome.value=="Enter Owner's name"){
		msg= "Have to fill in the NAME field." ;
		window.alert (msg);
		document.leituras.t_nome.focus(); 
		return false;
	} else if (document.leituras.t_nome.value==""){
		msg= "Have to fill in the NAME field." + "\n" ;
		window.alert (msg);
		document.leituras.t_nome.focus(); 
		return false;
	}
	
	if (isNaN(document.leituras.n_nif.value)){
		msg= "The field Taxpayer's number must be numeric." + "\n" ;
		window.alert (msg);
		document.leituras.n_nif.focus(); 
		return false;
	}else if (document.leituras.n_nif.value=="Enter the Taxpayer's number"){
		msg= "Have to fill in the Taxpayer's number field." + "\n" ;
		window.alert (msg);
		document.leituras.n_nif.focus(); 
		return false;
	}else if (document.leituras.n_nif.value==""){
		msg= "Have to fill in the Taxpayer's number field." + "\n" ;
		window.alert (msg);
		document.leituras.n_nif.focus(); 
		return false;
	}
	
	if (document.leituras.n_leitura.value=="Enter the Reading Measure"){
		msg= "Have to fill in the Reading Measure field." + "\n" ;
		window.alert (msg);
		document.leituras.n_leitura.focus(); 
		return false;
	}else if (isNaN(document.leituras.n_leitura.value)){
		msg= "The field Reading Measure must be numeric." + "\n" ;
		window.alert (msg);
		document.leituras.n_leitura.focus(); 
		return false;
	}else if (document.leituras.n_leitura.value==""){
		msg= "Have to fill in the Reading Measure field." + "\n" ;
		window.alert (msg);
		document.leituras.n_leitura.focus(); 
		return false;
	}
		 
	if (isNaN(document.leituras.n_telef.value)){
		msg= "The field Phone Number must be numeric." + "\n" ;
		window.alert (msg);
		document.leituras.n_telef.focus(); 
		return false;
	} else if ((document.leituras.n_telef.value!=0) && (document.leituras.n_telef.value.length<9)){
		msg= "The field Phone Number must have at least 9 digits." + "\n" ;
		window.alert (msg);
		document.leituras.n_telef.focus(); 
		return false;
	}else if (document.leituras.n_telef.value=="Insira o Número do Telefone"){
		msg= "Have to fill in the Phone Number field." + "\n" ;
		window.alert (msg);
		document.leituras.n_telef.focus(); 
		return false;
	}else if (document.leituras.n_telef.value==""){
		msg= "Have to fill in the Phone Number field." + "\n" ;
		window.alert (msg);
		document.leituras.n_telef.focus(); 
		return false;
	}
	
	msg= "Your reading will be sent." + "\n" ;
	window.alert(msg);	

	return true
}

function verifica_leituras_pt(){

	if (isNaN(document.leituras.n_cod_rua.value)){
		msg= "O campo ARRUAMENTO tem que ser numérico." + "\n" ;
		window.alert (msg);
		document.leituras.n_cod_rua.focus(); 
		return false;
	}else if (document.leituras.n_cod_rua.value=="Insira o Código do Arruamento"){
		msg= "Tem que preencher o campo ARRUAMENTO." + "\n" ;
		window.alert (msg);
		document.leituras.n_cod_rua.focus(); 
		return false;
	}else if (document.leituras.n_cod_rua.value==""){
		msg= "Tem que preencher o campo ARRUAMENTO." + "\n" ;
		window.alert (msg);
		document.leituras.n_cod_rua.focus(); 
		return false;
	}
	
	if (document.leituras.t_nome.value=="Insira o Nome do Titular"){
		msg= "Tem que preencher o campo NOME" ;
		window.alert (msg);
		document.leituras.t_nome.focus(); 
		return false;
	} else if (document.leituras.t_nome.value==""){
		msg= "Tem que preencher o campo NOME." + "\n" ;
		window.alert (msg);
		document.leituras.t_nome.focus(); 
		return false;
	}
	
	if (isNaN(document.leituras.n_nif.value)){
		msg= "O campo CONTRIBUINTE tem que ser numérico." + "\n" ;
		window.alert (msg);
		document.leituras.n_nif.focus(); 
		return false;
	}else if (document.leituras.n_nif.value=="Insira o Contribuinte do Titular"){
		msg= "Tem que preencher o campo CONTRIBUINTE." + "\n" ;
		window.alert (msg);
		document.leituras.n_nif.focus(); 
		return false;
	}else if (document.leituras.n_nif.value==""){
		msg= "Tem que preencher o campo CONTRIBUINTE." + "\n" ;
		window.alert (msg);
		document.leituras.n_nif.focus(); 
		return false;
	}
	
	if (document.leituras.n_leitura.value=="Insira a Leitura"){
		msg= "Tem que preencher o campo LEITURA." + "\n" ;
		window.alert (msg);
		document.leituras.n_leitura.focus(); 
		return false;
	}else if (isNaN(document.leituras.n_leitura.value)){
		msg= "O campo LEITURA tem que ser numérico." + "\n" ;
		window.alert (msg);
		document.leituras.n_leitura.focus(); 
		return false;
	}else if (document.leituras.n_leitura.value==""){
		msg= "Tem que preencher o campo LEITURA." + "\n" ;
		window.alert (msg);
		document.leituras.n_leitura.focus(); 
		return false;
	}
		 
	if (isNaN(document.leituras.n_telef.value)){
		msg= "O campo TELEFONE tem que ser numérico." + "\n" ;
		window.alert (msg);
		document.leituras.n_telef.focus(); 
		return false;
	} else if ((document.leituras.n_telef.value!=0) && (document.leituras.n_telef.value.length<9)){
		msg= "O campo TELEFONE tem que ter pelo menos 9 dígitos." + "\n" ;
		window.alert (msg);
		document.leituras.n_telef.focus(); 
		return false;
	}else if (document.leituras.n_telef.value=="Insira o Número do Telefone"){
		msg= "Tem que preencher o campo TELEFONE." + "\n" ;
		window.alert (msg);
		document.leituras.n_telef.focus(); 
		return false;
	}else if (document.leituras.n_telef.value==""){
		msg= "Tem que preencher o campo TELEFONE." + "\n" ;
		window.alert (msg);
		document.leituras.n_telef.focus(); 
		return false;
	}
	
	msg= "A sua leitura vai ser enviada." + "\n" ;
	window.alert(msg);	

	return true
}


//-------------------------------------------- Orçamento Participativo ---------------------------------------
function verifica_op(){

	if (document.orc_participativo.t_nome.value=="Insira o seu Nome"){
		msg= "Tem que preencher o campo NOME" ;
		window.alert (msg);
		document.orc_participativo.t_nome.focus(); 
		return false;
	} else if (document.orc_participativo.t_nome.value==""){
		msg= "Tem que preencher o campo NOME." + "\n" ;
		window.alert (msg);
		document.orc_participativo.t_nome.focus(); 
		return false;
	}
	

	if (document.orc_participativo.n_moradaorc.value=="Insira a sua Morada"){
		msg= "Tem que preencher o campo MORADA." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_moradaorc.focus(); 
		return false;
	}else if (document.orc_participativo.n_moradaorc.value==""){
		msg= "Tem que preencher o campo MORADA." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_moradaorc.focus(); 
		return false;
	}
	
	if (isNaN(document.orc_participativo.n_cod1.value)){
		msg= "O campo CÓDIGO POSTAL tem que ser numérico." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_cod1.focus(); 
		return false;
	}else if (document.orc_participativo.n_cod1.value=="0000"){
		msg= "Tem que preencher o campo CÓDIGO POSTAL." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_cod1.focus(); 
		return false;
	}else if (document.orc_participativo.n_cod1.value==""){
		msg= "Tem que preencher o campo CÓDIGO POSTAL." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_cod1.focus(); 
		return false;
	}else if (document.orc_participativo.n_cod1.value.length<4){
		msg= "O campo CÓDIGO POSTAL tem que ter pelo menos 4 dígitos." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_cod1.focus(); 
		return false;		
	}
	
	
	if (isNaN(document.orc_participativo.n_cod2.value)){
		msg= "O campo CÓDIGO POSTAL tem que ser numérico." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_cod2.focus(); 
		return false;	
	}else if (document.orc_participativo.n_cod2.value==""){
		msg= "Tem que preencher o campo CÓDIGO POSTAL." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_cod2.focus(); 
		return false;
	}
	
		 
	if (document.orc_participativo.n_localidade.value=="Insira a sua Localidade"){
		msg= "Tem que preencher o campo LOCALIDADE." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_localidade.focus(); 
		return false;
	}else if (document.orc_participativo.n_localidade.value==""){
		msg= "Tem que preencher o campo LOCALIDADE." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_localidade.focus(); 
		return false;
	}		
	
	if (isNaN(document.orc_participativo.n_telefone.value)){
		msg= "O campo TELEFONE tem que ser numérico." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_telefone.focus(); 
		return false;
	} else if ((document.orc_participativo.n_telefone.value!=0) && (document.orc_participativo.n_telefone.value.length<9)){
		msg= "O campo TELEFONE tem que ter pelo menos 9 dígitos." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_telefone.focus(); 
		return false;
	}else if (document.orc_participativo.n_telefone.value=="Insira o Telefone"){
		msg= "Tem que preencher o campo TELEFONE." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_telefone.focus(); 
		return false;
	}else if (document.orc_participativo.n_telefone.value==""){
		msg= "Tem que preencher o campo TELEFONE." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_telefone.focus(); 
		return false;
	}
	
	if (!(valida_email(document.orc_participativo.t_email.value))){
		document.orc_participativo.t_email.focus(); 
		return false;
	}
	
	if (isNaN(document.orc_participativo.n_nif.value)){
		msg= "O campo NIF tem que ser numérico." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_nif.focus(); 
		return false;
	}else if (document.orc_participativo.n_nif.value=="Insira o seu NIF"){
		msg= "Tem que preencher o NIF." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_nif.focus(); 
		return false;
	}else if (document.orc_participativo.n_nif.value==""){
		msg= "Tem que preencher o campo NIF." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_nif.focus(); 
		return false;
	}


	msg= "A sua proposta vai ser enviada." + "\n" ;
	window.alert(msg);	

	return true
}

function verifica_op_pt(){

	if (document.orc_participativo.t_nome.value=="Insira o seu Nome"){
		msg= "Tem que preencher o campo NOME" ;
		window.alert (msg);
		document.orc_participativo.t_nome.focus(); 
		return false;
	} else if (document.orc_participativo.t_nome.value==""){
		msg= "Tem que preencher o campo NOME." + "\n" ;
		window.alert (msg);
		document.orc_participativo.t_nome.focus(); 
		return false;
	}	

	if (document.orc_participativo.n_moradaorc.value=="Insira a sua Morada"){
		msg= "Tem que preencher o campo MORADA." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_moradaorc.focus(); 
		return false;
	}else if (document.orc_participativo.n_moradaorc.value==""){
		msg= "Tem que preencher o campo MORADA." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_moradaorc.focus(); 
		return false;
	}
	
	if (isNaN(document.orc_participativo.n_cod1.value)){
		msg= "O campo CÓDIGO POSTAL tem que ser numérico." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_cod1.focus(); 
		return false;
	}else if (document.orc_participativo.n_cod1.value=="0000"){
		msg= "Tem que preencher o campo CÓDIGO POSTAL." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_cod1.focus(); 
		return false;
	}else if (document.orc_participativo.n_cod1.value==""){
		msg= "Tem que preencher o campo CÓDIGO POSTAL." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_cod1.focus(); 
		return false;
	}else if (document.orc_participativo.n_cod1.value.length<4){
		msg= "O campo CÓDIGO POSTAL tem que ter pelo menos 4 dígitos." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_cod1.focus(); 
		return false;		
	}
	
	
	if (isNaN(document.orc_participativo.n_cod2.value)){
		msg= "O campo CÓDIGO POSTAL tem que ser numérico." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_cod2.focus(); 
		return false;	
	}else if (document.orc_participativo.n_cod2.value==""){
		msg= "Tem que preencher o campo CÓDIGO POSTAL." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_cod2.focus(); 
		return false;
	}
	
		 
	if (document.orc_participativo.n_localidade.value=="Insira a sua Localidade"){
		msg= "Tem que preencher o campo LOCALIDADE." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_localidade.focus(); 
		return false;
	}else if (document.orc_participativo.n_localidade.value==""){
		msg= "Tem que preencher o campo LOCALIDADE." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_localidade.focus(); 
		return false;
	}		
	
	if (document.orc_participativo.n_telefone.value=="Insira o Telefone"){
		msg= "Tem que preencher o campo TELEFONE." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_telefone.focus(); 
		return false;
	}else if (document.orc_participativo.n_telefone.value==""){
		msg= "Tem que preencher o campo TELEFONE." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_telefone.focus(); 
		return false;
	}else if (isNaN(document.orc_participativo.n_telefone.value)){
		msg= "O campo TELEFONE tem que ser numérico." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_telefone.focus(); 
		return false;
	} else if ((document.orc_participativo.n_telefone.value!=0) && (document.orc_participativo.n_telefone.value.length<9)){
		msg= "O campo TELEFONE tem que ter pelo menos 9 dígitos." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_telefone.focus(); 
		return false;
	} 
	
	if (!(valida_email(document.orc_participativo.t_email.value))){
		document.orc_participativo.t_email.focus(); 
		return false;
	}
	
	 if (document.orc_participativo.n_nif.value=="Insira o seu NIF"){
		msg= "Tem que preencher o NIF." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_nif.focus(); 
		return false;
	}else if (document.orc_participativo.n_nif.value==""){
		msg= "Tem que preencher o campo NIF." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_nif.focus(); 
		return false;
	}else if (isNaN(document.orc_participativo.n_nif.value)){
		msg= "O campo NIF tem que ser numérico." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_nif.focus(); 
		return false;
	}
	
	msg= "A sua proposta vai ser enviada." + "\n" ;
	window.alert(msg);	

	return true
}

function verifica_op_en(){

	if (document.orc_participativo.t_nome.value=="Enter your Name"){
		msg= "You need to fill in the field NAME." + "\n" ;
		window.alert (msg);
		document.orc_participativo.t_nome.focus(); 
		return false;
	} else if (document.orc_participativo.t_nome.value==""){
		msg= "You need to fill in the field NAME." + "\n" ;
		window.alert (msg);
		document.orc_participativo.t_nome.focus(); 
		return false;
	} 

	if (document.orc_participativo.n_moradaorc.value=="Enter your address"){
		msg= "You need to fill in the field Address." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_moradaorc.focus(); 
		return false;
	}else if (document.orc_participativo.n_moradaorc.value==""){
		msg= "You need to fill in the field Address." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_moradaorc.focus(); 
		return false;
	}
	
	if (isNaN(document.orc_participativo.n_cod1.value)){
		msg= "The ZIP Code field must be numeric." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_cod1.focus(); 
		return false;
	}else if (document.orc_participativo.n_cod1.value=="0000"){
		msg= "You need to fill in the field ZIP Code." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_cod1.focus(); 
		return false;
	}else if (document.orc_participativo.n_cod1.value==""){
		msg= "You need to fill in the field ZIP Code." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_cod1.focus(); 
		return false;
	}else if (document.orc_participativo.n_cod1.value.length<4){
		msg= "The ZIP Code field must have at least four digits." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_cod1.focus(); 
		return false;		
	}
	
	
	if (isNaN(document.orc_participativo.n_cod2.value)){
		msg= "The ZIP Code field must be numeric." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_cod2.focus(); 
		return false;	
	}else if (document.orc_participativo.n_cod2.value==""){
		msg= "You need to fill in the field ZIP Code." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_cod2.focus(); 
		return false;
	}
	
		 
	if (document.orc_participativo.n_localidade.value=="Enter your Location"){
		msg= "You need to fill in the field Location." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_localidade.focus(); 
		return false;
	}else if (document.orc_participativo.n_localidade.value==""){
		msg= "You need to fill in the field Location." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_localidade.focus(); 
		return false;
	}		
	
	if (document.orc_participativo.n_telefone.value=="Enter your Phone number"){
		msg= "You need to fill in the Phone Number field." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_telefone.focus(); 
		return false;
	}else if (document.orc_participativo.n_telefone.value==""){
		msg= "You need to fill in the Phone Number field." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_telefone.focus(); 
		return false;
	}else if (isNaN(document.orc_participativo.n_telefone.value)){
		msg= "The Phone Number field must be numeric." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_telefone.focus(); 
		return false;
	} else if ((document.orc_participativo.n_telefone.value!=0) && (document.orc_participativo.n_telefone.value.length<9)){
		msg= "The Phone Number field must have at least nine digits." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_telefone.focus(); 
		return false;
	} 
	
	if (!(valida_email_en(document.orc_participativo.t_email.value))){
		document.orc_participativo.t_email.focus(); 
		return false;
	}
	
	if (document.orc_participativo.n_nif.value=="Enter your Fiscal Number"){
		msg= "You need to fill in the Fiscal Number field." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_nif.focus(); 
		return false;
	}else if (document.orc_participativo.n_nif.value==""){
		msg= "You need to fill in the Fiscal Number field." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_nif.focus(); 
		return false;
	}else if (isNaN(document.orc_participativo.n_nif.value)){
		msg= "The Fiscal Number field must be numeric." + "\n" ;
		window.alert (msg);
		document.orc_participativo.n_nif.focus(); 
		return false;
	} 
			
	msg= "Your proposal will be sent." + "\n" ;
	window.alert(msg);	

	return true
}

//----------------------------------------------------------------------------------------------------------------------

function valida_email(email)
{
	//var result = /^.+\@.+\..+$/ ;
	var result = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;


	if ((email == null) || (email.length == 0)) {
       	if (valida_email.arguments.length == 1) {
       		alert("Tem que preencher um E-Mail válido.");
       		return false ;
       	} else {
       		if (!(valida_email.arguments[1] == true)) {
       			alert("Tem que preencher um E-Mail válido.");
       		}
       		return (valida_email.arguments[1] == true);
       	}
    } else {
		if (!(result.test(email))) {
			alert("Tem que preencher um E-Mail válido.");
		}
       return result.test(email);
    }
}

function valida_email_en(email)
{
	//var result = /^.+\@.+\..+$/ ;
	var result = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;

	if ((email == null) || (email.length == 0)) {
       	if (valida_email_en.arguments.length == 1) {
       		alert("Have to enter a valid E-Mail.");
       		return false ;
       	} else {
       		if (!(valida_email_en.arguments[1] == true)) {
       			alert("Have to enter a valid E-Mail.");
       		}
       		return (valida_email_en.arguments[1] == true);
       	}
    } else {
		if (!(result.test(email))) {
			alert("Have to enter a valid E-Mail.");
		}
       return result.test(email);
    }
}

var ns6=document.getElementById&&!document.all

function restrictinput(maxlength,e,placeholder){
if (window.event&&event.srcElement.value.length>=maxlength)
return false
else if (e.target&&e.target==eval(placeholder)&&e.target.value.length>=maxlength){
var pressedkey=/[a-zA-Z0-9\.\,\/]/ //detect alphanumeric keys
if (pressedkey.test(String.fromCharCode(e.which)))
e.stopPropagation()
}
}

function countlimit(maxlength,e,placeholder){
var theform=eval(placeholder)
var lengthleft=maxlength-theform.value.length
var placeholderobj=document.all? document.all[placeholder] : document.getElementById(placeholder)
if (window.event||e.target&&e.target==eval(placeholder)){
if (lengthleft<0)
theform.value=theform.value.substring(0,maxlength)
placeholderobj.innerHTML=lengthleft
}
}

function displaylimit(theform,thelimit){
var limit_text='Pode introduzir <b><span id="'+theform.toString()+'">'+thelimit+'</span></b> caracteres.'
if (document.all||ns6)
document.write(limit_text)
if (document.all){
eval(theform).onkeypress=function(){ return restrictinput(thelimit,event,theform)}
eval(theform).onkeyup=function(){ countlimit(thelimit,event,theform)}
}
else if (ns6){
document.body.addEventListener('keypress', function(event) { restrictinput(thelimit,event,theform) }, true); 
document.body.addEventListener('keyup', function(event) { countlimit(thelimit,event,theform) }, true); 
}
}

function displaylimit_en(theform,thelimit){
var limit_text='You can enter <b><span id="'+theform.toString()+'">'+thelimit+'</span></b> characters.'
if (document.all||ns6)
document.write(limit_text)
if (document.all){
eval(theform).onkeypress=function(){ return restrictinput(thelimit,event,theform)}
eval(theform).onkeyup=function(){ countlimit(thelimit,event,theform)}
}
else if (ns6){
document.body.addEventListener('keypress', function(event) { restrictinput(thelimit,event,theform) }, true); 
document.body.addEventListener('keyup', function(event) { countlimit(thelimit,event,theform) }, true); 
}
}


