// textarea counter on adverts form function textCounter(field, countfield) { {countfield.value = field.value.length;} } function Validate_FrmReports() { if (document.FrmReports.lstPeriod.selectedIndex == 0) { alert("Por favor, indique um valor para o campo \"Periodo\"."); document.FrmReports.lstPeriod.focus(); return (false); } if (document.FrmReports.lstYear.selectedIndex == 0) { alert("Por favor, indique um valor para o campo\"Ano\"."); document.FrmReports.lstYear.focus(); return (false); } document.FrmReports.hdnyear.value=document.FrmReports.lstYear.value; document.FrmReports.hdnperiod.value=document.FrmReports.lstPeriod.value; return (true); } function Validate_FrmPersonal() { if (document.FrmPersonal.lstPerson1.selectedIndex == 0) { alert("Por favor, indique um valor para o campo \"Personalidade\"."); document.FrmPersonal.lstPerson1.focus(); return (false); } if (document.FrmPersonal.lstPhilos1.selectedIndex == 0) { alert("Por favor, indique um valor para o campo \"Filosofia\"."); document.FrmPersonal.lstPhilos1.focus(); return (false); } if (document.FrmPersonal.lstSocial1.selectedIndex == 0) { alert("Por favor, indique um valor para o campo \"Grupo Social\"."); document.FrmPersonal.lstSocial1.focus(); return (false); } if (document.FrmPersonal.lstGoal1.selectedIndex == 0) { alert("Por favor, indique um valor para o campo \"Objectivos\"."); document.FrmPersonal.lstGoal1.focus(); return (false); } if (document.FrmPersonal.lstHobby1.selectedIndex == 0) { alert("Por favor, indique um valor para o campo \"Hobbies\"."); document.FrmPersonal.lstHobby1.focus(); return (false); } if (document.FrmPersonal.lstSport1.selectedIndex == 0) { alert("Por favor, indique um valor para o campo \"Desportos\" field."); document.FrmPersonal.lstSport1.focus(); return (false); } if (document.FrmPersonal.lstMusic1.selectedIndex == 0) { alert("Por favor, indique um valor para o campo \"Música\"."); document.FrmPersonal.lstMusic1.focus(); return (false); } if (document.FrmPersonal.lstFood1.selectedIndex == 0) { alert("Por favor, indique um valor para o campo \"Gosto culinário\"."); document.FrmPersonal.lstFood1.focus(); return (false); } return (true); } function Validate_FrmSendMail() { if (document.FrmSendMail.txtSubject.value.length < 2) { alert("Por favor, indique pelo menos 2 caracteres no campo \"Assunto\"."); document.FrmSendMail.txtSubject.focus(); return (false); } if (document.FrmSendMail.txtMessage.value.length < 20) { alert("Por favor, indique pelo menos 20 caracteres no campo \"Mensagem\"."); document.FrmSendMail.txtMessage.focus(); return (false); } return (true); } function Validate_FrmLogin() { if (document.FrmLogin.txtHandle.value.length < 6) { alert("Por favor, indique pelo menos 6 caracteres no campo \"Utilizador\"."); document.FrmLogin.txtHandle.focus(); return (false); } if (document.FrmLogin.txtHandle.value.length > 25) { alert("Por favor, não exceda os 25 caracteres no campo \"Utilizador\"."); document.FrmLogin.txtHandle.focus(); return (false); } if (document.FrmLogin.txtPassword.value.length < 5) { alert("Por favor, indique pelo menos 6 caracteres no campo \"Senha\"."); document.FrmLogin.txtPassword.focus(); return (false); } if (document.FrmLogin.txtPassword.value.length > 10) { alert("Por favor, não exceda os 10 caracteres no campo \"Senha\"."); document.FrmLogin.txtPassword.focus(); return (false); } return (true); } function Validate_FrmRegister(mode) { if (mode == 'create') { if (document.FrmRegister.txtHandle.value == "") { alert("Por favor, indique pelo menos 6 caracteres no campo \"Utilizador\"."); document.FrmRegister.txtHandle.focus(); return (false); } if (document.FrmRegister.txtHandle.value.length > 25) { alert("Por favor, não exceda os 25 caracteres no campo \"Utilizador\"."); document.FrmRegister.txtHandle.focus(); return (false); } if (document.FrmRegister.txtHandle.value.length < 6) { alert("Por favor, indique pelo menos 6 caracteres no campo \"Utilizador\"."); document.FrmRegister.txtHandle.focus(); return (false); } var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ1234567890-\t\r\n\f"; var checkStr = document.FrmRegister.txtHandle.value; var allValid = true; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } } if (!allValid) { alert("Por favor, indique apenas letras, espaço e simbolo \"-\" no campo \"Utilizador\"."); document.FrmRegister.txtHandle.focus(); return (false); } } if (document.FrmRegister.txtPassword.value.length < 6) { alert("Por favor, indique entre 6 a 10 caracteres no campo \"Senha\"."); document.FrmRegister.txtPassword.focus(); return (false); } var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ1234567890"; var checkStr = document.FrmRegister.txtPassword.value; var allValid = true; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } } if (!allValid) { alert("Por favor, indique apenas letras e algarismos no campo \"Senha\"."); document.FrmRegister.txtPassword.focus(); return (false); } if (document.FrmRegister.txtPassword.value.length > 10) { alert("Por favor, não exceda os 10 caracteres no campo \"Senha\"."); document.FrmRegister.txtPassword.focus(); return (false); } if (document.FrmRegister.txtConfirm.value.length < 6) { alert("Por favor, indique entre 6 a 10 caracteres no campo \"Confirmação\"."); document.FrmRegister.txtConfirm.focus(); return (false); } var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ1234567890"; var checkStr = document.FrmRegister.txtConfirm.value; var allValid = true; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } } if (!allValid) { alert("Por favor, indique apenas letras e algarismos no campo \"Confirmação\"."); document.FrmRegister.txtConfirm.focus(); return (false); } if (document.FrmRegister.txtConfirm.value.length > 10) { alert("Por favor, não exceda os 10 caracteres no campo \"Confirmação\"."); document.FrmRegister.txtConfirm.focus(); return (false); } if (document.FrmRegister.txtPassword.value != document.FrmRegister.txtConfirm.value) { alert("A Confirmação não condiz com a Senha introduzida - indique novamente"); document.FrmRegister.txtPassword.focus(); return (false); } if (document.FrmRegister.txtSurname.value.length < 2) { alert("Por favor, indique pelo menos 2 caracteres no campo \"Apelido\"."); document.FrmRegister.txtSurname.focus(); return (false); } var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ- \t\r\n\f"; var checkStr = document.FrmRegister.txtSurname.value; var allValid = true; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } } if (!allValid) { alert("Por favor, indique apenas letras, espaço e simbolo \"-\" no campo \"Apelido\"."); document.FrmRegister.txtSurname.focus(); return (false); } if (document.FrmRegister.txtSurname.value.length > 25) { alert("Por favor, não exceda os 25 caracteres no campo \"Apelido\"."); document.FrmRegister.txtSurname.focus(); return (false); } if (document.FrmRegister.txtForename.value.length > 25) { alert("Por favor, não exceda os 25 caracteres no campo \"Nome\"."); document.FrmRegister.txtForename.focus(); return (false); } if (document.FrmRegister.txtForename.value.length < 2) { alert("Por favor, indique pelo menos 2 caracteres no campo \"Nome\"."); document.FrmRegister.txtForename.focus(); return (false); } var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ- \t\r\n\f"; var checkStr = document.FrmRegister.txtForename.value; var allValid = true; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } } if (!allValid) { alert("Por favor, indique apenas letras, espaço e simbolo \"-\" no campo \"Nome\"."); document.FrmRegister.txtForename.focus(); return (false); } if (mode=='create' && document.FrmRegister.lstDay.selectedIndex == 0) { alert("Por favor, indique o seu Dia de Nascimmento."); document.FrmRegister.lstDay.focus(); return (false); } if (mode=='create' && document.FrmRegister.lstMonth.selectedIndex == 0) { alert("Por favor, indique o seu Mês de Nascimento."); document.FrmRegister.lstMonth.focus(); return (false); } if (document.FrmRegister.txtYear.value.length < 2) { alert("Por favor, indique um valor para o campo\"Ano\"."); document.FrmRegister.txtYear.focus(); return (false); } if (document.FrmRegister.txtYear.value.length > 2) { alert("Por favor, indique no máximo 2 algarismos no campo \"Ano de Nascimento\"."); document.FrmRegister.txtYear.focus(); return (false); } var checkOK = "0123456789"; var checkStr = document.FrmRegister.txtYear.value; var allValid = true; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } } if (!allValid) { alert("Por favor, indique apenas algarismos no campo \"Ano de Nascimento\"."); document.FrmRegister.txtYear.focus(); return (false); } if (mode=='create' && document.FrmRegister.lstSex.selectedIndex == 0) { alert("Por favor, indique o seu género."); document.FrmRegister.lstSex.focus(); return (false); } if (document.FrmRegister.txtEmail.value.length < 5) { alert("Por favor, indique pelo menos 5 caracteres no campo \"Email\"."); document.FrmRegister.txtEmail.focus(); return (false); } if (document.FrmRegister.txtEmail.value.indexOf("@") < 0 || document.FrmRegister.txtEmail.value.indexOf(".") < 0) { alert("O \"Email\" indicado é inválido, por favor, indique novamente."); document.FrmRegister.txtEmail.focus(); return (false); } if (mode=='create' && document.FrmRegister.chkDisclaimer.checked == false) { alert("Tem que ler e aceitar os Termos de Utilização antes de se registar."); document.FrmRegister.chkDisclaimer.focus(); return (false); } if (document.FrmRegister.lstCountry && document.FrmRegister.lstCountry.value <= 0) { alert("Por favor, indique um valor para o campo \"País\"."); document.FrmRegister.lstCountry.focus(); return (false); } else if(document.FrmRegister.lstCountry.value == 161 && document.FrmRegister.txtZipcode.value.length != 4 ){ alert("Preencha o código postal"); document.FrmRegister.txtZipcode.focus(); return (false); } else if(document.FrmRegister.lstCountry.value == 179 && document.FrmRegister.txtZipcode.value.length != 5 ){ alert("Preencha o código postal"); document.FrmRegister.txtZipcode.focus(); return (false); } else if(document.FrmRegister.txtZipcode.value == '' ){ alert("Preencha o código postal"); document.FrmRegister.txtZipcode.focus(); return (false); } if (document.FrmRegister.txtLocation ) if (document.FrmRegister.txtLocation.value.length < 2 || document.FrmRegister.txtLocation.value.length > 30) { alert("Por favor, indique entre 2 e 30 caracteres no campo \"Localização\"."); document.FrmRegister.txtLocation.focus(); return (false); } if (mode=='create' && document.FrmRegister.lstSeeking) { if (mode=='create' && document.FrmRegister.lstSeeking.selectedIndex == 0) { alert("Por favor, indique um valor para o campo \"Procura\"."); document.FrmRegister.lstSeeking.focus(); return (false); } if (mode=='create' && document.FrmRegister.lstBodyType.selectedIndex == 0) { alert("Por favor, indique um valor para o campo \"Tipo Corporal\"."); document.FrmRegister.lstBodyType.focus(); return (false); } if (mode=='create' && document.FrmRegister.lstHeight.selectedIndex == 0) { alert("Por favor, indique um valor para o campo \"Altura\"."); document.FrmRegister.lstHeight.focus(); return (false); } if (mode=='create' && document.FrmRegister.lstChildren.selectedIndex == 0) { alert("Por favor, indique um valor para o campo \"Crianças\"."); document.FrmRegister.lstChildren.focus(); return (false); } if (mode=='create' && document.FrmRegister.lstSmoker.selectedIndex == 0) { alert("Por favor, indique um valor para o campo \"Fumador\"."); document.FrmRegister.lstSmoker.focus(); return (false); } if (mode=='create' && document.FrmRegister.lstReligion.selectedIndex == 0) { alert("Por favor, indique um valor para o campo \"Religião\"."); document.FrmRegister.lstReligion.focus(); return (false); } if (mode=='create' && document.FrmRegister.lstMarital.selectedIndex == 0) { alert("Por favor, indique um valor para o campo \"Estado Civil\"."); document.FrmRegister.lstMarital.focus(); return (false); } if (mode=='create' && document.FrmRegister.lstEthnicity.selectedIndex == 0) { alert("Por favor, indique um valor para o campo \"Etnia\"."); document.FrmRegister.lstEthnicity.focus(); return (false); } if (mode=='create' && document.FrmRegister.lstEducation.selectedIndex == 0) { alert("Por favor, indique um valor para o campo \"Educação\"."); document.FrmRegister.lstEducation.focus(); return (false); } if (mode=='create' && document.FrmRegister.lstEmployment.selectedIndex == 0) { alert("Por favor, indique um valor para o campo \"Emprego\"."); document.FrmRegister.lstEmployment.focus(); return (false); } if (mode=='create' && document.FrmRegister.lstIncome.selectedIndex == 0) { alert("Por favor, indique um valor para o campo \"Rendimento\"."); document.FrmRegister.lstIncome.focus(); return (false); } if (mode=='create' && document.FrmRegister.chkSeekmen.checked == false && document.FrmRegister.chkSeekwmn.checked == false && document.FrmRegister.chkSeekcpl.checked == false) { alert("Por favor, indique os géneros que procura no campo \"Procurando\"."); document.FrmRegister.chkSeekmen.focus(); return (false); } if (mode=='create' && (document.FrmRegister.txtTitle.value.length < 5 || document.FrmRegister.txtTitle.value.length > 30)) { alert("Por favor, indique entre 5 a 30 caracteres no campo \"Título da Mensagem\"."); document.FrmRegister.txtTitle.focus(); return (false); } if (mode=='create' && (document.FrmRegister.txtComment.value.length < 120 || document.FrmRegister.txtComment.value.length > 4000)) { alert("Por favor, indique entre 120 e 4000 caracteres no campo \"Mensagem\"."); document.FrmRegister.txtComment.focus(); return (false); } if (mode=='create' && (document.FrmRegister.txtMyComment.value.length < 120 || document.FrmRegister.txtMyComment.value.length > 4000)) { alert("Por favor, indique entre 120 e 4000 caracteres no campo \"Mensagem\"."); document.FrmRegister.txtMyComment.focus(); return (false); } if (mode=='create' && document.FrmRegister.lstSector.selectedIndex == 0) { alert("Indique o sector de actividade"); document.FrmRegister.lstSector.focus(); return (false); } if (mode=='create' && document.FrmRegister.lstOcupation.selectedIndex == 0) { alert("Indique a sua ocupação"); document.FrmRegister.lstOcupation.focus(); return (false); } if (mode=='create' && document.FrmRegister.listas1.checked == false && document.FrmRegister.listas2.checked == false && document.FrmRegister.listas3.checked == false && document.FrmRegister.listas4.checked == false && document.FrmRegister.listas5.checked == false && document.FrmRegister.listas6.checked == false && document.FrmRegister.listas7.checked == false && document.FrmRegister.listas8.checked == false && document.FrmRegister.listas9.checked == false && document.FrmRegister.listas10.checked == false && document.FrmRegister.listas11.checked == false && document.FrmRegister.listas12.checked == false && document.FrmRegister.listas13.checked == false && document.FrmRegister.listas14.checked == false && document.FrmRegister.listas15.checked == false && document.FrmRegister.listas16.checked == false ) { alert("Indique pelo menos um interesse."); return (false); } } return (true); } function Validate_FrmAffiliate() { if (document.FrmAffiliate.txtUsername.value.length > 25) { alert("Por favor, não exceda os 25 caracteres no campo \"Utilizador\"."); document.FrmAffiliate.txtUsername.focus(); return (false); } if (document.FrmAffiliate.txtUsername.value.length < 6) { alert("Por favor, indique pelo menos 6 caracteres no campo \"Utilizador\"."); document.FrmAffiliate.txtUsername.focus(); return (false); } var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ1234567890-\t\r\n\f"; var checkStr = document.FrmAffiliate.txtUsername.value; var allValid = true; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } } if (!allValid) { alert("Por favor, indique apenas letras, espaço e simbolo \"-\" no campo \"Utilizador\"."); document.FrmAffiliate.txtUsername.focus(); return (false); } if (document.FrmAffiliate.txtSurname.value.length < 2) { alert("Por favor, indique pelo menos 2 caracteres no campo \"Apelido\"."); document.FrmAffiliate.txtSurname.focus(); return (false); } var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ- \t\r\n\f"; var checkStr = document.FrmAffiliate.txtSurname.value; var allValid = true; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } } if (!allValid) { alert("Por favor, indique apenas letras, espaço e simbolo \"-\" no campo \"Apelido\"."); document.FrmAffiliate.txtSurname.focus(); return (false); } if (document.FrmAffiliate.txtSurname.value.length > 25) { alert("Por favor, não exceda os 25 caracteres no campo \"Apelido\"."); document.FrmAffiliate.txtSurname.focus(); return (false); } if (document.FrmAffiliate.txtForename.value.length > 25) { alert("Por favor, não exceda os 25 caracteres no campo \"Nome\"."); document.FrmAffiliate.txtForename.focus(); return (false); } if (document.FrmAffiliate.txtForename.value.length < 2) { alert("Por favor, indique pelo menos 2 caracteres no campo \"Nome\"."); document.FrmAffiliate.txtForename.focus(); return (false); } var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ- \t\r\n\f"; var checkStr = document.FrmAffiliate.txtForename.value; var allValid = true; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } } if (!allValid) { alert("Por favor, indique apenas letras, espaço e simbolo \"-\" no campo \"Nome\"."); document.FrmAffiliate.txtForename.focus(); return (false); } if (document.FrmAffiliate.txtBusiness.value == "") { alert("Por favor, indique um valor para o campo \"Nome Comercial\" field."); document.FrmAffiliate.txtBusiness.focus(); return (false); } if (document.FrmAffiliate.txtAddress.value == "") { alert("Por favor, indique um valor para o campo \"Morada\"."); document.FrmAffiliate.txtAddress.focus(); return (false); } if (document.FrmAffiliate.txtStreet.value == "") { alert("Por favor, indique um valor para o campo \"Rua\"."); document.FrmAffiliate.txtStreet.focus(); return (false); } if (document.FrmAffiliate.txtTown.value == "") { alert("Por favor, indique um valor para o campo \"Cidade\"."); document.FrmAffiliate.txtTown.focus(); return (false); } if (document.FrmAffiliate.txtState.value == "") { alert("Por favor, indique um valor para o campo \"Estado\"."); document.FrmAffiliate.txtState.focus(); return (false); } if (document.FrmAffiliate.txtZip.value == "") { alert("Por favor, indique um valor para o campo \"Código Postal\"."); document.FrmAffiliate.txtZip.focus(); return (false); } if (document.FrmAffiliate.lstCountry.selectedIndex == 0) { alert("Por favor, indique um valor para o campo \"País\"."); document.FrmAffiliate.lstCountry.focus(); return (false); } if (document.FrmAffiliate.txtEmail.value.length < 5) { alert("Por favor, indique pelo menos 5 caracteres no campo \"Email\"."); document.FrmAffiliate.txtEmail.focus(); return (false); } if (document.FrmAffiliate.txtEmail.value.indexOf("@") < 0 || document.FrmAffiliate.txtEmail.value.indexOf(".") < 0) { alert("O \"Email\" indicado é inválido, por favor, indique novamente."); document.FrmAffiliate.txtEmail.focus(); return (false); } if (document.FrmAffiliate.txtWebsite.value == "http://") { alert("Por favor, indique um valor para o campo \"Website\"."); document.FrmAffiliate.txtWebsite.focus(); return (false); } if (document.FrmAffiliate.txtPayable.value == "") { alert("Por favor, indique um valor para o campo \"Recebedor\"."); document.FrmAffiliate.txtPayable.focus(); return (false); } return (true); } function Validate_FrmAdvert(mode) { if (document.FrmAdvert.lstCountry && document.FrmAdvert.lstCountry.value <= 0) { alert("Por favor, indique um valor para o campo \"País\"."); document.FrmAdvert.lstCountry.focus(); return (false); } if (document.FrmAdvert.lstCity && document.FrmAdvert.lstCity.value <= 0) { alert("Por favor, indique um valor para o campo \"Cidade\"."); document.FrmAdvert.lstCity.focus(); return (false); } if (document.FrmAdvert.chkSeekmen.checked == false && document.FrmAdvert.chkSeekwmn.checked == false && document.FrmAdvert.chkSeekcpl.checked == false) { alert("Por favor, indique os géneros que procura no campo \"Procurando\"."); document.FrmAdvert.chkSeekmen.focus(); return (false); } if (document.FrmAdvert.txtTitle.value.length < 5 || document.FrmAdvert.txtTitle.value.length > 30) { alert("Por favor, indique entre 5 a 30 caracteres no campo \"Título da Mensagem\"."); document.FrmAdvert.txtTitle.focus(); return (false); } if (document.FrmAdvert.txtComment.value.length < 120 || document.FrmAdvert.txtComment.value.length > 4000 ) { alert("Por favor, indique entre 120 e 4000 caracteres no campo \"Mensagem\"."); document.FrmAdvert.txtComment.focus(); return (false); } return (true); } function delete_alert() { if (window.confirm("Esta acção irá removê-lo do sitema, incluindo quaisquer perfis, Mensagens de Correio e Escolhas. Tem a certeza ?")) { return true; } else { return false; } } function delete_alert2() { if (window.confirm("Esta acção irá remover o seu perfil do sistema. Tem a certeza ?")) { return true; } else { return false; } } function delete_alert3() { if (window.confirm("Esta acção irá remover o seu perfil do sistema. Tem a certeza ?")) { return true; } else { return false; } } function delete_alert4() { if (window.confirm("Esta acção irá remover o membro do sistema. Tem a certeza ?")) { return true; } else { return false; } } function delete_alert5() { if (window.confirm("Esta acção irá apagar o seu blog. Tem a certeza ?")) { return true; } else { return false; } } function delete_alert6() { if (window.confirm("Esta acção irá apagar a sua mensagem. Tem a certeza ?")) { return true; } else { return false; } } function delete_alert7() { if (window.confirm("Esta acção irá apagar a sua galeria e todas as imagens que lá estão. Tem a certeza ?")) { return true; } else { return false; } } function skip_alert() { if (window.confirm("Quer saltar esta parte do seu perfil ?")) { return true; } else { return false; } } function MDM_openWindow(theURL,winName,features) { // features += ',location=yes,status=yes,resizeable=yes'; var _W=window.open(theURL,winName,features); _W.focus(); _W.moveTo(50,30); } function switchBlock(id,show){ if (document.getElementById(id).disabled){ document.getElementById(id).style.display=show; document.getElementById(id).disabled=false; document.getElementById(id+'_up').style.display='none'; document.getElementById(id+'_down').style.display=show; }else{ document.getElementById(id).style.display='none'; document.getElementById(id).disabled=true; document.getElementById(id+'_up').style.display=show; document.getElementById(id+'_down').style.display='none'; } } function uncheck_other(el,name){ f = el.form; n = f.elements.length; j = 0; for (i = h = c = 0; i < n; i++) { if (f.elements[i].type == 'checkbox') { // if (f.elements[i].name == name && f.elements[i].value != '- Any -' ) f.elements[i].checked = false; if (f.elements[i].name == name && j++>=1) f.elements[i].checked = false; } } } function uncheck_first(el,name){ f = el.form; n = f.elements.length; for (i = h = c = 0; i < n; i++) { if (f.elements[i].type == 'checkbox') { // if (f.elements[i].name == name && f.elements[i].value == '- Any -'){ if (f.elements[i].name == name){ f.elements[i].checked = false; return; } } } } function uncheck_seek(el,name){ f = el.form; n = f.elements.length; j = 0; for (i = h = c = 0; i < n; i++) { if (f.elements[i].type == 'checkbox') { if (f.elements[i].name == name) f.elements[i].checked = false; } } } function insertValueToArea(list,area) { var myArea = area; var myList = list; var myForm = list.form; if(myList.options.length > 0) { var chaineAj = ""; var NbSelect = 0; for(var i=0; i < myList.options.length; i++) { if (myList.options[i].selected){ NbSelect++; if (NbSelect > 1) chaineAj += ", "; chaineAj += myList.options[i].value; } } //IE support if (document.selection) { myArea.focus(); sel = document.selection.createRange(); sel.text = chaineAj; //myForm.insert.focus(); } //MOZILLA/NETSCAPE support else if (myArea.selectionStart || myArea.selectionStart == "0") { var startPos = myArea.selectionStart; var endPos = myArea.selectionEnd; var chaineSql = myArea.value; myArea.value = chaineSql.substring(0, startPos) + chaineAj + chaineSql.substring(endPos, chaineSql.length); } else { myArea.value += chaineAj; } } } function admin_mail(strObject, sd) { switch (strObject) { case "txtAddress": if (document.mailForm.txtAddress.value.length > 0) { document.mailForm.chkAffiliates.disabled=true; document.mailForm.chkFile.disabled=true; document.mailForm.chkAllusers.disabled=true; document.mailForm.chkSpeeddating.disabled=true; } else { document.mailForm.chkAffiliates.disabled=false; document.mailForm.chkAllusers.disabled=false; document.mailForm.chkFile.disabled=false; document.mailForm.chkSpeeddating.disabled=false; } break; case "chkAllusers": if (document.mailForm.chkAllusers.checked==true) { document.mailForm.chkAffiliates.disabled=true; document.mailForm.chkFile.disabled=true; document.mailForm.txtAddress.disabled=true; document.mailForm.chkSpeeddating.disabled=true; } else { document.mailForm.chkAffiliates.disabled=false; document.mailForm.chkFile.disabled=false; document.mailForm.txtAddress.disabled=false; document.mailForm.chkSpeeddating.disabled=false; } break; case "chkAffiliates": if (document.mailForm.chkAffiliates.checked==true) { document.mailForm.chkAllusers.disabled=true; document.mailForm.chkFile.disabled=true; document.mailForm.txtAddress.disabled=true; document.mailForm.chkSpeeddating.disabled=true; } else { document.mailForm.chkAllusers.disabled=false; document.mailForm.chkFile.disabled=false; document.mailForm.txtAddress.disabled=false; document.mailForm.chkSpeeddating.disabled=false; } break; case "chkFile": if (document.mailForm.chkFile.checked==true) { document.mailForm.chkAffiliates.disabled=true; document.mailForm.chkAllusers.disabled=true; document.mailForm.txtAddress.disabled=true; document.mailForm.chkSpeeddating.disabled=true; } else { document.mailForm.chkAffiliates.disabled=false; document.mailForm.chkAllusers.disabled=false; document.mailForm.txtAddress.disabled=false; document.mailForm.chkSpeeddating.disabled=false; } break; case "chkSpeeddating": if (document.mailForm.chkSpeeddating.checked==true) { document.mailForm.chkAffiliates.disabled=true; document.mailForm.chkAllusers.disabled=true; document.mailForm.txtAddress.disabled=true; document.mailForm.chkFile.disabled=true; } else { document.mailForm.chkAffiliates.disabled=false; document.mailForm.chkAllusers.disabled=false; document.mailForm.txtAddress.disabled=false; document.mailForm.chkFile.disabled=false; } break; } return true; } function emoticon(id,text) { var txtarea = document.getElementById(id); text = ' ' + text + ' '; if (txtarea.createTextRange && txtarea.caretPos) { var caretPos = txtarea.caretPos; caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text; txtarea.focus(); } else { txtarea.value += text; txtarea.focus(); } } function selected(oRow) { oRow.style.backgroundColor='#dddddd'; } function deselected(oRow,oColor) { oRow.style.backgroundColor='#f0f0f0'; } function selectAll(frm_name,fld_name,selected){ var elms = document.forms[frm_name].elements; for(var i=0; i < elms.length; i++){ if (elms[i].name == fld_name) { elms[i].selected = selected; elms[i].checked = selected; } } } function showToolTip(e,text){ document.all.ToolTip.innerHTML="
| "+text+" |