
function check_stream(ip)
{
$(document).ready(function() {
  $.ajax({
                        url: "puzzle/check_ip.php?ip="+ip,
                        type: 'get',
                        timeout: 15000,
                        success: function(retVal){
                         //$("#check").append(retVal);
                         if (retVal=='error'){
                         $(".jqPuzzle").hide();
                         $("#check").show(500);
                         }
                         
                                                  },
                        error: function()
                            {
                            alert();

                        }
                         })

 setTimeout(check_stream, 10000,ip);

});
}
function check_ip(ip,meno)
{
$(document).ready(function() {
  $.ajax({
                        url: "puzzle/insert_ip.php",
                        type: 'post',
                        data: 'ip=ip&meno=meno',
                        timeout: 15000,
                        success: function(retVal){
                       

                                                  },
                        error: function()
                            {
                           

                        }
                         })

 setTimeout(check_ip, 5000,ip,meno);

});
}
function odkazovac_bordel()
{
	window.parent.CB_Close();
}
 $(document).ready(function() {

$('.spust_hru').click(function () {
 zobraz_cas(0);
// $("#uvodny_spustac").fadeTo(12000,0);
 // $("#check").fadeTo(12000,0);
// $("#kocky").fadeTo(500,0);
});

var t;
function zobraz_cas(t)
{

//$(".spust_hru").hide();
//$("#cas").html("<div style='text-align:center;color:#044BA3;font-size:20px;padding-top:85px;padding-left:250px;'>"+t+"</div>");
//$("#uvodny_spustac").hide();

$("#uvodny_spustac").html("<font color=#044798>Loading...</font>\
<div style='margin:50px auto auto auto;width:500px;height:20px;background-color:white;'><div style='width:"+(t*50)+"px;height:20px;background-color:#00A2DF;'></div></div>");

if (t==10) window.location = "http://www.radio9.sk/index.php?action=puzzle2";

else setTimeout(function(){zobraz_cas(t+1);}, 1000 );
}


 Info_pesnicka();

 $('#tlac_pridaj_odkaz').click(function () {
                     $(this).fadeOut(500);
                      $('#pridaj_odkaz').fadeIn(1000);
                    });

  $('.odkazkomentovat').click(function () {
    var rel = $(this).attr("rel");
    var txt="<form action=index.php?action=forum&okomentovat="+rel+" method=post><table border=0 width=390><tr><td width=25% align=left>Meno</td><td width=1% nowrap></td><td class=nadpis><input type=text name=meno id=odkaz_osoba class=odkaz_input size=28></td></tr><tr><td class=odkaztext align=left style='vertical-align: top; padding-top: 5px;'><label for='odkaz_email' class='label'>Email</label></td><td width=3 nowrap></td><td class=nadpis><input type=text name='email' id='odkaz_email' class='odkaz_input' size='58'>      </td></tr><tr><td valign=top class=nadpis align=left><label for=odkaztext>Tvoj odkaz</label></td><td width=3 nowrap></td><td class=odkaztext><textarea name=text id=odkaz_text class=odkaz_textarea cols=60 rows=3></textarea></td></tr><tr><td colspan=3 class=odkaz_btn ><input type='submit' name='odkazokomentovat_submit' id='odkaz_okomentovat_submit' value='Pošli' ></td></tr></table></form>";
    $('#tu_komentuj_'+ rel).fadeIn(500).html('<div class=odkazkomentovat_prispevok_sipka></div><div class=odkazkomentovat_prispevok>'+ txt +'</div>');
  });
 



  $('#odkaz_submit').click(function () {
         var meno = $('#odkaz_osoba').val();
                   var text = $('#odkaz_text').val();
                   var email = $('#odkaz_email').val();
                   var error = 'Prosím vyplň:';
                   if (meno=='') error=error+' meno ';
                   if(error.length==19) error=error+' a ';
                   if (text=='') error=error+' text';
                   if (error.length>14) alert(error);
                   else
                   {
                        $.ajax({
                        url: "index.php?action=forum&subaction=ajax_pridat_odkaz",
                        type: 'post',
                         data: 'meno='+meno+'&email='+email+'&text='+text,
                        timeout: 15000,
                        success: function(retVal){
                         $("#novy_odkaz").html(retVal);
                         
                         $('#lista_tlacitka').fadeOut(1000);
                                                  },
                        error: function()
                            {
                            alert();

                        }
                         })
                    }
   return false;

               });



 $('#menu_pozadie li a').append('<span class="hover"></span>').each(function () {
                        var $span = $('> span.hover', this).css('opacity', 0);
                        $(this).hover(function () {
                            $span.stop().fadeTo(500, 1);
                        }, function () {
                            $span.stop().fadeTo(500, 0);
                        });
                    });

    function Info_pesnicka()
    {
        $.ajax({
            url: "../class/info_pesnicka.php",
            type: 'GET',
            timeout: 5000,
            success: function(retVal) {
                $("#prave_pocuvas").fadeOut(300);
                $("#prave_pocuvas").fadeIn(300).html(retVal);
            }
        })
        
        setTimeout(Info_pesnicka, 60000);
    }

});

