var form = {
formid:'',
toupdate:'',
sendData: function() {
var _form = this;
var orig = _form.formid.html();
$.ajax({
type: 'post',
url: $(_form.formid).attr('action'),
data: $(_form.formid).serialize(),
beforeSend: function() {
_form.toupdate.addClass('progress');
},
success: function(response) {
_form.toupdate.removeClass('progress').html(response);
},
complete: function() {
setTimeout(function() {
_form.toupdate.fadeOut(100);
},9000);
_form.formid.html(orig);
}
})
}
}

