$(function() {
$('.error').hide();
$('input.text-input').css({borderColor:"#d4d4d4"});
$('input.text-input').focus(function(){
$(this).css({borderColor:"#1B1A1A"});
});
$('input.text-input').blur(function(){
$(this).css({borderColor:"#d4d4d4"});
});

$(".submit").click(function() {
// validate and process form
// first hide any error messages
$('.error').hide();

var Company = $("input#Company").val();
if (Company == "") {
$("label#Company_error").show();
$("input#Company").focus();
return false;
}
var FirstName = $("input#FirstName").val();
if (FirstName == "") {
$("label#FirstName_error").show();
$("input#FirstName").focus();
return false;
}
var LastName = $("input#LastName").val();
if (LastName == "") {
$("label#LastName_error").show();
$("input#LastName").focus();
return false;
}
var Tel = $("input#Tel").val();
if (Tel == "") {
$("label#Tel_error").show();
$("input#Tel").focus();
return false;
}

var dataString = 'Company='+ Company + '&FirstName=' + FirstName + '&LastName=' + LastName + '&Tel=' + Tel + '&Email=' + Email + '&Website=' + Website;
//alert (dataString);return false;

$.ajax({
type: "POST",
url: "",
data: dataString,
success: function() {
$('#contact-form').html("<div id='message'></div>");
$('#message').html("<h2>Contact Form Submitted!</h2>")
.append("<p>We will be in touch soon.</p>")
.hide()
.fadeIn(1500, function() {
$('#message').append("<img id='checkmark' src='images/check.png' />");
});
}
});
return false;
});
});
runOnLoad(function(){
$("input#name").select().focus();
});

