<!--
function soNumeros(str){
return caracteresInvalidos(str,"0123456789");
}

function caracteresInvalidos(str,charset){
var result = true;
for (var i=0;i<str.length;i++)
if (charset.indexOf(str.substr(i,1))<0){
result = false;break;}
return result;
}

function validaContacto() {
var nome=document.consulta.nome.value
var assunto=document.consulta.assunto.value
var correio=document.consulta.correio.value
var mensagem=document.consulta.mensagem.value

var temp=""
var temp1=""
var temp2=""
var temp3=""

for (i=0; i<= nome.length; i++)
{
if (nome.substring(i,i-1)==" ")
{temp=temp}
else
{temp=temp+nome.substring(i,i-1)}
}

if ((temp=="")||(temp.length<5)) {
alert("Por favor escreva o seu nome e apelido (mínimo 5 caracteres).\nPlease insert your first and last name (5 characters minimum).");
document.consulta.nome.focus();
return false
}

for (i=0; i<= correio.length; i++)
{
if (correio.substring(i,i-1)==" ")
{temp2=temp2}
else
{temp2=temp2+correio.substring(i,i-1)}
}

if ((temp2.indexOf("@")<2)||(temp2.lastIndexOf(".")-temp2.indexOf("@")<3)||(temp2.substring(temp2.lastIndexOf(".")+1,temp2.length).length<2)||(temp2.substring(temp2.lastIndexOf(".")+1,temp2.length).length>4)) {
alert("Por favor escreva um endereço de correio electrónico válido.\nPlease insert a valid email address.");
document.consulta.correio.focus();
return false
}

for (i=0; i<= assunto.length; i++)
{
if (assunto.substring(i,i-1)==" ")
{temp1=temp1}
else
{temp1=temp1+assunto.substring(i,i-1)}
}

if ((temp1=="")||(temp1.length<3)) {
alert("Por favor escreva o assunto.\nPlease insert the message subject.");
document.consulta.assunto.focus();
return false
}

for (i=0; i<= mensagem.length; i++)
{
if (mensagem.substring(i,i-1)==" ")
{temp3=temp3}
else
{temp3=temp3+mensagem.substring(i,i-1)}
}

if ((temp3=="")||(temp3.length<10)) {
alert("Por favor escreva a sua mensagem (mínimo 10 caracteres).\nPlease insert the message body (10 characters minimum).");
document.consulta.mensagem.focus();
return false
}

return true
}






function validaNewsletter() {
var nome=document.consulta.nome.value
var correio=document.consulta.correio.value

var temp=""
var temp2=""

for (i=0; i<= nome.length; i++)
{
if (nome.substring(i,i-1)==" ")
{temp=temp}
else
{temp=temp+nome.substring(i,i-1)}
}

if ((temp=="")||(temp.length<5)) {
alert("Por favor escreva o seu nome e apelido (mínimo 5 caracteres).\nPlease insert your first and last name (5 characters minimum).");
document.consulta.nome.focus();
return false
}

for (i=0; i<= correio.length; i++)
{
if (correio.substring(i,i-1)==" ")
{temp2=temp2}
else
{temp2=temp2+correio.substring(i,i-1)}
}

if ((temp2.indexOf("@")<2)||(temp2.lastIndexOf(".")-temp2.indexOf("@")<3)||(temp2.substring(temp2.lastIndexOf(".")+1,temp2.length).length<2)||(temp2.substring(temp2.lastIndexOf(".")+1,temp2.length).length>4)) {
alert("Por favor escreva um endereço de correio electrónico válido.\nPlease insert a valid email address.");
document.consulta.correio.focus();
return false
}

return true
}





function validaEnviarPagina() {
var nome=document.consulta.nome.value
var correio=document.consulta.correio.value
var nomeDestinatario=document.consulta.nomeDestinatario.value
var correioDestinatario=document.consulta.correioDestinatario.value

var temp=""
var temp1=""
var temp2=""
var temp3=""

for (i=0; i<= nome.length; i++)
{
if (nome.substring(i,i-1)==" ")
{temp=temp}
else
{temp=temp+nome.substring(i,i-1)}
}

if ((temp=="")||(temp.length<5)) {
alert("Por favor escreva o seu nome e apelido (mínimo 5 caracteres).\nPlease insert your first and last name (5 characters minimum).");
document.consulta.nome.focus();
return false
}

for (i=0; i<= correio.length; i++)
{
if (correio.substring(i,i-1)==" ")
{temp2=temp2}
else
{temp2=temp2+correio.substring(i,i-1)}
}

if ((temp2.indexOf("@")<2)||(temp2.lastIndexOf(".")-temp2.indexOf("@")<3)||(temp2.substring(temp2.lastIndexOf(".")+1,temp2.length).length<2)||(temp2.substring(temp2.lastIndexOf(".")+1,temp2.length).length>4)) {
alert("Por favor escreva um endereço de correio electrónico válido.\nPlease insert a valid email address.");
document.consulta.correio.focus();
return false
}

for (i=0; i<= nomeDestinatario.length; i++)
{
if (nomeDestinatario.substring(i,i-1)==" ")
{temp1=temp1}
else
{temp1=temp1+nomeDestinatario.substring(i,i-1)}
}

if ((temp1=="")||(temp1.length<5)) {
alert("Por favor escreva o nome e apelido do destinatário (mínimo 5 caracteres).\nPlease insert the recipients first and last name (5 characters minimum).");
document.consulta.nomeDestinatario.focus();
return false
}

for (i=0; i<= correioDestinatario.length; i++)
{
if (correioDestinatario.substring(i,i-1)==" ")
{temp3=temp3}
else
{temp3=temp3+correioDestinatario.substring(i,i-1)}
}

if ((temp3.indexOf("@")<2)||(temp3.lastIndexOf(".")-temp3.indexOf("@")<3)||(temp3.substring(temp3.lastIndexOf(".")+1,temp3.length).length<2)||(temp3.substring(temp3.lastIndexOf(".")+1,temp3.length).length>4)) {
alert("Por favor escreva um endereço de correio electrónico válido.\nPlease insert a valid email address.");
document.consulta.correioDestinatario.focus();
return false
}

return true
}

//-->