	
$(function() {
  /*logo link*/
  
  $("#logo").click( function() {
		window.location = "http://www.fishtankmedia.com";
	});
		   
  /*form handeling*/		   
  $('.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"});
  });

  $("#submit-form").click(function() {
    $('.error').hide();
		
	  var name = $("#name").val();
	  var email = $("#email").val();
	  var phone = $("#phone").val();
	  var service = $("#service").val();
	  var subject = $("#subject").val();
	  var message = $("#message").val();
	  	 
	if (name == "") {
	
      $("#name_error").show();
      $("input#name").focus();
      return false;
    }
		
	if (email == "") {
      $("label#email_error").show();
      $("input#email").focus();
      return false;
    }
		
	if (phone == "") {
      $("label#phone_error").show();
      $("input#phone").focus();
      return false;
    }
		
		var dataString = 'name='+ name + '&email=' + email + '&phone=' + phone + '&service=' + service + '&subject=' + subject + '&message=' + message;
		/*alert(dataString);
		return false;*/
		
		$.ajax({
      type: "POST",
      url: "../bin/process.php",
      data: dataString,
		success: function() {
        $('#contact-form').html("<div id='message1'></div>");
        $('#message1').html("<h2> <img id='checkmark' src='../images/check-mark.jpg' width='35' height='36'/> Your Message Has Been Submitted!</h2>")
        .append("<p>Thank you for reaching out to us. We will contact you soon.</p>")
        .hide()
        .fadeIn(1500, function() {
          $('#message1').append("");
        });
      }
     });
    return false;
	});
});

