function ContactCheck() {

    var fname = $("#first_name").val();
    var contact_phone = $("#contact_phone").val();
    var full_name = $("#full_name").val();
    var email = $("#contact_email").val();
    var country = $("#country_id :selected").text();
    var client_type = $("#c_id :selected").text();
    var contact_remarks = $("#contact_remarks").val();

    var theName = fname + " " + full_name;

    contact_remarks += "<br/> מדינה:" + country + "<br/> סוג לקוח: " + client_type;
  //  alert(country + '  ' + client_type);

    // return;

    $(".applyForm").html("<p class='text' style='text-align:center'>מתבצע תהליך השליחה, אנא המתן ...</p><img alt='loading...' src='/Images/loading11.gif' />");

   
    $.ajax({
        
        dataType: "json",
        cache: false,
        async: true,
        type: "POST",
        url: "/APP/webbiz.asp",
        data: { full_name: theName, phone: contact_phone, email: email, contact_remarks: contact_remarks, minisite_customer_id: 30 },
        complete: function (jqXHR, textStatus) {
        //alert(jqXHR.responseText);
        $(".applyForm").html(jqXHR.responseText);
        }
    });
}

function ContactCheckNew() {
    
  var fnameC = $("#first_name");
  fnameC.css("background-color", "white");
  var fname = fnameC.val();
  
  var contact_phoneC = $("#contact_phone");
  var contact_phone = contact_phoneC .val();
  contact_phoneC.css("background-color", "white");
  
  var full_nameC = $("#full_name"); 
  var full_name = full_nameC.val();
  full_nameC.css("background-color", "white");
  
  var emailC = $("#contact_email");
  var email = emailC.val();
  emailC.css("background-color", "white");
  
  var country = $("#country_id :selected").text();
  var client_type = $("#c_id :selected").text();
  var contact_remarks = $("#contact_remarks").val();
  var c_type = $("#c_id :selected").val();
  
  var theName = fname + " " + full_name;
  
  contact_remarks += "<br/> מדינה:" + country + "<br/> סוג לקוח: " + client_type;
  
  var isValid = true;
  if(jQuery.trim(fname) == "" || jQuery.trim(fname) == "שם פרטי"){
      isValid = false;
      $("#first_name").css("background-color", "red").effect("pulsate");
  }
  if(jQuery.trim(full_name) == "" || jQuery.trim(full_name) == "שם משפחה"){
      isValid = false;
      $("#full_name").css("background-color", "red").effect("pulsate");
  }
  if(jQuery.trim(contact_phone) == "טלפון" || jQuery.trim(contact_phone) == "" || isNaN(contact_phone) || contact_phone.length < 8 || contact_phone.length > 13){
      isValid = false;
      $("#contact_phone").css("background-color", "red").effect("pulsate");
  }
  if(jQuery.trim(email) == "" || jQuery.trim(email) == "דוא''ל"){
      isValid = false;
      //$("#contact_email").css("background-color", "red").effect("pulsate");
  }
  if(!(email.indexOf("@") > 0 && email.indexOf(".") > 0 && email.indexOf(".") < EmLen && email.indexOf(".") < EmLen)){
      sValid = false;
      $("#contact_email").css("background-color", "red").effect("pulsate");
  }

  if(!isValid)
    return;
  
  $(".applyForm").html("<p class='text' style='text-align:center'>מתבצע תהליך השליחה, אנא המתן ...</p><img alt='loading...' src='/Images/loading11.gif' />");
  
  
  $.ajax({
      
      dataType: "json",
      cache: false,
      async: true,
      type: "POST",
      url: "/umbraco/plugins/lead.ashx",
      data: { full_name: theName, phone: contact_phone, email: email, contact_remarks: contact_remarks, c_type: c_type},
      complete: function (jqXHR, textStatus) {
      //alert(jqXHR.responseText);
      $(".applyForm").html(jqXHR.responseText);
      }
  });
}

 function ContactUSCheckEmail(Commemail) {
            var email = Commemail.value;
            var EmLen = email.length;
            email = ltrim(rtrim(email));
            if (email == '') {
                Commemail.style.backgroundColor = 'Red';
                return false;
            }
            if (email.indexOf("@") > 0 && email.indexOf(".") > 0 && email.indexOf(".") < EmLen && email.indexOf(".") < EmLen) {
                return true;
            } else {
                Commemail.style.backgroundColor = 'Red';
                return false;
            }
        }

