/**
 * @author BitArtis.pl
 */

$(document).ready(function() {
	$('div.sonda a.wyniki').click(function() {
		var id=$(this).attr('rel');
		$.ajax({
	        type: "GET",
	        url: "/index.php?ajax=1&module=sonda&id="+id,
	        cache: true,
	        success: function(info){
	            if (info) {
	           	 	$("div.sonda").html(info);
	             } else {
	           		$("div.sonda").html("Błąd..");
	             }
	         }
	   });//ajax
		return false;
	});
	
	$('div.sonda input[type=image].glosuj').click(function() {
		var id=$(this).attr('alt');
		//alert(id);
		var glos=$('div.sonda input:checked').attr('value');
		//alert(glos);
		$.ajax({
	        type: "GET",
	        url: "/index.php?ajax=1&module=sonda&id="+id+"&glos="+glos,
	        cache: true,
	        success: function(info){
	            if (info) {
	           	 	$("div.sonda").html(info);
	             } else {
	           		$("div.sonda").html("Błąd..");
	             }
	         }
	   });//ajax
		return false;
	});
	
});
