
var initContactForm = function(){
  var nombre = $.trim($('input#nombre').attr('value'));
  var email = $.trim($('input#email').attr('value'));
  var mensaje = $.trim($('textarea#mensaje').attr('value'));
  
  $('input#nombre').focus(function(){
    if ($.trim($(this).val()) === nombre){ $(this).val(''); }
  });
  
  $('input#email').focus(function(){
    if ($.trim($(this).val()) === email){ $(this).val(''); }
  });
  
  $('textarea#mensaje').focus(function(){
    if ($.trim($(this).val()) === mensaje){ $(this).val(''); }
  });
  
  $('input#nombre').focusout(function(){
    if ($.trim($(this).val()) === ''){ $(this).val(nombre); }
  });
  
  $('input#email').focusout(function(){
    if ($.trim($(this).val()) === ''){ $(this).val(email); }
  });
  
  $('textarea#mensaje').focusout(function(){
    if ($.trim($(this).val()) === ''){ $(this).val(mensaje); }
  });

  
}

$(document).ready(function(){
  initContactForm();
});
