$(document).ready(function() {


$.fn.clearForm = function() {
  return this.each(function() {
 var type = this.type, tag = this.tagName.toLowerCase();
 if (tag == 'form')
   return $(':input',this).clearForm();
 if (type == 'text' || type == 'password' || tag == 'textarea')
   this.value = '';
 else if (type == 'checkbox' || type == 'radio')
   this.checked = false;
 else if (tag == 'select')
   this.selectedIndex = -1;
  });
};

$("#formular_button").click(function() {
send();
});


$("#formular").submit(function() {

return false;
});


function send() { 
var options = {
        target: '#feedback', success: 
		function() { 
		  
$('#feedback').fadeIn('slow');
if($('#feedback li').hasClass("success")){
	$('#formular').clearForm();
	}
// $('#formular').clearForm();
			
		 }
		 };
    // bind form using ajaxForm 
    $('#formular').ajaxSubmit(options);

	return false;
	
};
});
