﻿jQuery.fn.ajaxForm = function() 
{
    $(this).submit(function() 
    {
        var _url = $(this).attr('action');
		var _data = $(this).serialize();
		var _type = $(this).attr('method');
		var _form = this;
					
		$(this).find('.ui-state-error').removeClass('ui-state-error');
							
		$.ajax({ url: _url, type: _type, data: _data, dataType: 'xml', success: function(data){ processResponse(_form, data); }, error:function (xhr, ajaxOptions, thrownError){ alert(xhr.status); alert(thrownError); }});				
	    
	    return false;
    });
};

