
	
	
	function contact_form_show() {
		//var form = document.getElementById("contact_form");
		//form.style.setProperty('display','block');
		document.getElementById("contact_form").style.display="block";
		//document. document.getElementById("contact_form");.style.display="block";
		
		
		$('html,body').animate({scrollTop: $("#contact_form").offset().top},'slow');
		location.href = "#contact_form";
		$("#contact_form").css({ opacity: 0.0 });
		 $('#contact_form').fadeTo('slow', 1, function() {
      // Animation complete.
    });
	}

$(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"});
  });

  $(".button").click(function() {
		// validate and process form
		// first hide any error messages
    $('.error').hide();
		
	  var name = $("input#name").val();
		if (name == "") {
      $("label#name_error").show();
      $("input#name").focus();
      return false;
    }
		var email = $("input#email").val();
		if (email == "") {
      $("label#email_error").show();
      $("input#email").focus();
      return false;
    }
    var phone = $("input#phone").val(); 
    //var comment = $("textarea#comment").val();
    var comment = document.contact.comment.value;

	/*	var phone = $("input#phone").val();
		if (phone == "") {
      $("label#phone_error").show();
      $("input#phone").focus();
      return false;
    }
    var contact = $("input#phone").val();
		if (phone == "") {
      $("label#phone_error").show();
      $("input#phone").focus();
      return false;
    }
		*/
		var dataString = 'name='+ name + '&email=' + email + '&phone=' + phone + '&comment=' + comment;
		
		
		$.ajax({
      type: "POST",
      url: "mailScripts/process.php",
      data: dataString,
      success: function(data) {
    
      	$('#contact_form').fadeTo('slow', 0.0, function() {
      	// Animation complete.
    	//location.href = "#top";  			
    			 $("html, body").animate({ scrollTop: 0 }, "slow", function() {
    			 	document.getElementById("contact_form").style.display="none";});
  	 	});
      }
     });
    return false;
	});
});

