$(document).ready(function() {

	$("#contact-form .submit input").replaceWith("<a>Submit...</a>");

	$("#contact-form .submit a").click(function () { 
	  $("form").submit(); 
    });
	
	$("form").submit(function(){

		var str = $("form").serialize();
		
		$.ajax({
		type: "POST",
		url: "/scripts/contact/contact.php",
		data: str,
		success: function(msg){
		
			$("#note").ajaxComplete(function(event, request, settings){
			
				if(msg == 'OK') // Message Sent? Show the 'Thank You' message and hide the form
				{
				result = '<div class="notification_ok" style="color:#009900;">Your message has been sent.<br />Thank you!</div>';
				$("#fields").hide();
				}
				else
				{
				result = msg;
				}
				
				$(this).html(result);
			
			});
		}
		
		});

	return false;

	});
	
});