
PK 
$(function() {
$('.error').hide();
$('input.text-input').css({backgroundColor:"#FFFFFF"});
$('input.text-input').focus(function(){
$(this).css({backgroundColor:"#FFDDAA"});
});
$('input.text-input').blur(function(){
$(this).css({backgroundColor:"#FFFFFF"});
});
$("#sub").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 name = $("input#name").val();
if (name == "") {
$("label#name_error").show();
$("input#name").focus();
return false;
}
var address = $("input#address").val();
if (address == "") {
$("label#adress_error").show();
$("input#address").focus();
return false;
}
var phone = $("input#phone").val();
if (phone == "") {
$("label#phone_error").show();
$("input#phone").focus();
return false;
}
var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/;
var email = $("input#email").val();
if (email == "")
{
$("label#email_error").show();
$("input#email").focus();
return false;
}
else if(!emailReg.test(email)) {
//$("label#email_error").html('');
//$("input#email").html('<span class="error" id="email_error">Please enter your valid ID.</span>');
$("label#email_error1").show();
$("input#email").focus();
return false
}
var comments = $("textarea#comments").val();
if (comments == "") {
$("label#comments_error").show();
$("input#comments").focus();
return false;
}
var dataString = '&name='+ name + /*'&company='+ company +*/ '&address=' + address + '&email=' + email + '&phone=' + phone + '&comments=' + comments;
//alert ("hi");
//return false;
$.ajax({
type: "POST",
//url:"inbox/index.php"
url: "../bin/process.php",
data: dataString,
success: function() {
$('#contact_form').html("<div id='message'></div>");
$('#message').html("<h4>Contact Form Submitted!</h4>")
.append('<p>Thank you '+ name + ' for your request. Your information has been received and a representative will contact you shortly. </p></br></br><br/>')
.hide()
.fadeIn(1500, function() {
$('#message').append("<img id='checkmark' src='images/email_accept-128.png' /><br/>");
});
}
});
return false;
});
});
runOnLoad(function(){
$("input#Contact").select().focus();
});
function isNumberKey(evt)
{
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true;
}


PK 99