/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


 $(function(){
    $("#ajax").ajaxForm({
      dataType: 'script',
      beforeSend: function(xhr) {xhr.setRequestHeader("Accept", "text/javascript");},
      success:       showResponse //,
      //resetForm: true
    });

  });
  function showResponse(responseText, statusText)  {
    $("#error").fadeIn("slow");
    $('#error').html("");
    $.each(eval(responseText),function(index, item)
    {
      $('#error').append(item+"<br \/>" );
      $("#webform_"+item.split(" ")[0].toLowerCase()).css("border","2px solid #ff0000");
    });
  }

  $(function(){
    $("#error").click(function(){
     $("#error").hide("slow");
    });
  });