  $(function() {
  $('.errorcb').hide();
  
 

  $(".buttoncb").click(function() {
		// validate and process form
		// first hide any error messages
    $('.errorcb').hide();
	
  	  var name = $("input#namecb").val();
  		if (name == "Full Name*") {
        $("label#name_errorcb").show();
        $("input#namecb").focus();
        return false;
      }
  		
  		var phone = $("input#phonecb").val();
  		if (phone == "Telephone Number*") {
        $("label#phone_errorcb").show();
        $("input#phonecb").focus();
        return false;
      
	
      }
	  
	  var contactby = $("input#contactbycb").val();
  		if (contactby != "") {
        $("label#contactby_errorcb").show();
        return false;
      }
	
	  var dataString = 'name='+ name + '&phone=' + phone;
	  //alert (dataString);return false;
	  $.ajax({
      type: "POST",
      url: "bin/process-callback.php",
      data: dataString,
      success: function() {
        $('#contact_formcb').html("<div id='messagecb'></div>");
        $('#messagecb').html("<img id='checkmarkcb' src='images/checkcb.png' /><h2>Thanks for submitting a callback request, a member of our design team will be in touch shortly . . .</h2>")
        
        .hide()
        .fadeIn(1500, function() {
          
        });
      }
     });
    return false;
	});
});

  
  
 
