
$(document).ready(function() {$("#feedback_form").submit(check_feedback_form);});
var errors_list = new Array();
errors_list["name"] = "Introduceţi numele!";
errors_list["email"] = "Introduceţi e-mailul!";
errors_list["phone"] = "Introduceţi numărul de telefon!";
errors_list["question"] = "Introduceţi mesajul!";
errors_list["hid_TWLCAPTCHAPASS"] = "Introduceţi codul din imagine!";


var feedback_form_valid = true;
function check_feedback_form()
{
feedback_form_valid = true;
$("#feedback_form :input").each(chk_fld);
return feedback_form_valid;
}

function chk_fld()
{
if(!errors_list[this.name]) return;
if(!feedback_form_valid) return;
if(jQuery.trim(this.value)=="") {alert(errors_list[this.name]); this.focus(); feedback_form_valid=false; return false;}

if(this.name=="phone" && !isPhoneValid(this.value)){alert("Telefon este greşit"); this.focus(); feedback_form_valid=false; return false;};

if(this.name=="email" && !isEmailValid(this.value)){alert("Email este greşit"); this.focus(); feedback_form_valid=false; return false;};
}