

(function($) {$.fn.jooria_comment = function(url){
    $(this).click(function() {
	
    //this the data that we will sent it 
    var name = $("#name").val();
    var mail = $("#mail").val();
    var comment = $("#comment").val();
    var dataString = 'name='+ name +'&mail='+ mail +'&comment='+ comment;
	
    //cool load system
    $("button.submit").addClass('load');
    $("button.submit").text('');
    
    //post it now
    $.ajax({
    type: "POST",
    url: url,	
    data: dataString,
    cache: false,
    success: function(html){
    //this work on non-repeat the errors 
    var error = $("ul#list li:last").attr("class");
    if ( error == "error"){$("ul#list li:last").remove();}
    
    //if there is no comments
    $("div#nocom").replaceWith("<ul id='list'></ul>");
	
	//$("ul#list").append(html);
    $('.new').html(html);
	$("ul#list li:last").fadeIn("slow");
    
    //restore the load to the normal
    $("button.submit").removeClass('load');
    //$("button.submit").text('Köszönjük');

    }}
    );

    return false;
});
};
})(jQuery);

