$(document).ready(function(){

$('#commentForm').submit(function(){    
    var anketa = $('#commentForm input:radio:checked').val();
		if(anketa < 4){		   	
    $('#informator').html('<img src="/pic/images/loading.gif" /><span>Čakať / Wait...</span><div class="cleaner" />');
		$('.anketa_46').hide(1000);	

    $('#informator').show(250, function(){
        $.ajax({
            type: "POST",
            url: "/_ankety/server.php",
            data: "anketa=" + anketa + "&submit=true",
            timeout: 1000,

            success: function(msg){
                $('#informator span, #informator img').fadeOut(250, function(){
                    $('#informator')
                      .html('<span class="a52">Moment spracuvávam... / Please wait ...</span><div class="cleaner" />');
                });

                $('#informator span').fadeIn();

                timer = setTimeout(function(){
                    $('#informator').hide(250);
										$('.anketa_b').show(1000);
                }, 1000);
            },

										
            error: function(XMLHTTP, textstatus){
                switch (textstatus) {
                    case 'timeout':
                        alert('Server timeout!');
                        break;

                    case 'error':
                        alert(XMLHTTP.responseText);
                        break;
                }
            }
						
        });				
								

									
    });
    return false;
		}else{$('#informator').html('<span class="a52">Nevybraná voľba</span><div class="cleaner" />');}
});
				$.ajax({
				type: "GET",
				url: "/_ankety/a_novyweb_percento.php",
				data: "anketa=a",
				dataType: "text/html",
				success: function(html){$("#anketa_w1").html(html);}
  			});
				
														
				$.ajax({
				type: "GET",
				url: "/_ankety/a_novyweb_percento.php",
				data: "anketa1=a",	
				dataType: "text/html",
				success: function(html){$("#anketa_w2").html(html);}
  			});	
															
				$.ajax({
				type: "GET",
				url: "/_ankety/a_novyweb_percento.php",
				data: "anketa2=a",
				dataType: "text/html",
				success: function(html){$("#anketa_w3").html(html);}
  			});

});
