var $ = jQuery.noConflict();

$(document).ready(function(){
   $('#vote_course_submit').click(function(){
       $(this).stop()
       var url = '/pl/course/index/addpoint/id/'+$(this).val()+'/point/'+$('#vote_course_points').val();
       $.get(url,null,function(data){
           $("#gwiazdki img").each(function(id){
               if (id+1<=data) $(this).attr('src','/layouts/tm_aktualnosci/img/gwiazdka_pelna.jpg');
               else $(this).attr('src','/layouts/tm_aktualnosci/img/gwiazdka_pusta.jpg');
           });
       },'json');
       $(this).parent().html('Dziękujemy za oddanie głosu.');
       return false;
   })

   $('#recomendForm').livequery(function (){
		var options = { 
        dataType:  'html',
       	success: function(data){$('#recomendForm').parent().html(data)},
       	resetForm: true

    	};
		$(this).ajaxForm(options);
	});

});


