$(document).ready(function(){
$("#contact_form").submit(function(){

var str = $(this).serialize();

   $.ajax({
   type: "POST",
   url: "contact_form.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">Your message has been sent. Thank you!</div>';
$("#contact_form").hide();
}
else
{
result = msg;
}

$(this).html(result);

});

}

 });
   
return false;

});

$(document).ready(function() {
    $('input[type="text"],textarea').addClass("idleField");
	$('input[type="text"],textarea').focus(function() {
		$(this).removeClass("idleField").addClass("focusField");
        if (this.value == this.defaultValue){
        	this.value = '';
    	}
        if(this.value != this.defaultValue){
	    	this.select();
        }
    });
    $('input[type="text"],textarea').blur(function() {
    	$(this).removeClass("focusField").addClass("idleField");
        /*if ($.trim(this.value == '')){
        	this.value = (this.defaultValue ? this.defaultValue : '');
    	}*/
    });
	
});

});
