jQuery(function($) {	

$('#header').live('click', function(e)	{
	window.location = "./index.html";
	e.preventDefault(); 
});


//email form code
$(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"});
//  });
 
  $(".submitBtn").click(function() {

    var contactName = $("input[name='contactName']").val();
    var companyName = $("input[name='companyName']").val();
    var email = $("input[name='email']").val();
	var phone = $("input[name='phone']").val();
	var areaOfInterest = $("select[name='interest'] option:selected").val();
	var sizeOfFacility = $("input[name='size']").val();
	var buildingType = $("select[name='buildingType'] option:selected").val();
	var LocationOfFacility = $("input[name='location']").val();
	var multipleFacilities = $("input[name='multipleFacilities']:checked").val();
	var descriptionOfProject = $('textarea#descriptionTextArea').val();
	
	if (contactName == "") {
	   alert("Please Fill In Name, Company, Phone and Email.");
		return false;
    }
	
	if (companyName == "") {
	   alert("Please Fill In Name, Company, Phone and Email.");
		return false;
    }

	if (email == "") {
	   alert("Please Fill In Name, Company, Phone and Email.");
		return false;
    }

	if (phone == "") {
	   alert("Please Fill In Name, Company, Phone and Email.");
		return false;
    }	
		
	var dataString = 'contactName='+ contactName + '&companyName=' + companyName + '&email=' + email + '&phone=' + phone + '&areaOfInterest=' + areaOfInterest + '&sizeOfFacility=' + sizeOfFacility + '&buildingType=' + buildingType + '&LocationOfFacility=' + LocationOfFacility + '&multipleFacilities=' + multipleFacilities + '&descriptionOfProject=' + descriptionOfProject;
		//alert (dataString);return false;
		
		$.ajax({
      type: "POST",
      url: "php/process.php",
      data: dataString,
      success: function() {
        $('.formactual').html("<div id='message' style='width: 350px'></div>");
        $('#message').html("<span class='fourteenb'><b>Thank you for your inquiry and the interest you have expressed in Kupper Engineering’s services.</b></span><br/><br/>  You can expect a personal reply within 1-2 business days to answer your questions and to explore possible options for Kupper Engineering to help you resolve your engineering services needs.<br/>");
        
        
      }
     });
    return false;
	});
});


		




});
	
