var captcha = true;var captcha_correct = false; //test function fbCheckEmail(email) { var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; if (!filter.test(email)) { return false; } return true; } jQuery(function() { jQuery('.error').hide(); jQuery('input.text-input').css({backgroundColor:"#FFFFFF"}); jQuery('input.text-input').focus(function(){ jQuery(this).css({backgroundColor:"#FFDDAA"}); }); jQuery('input.text-input').blur(function(){ jQuery(this).css({backgroundColor:"#FFFFFF"}); }); //validate captcha if (captcha) { jQuery("#fb_captcha").change(function() { }); } jQuery("#fb_submit_btn").click(function() { var is_correct = true; // validate and process form // first hide any error messages jQuery('.error').hide(); //validate captcha if (captcha) { var captcha_nb = jQuery("#fb_captcha_nb").val(); var captcha_val = jQuery("#fb_captcha").val(); jQuery.ajax({ type: "GET", url: "/fb_check_captcha.php", async: false, data: 'captcha_nb=' + captcha_nb + '&captcha_val=' + encodeURIComponent(captcha_val), success: function(html) { if (html == 1) { jQuery("label#captcha_error").hide(); captcha_correct = true; } else { captcha_correct = false; jQuery("label#captcha_error").show(); } } }) } var fb_username = jQuery("#fb_username").val(); if (fb_username == "") { jQuery("label#fb_username_empty_error").show(); jQuery("input#fb_username").focus(); //return false; is_correct = false; }var fb_company = jQuery("#fb_company").val(); if (fb_company == "") { jQuery("label#fb_company_empty_error").show(); jQuery("input#fb_company").focus(); //return false; is_correct = false; }var fb_phone = jQuery("#fb_phone").val(); if (fb_phone == "") { jQuery("label#fb_phone_empty_error").show(); jQuery("input#fb_phone").focus(); //return false; is_correct = false; }var fb_question = jQuery("#fb_question").val(); if (fb_question == "") { jQuery("label#fb_question_empty_error").show(); jQuery("input#fb_question").focus(); //return false; is_correct = false; }var dataString ="fb_username="+fb_username+"&"+"fb_company="+fb_company+"&"+"fb_phone="+fb_phone+"&"+"fb_question="+fb_question+"&captcha_nb="+captcha_nb+"&captcha_val="+captcha_val; //var dataString = 'name='+ name + '&email=' + email + '&phone=' + phone; if (captcha_correct && is_correct) { jQuery.ajax({ type: "POST", async: false, url: "/fb_process.php", data: dataString, success: function() { jQuery('#contact_form').html("
"); jQuery('#contact_form').html("