function isValidEmail(str) { return (str.indexOf(".") > 2) && (str.indexOf("@") > 0); } function ValidateMekl(tmpForm){ if (tmpForm.searchtxt.value==''){ alert('Type keyword(-s)!'); return false; } if (tmpForm.searchtxt.value.length<5){ alert('Keyword(-s) too short!'); return false; } return true; } function ValidateJaut(tmpForm){ if (tmpForm.vards.value==''){ alert('Enter your name!'); return false; } if ((tmpForm.pasts.value=='')&&(tmpForm.telefons.value=='')){ alert('Type e-mail adsress or phone nr.!'); return false; } if (!isValidEmail(tmpForm.pasts.value)){ alert ('Invalid e-mail address!'); return false; } if (tmpForm.jautajums.value==''){ alert('Type question!'); return false; } if (tmpForm.lietdkods.value==''){ alert('Type security code!'); return false; } return true; } function ValidateLogin(tmpform){ if (tmpform.lietotajs.value==''){ alert (''); return false; } if (tmpform.parole.value==''){ alert (''); return false; } if (tmpform.lietdkods.value==''){ alert ('Type security code!'); return false; } return true; } function ValidatePassForm(tmpform){ if (tmpform.epasts.value==''){ alert ('Type e-mail address!'); return false; } if (!isValidEmail(tmpform.epasts.value)){ alert ('Invalid e-mail address!'); return false; } return true; } function ValidateRegForm(tmpform){ if (tmpform.lietotajs.value==''){ alert (''); return false; } if (tmpform.epasts.value==''){ alert ('Type e-mail address!'); return false; } if (tmpform.epasts2.value==''){ alert (''); return false; } if (!isValidEmail(tmpform.epasts.value)){ alert ('Invalid e-mail address!'); return false; } if (tmpform.epasts.value!=tmpform.epasts2.value){ alert (''); return false; } if (tmpform.tmpdkods.value==''){ alert ('Type security code!'); return false; } return true; }