if (!(/msie [6|7|8|9]/i.test(navigator.userAgent))){ new WOW().init(); }; $(".go_top").click(function(e){ $("html,body").animate({scrollTop:$("html,body").offset().top},500); }); $(document).ready(function(){ $("#navig_name1 , .Games").hover(function(){ $(".Games").show(); $("#navig_name1 a").css('color','#00a018'); },function(){ $(".Games").hide(); $("#navig_name1 a").css('color','#666666'); }); $("#navig_name2 , .Results").hover(function(){ $(".Results").show(); $("#navig_name2 a").css('color','#00a018'); },function(){ $(".Results").hide(); $("#navig_name2 a").css('color','#666666'); }); $("#navig_name3 , .About").hover(function(){ $(".About").show(); $("#navig_name3 a").css('color','#00a018'); },function(){ $(".About").hide(); $("#navig_name3 a").css('color','#666666'); }); $("#navig_name4 , .Help").hover(function(){ $(".Help").show(); $("#navig_name4 a").css('color','#00a018'); },function(){ $(".Help").hide(); $("#navig_name4 a").css('color','#666666'); }); }); function loadball5 () { $( ".ball5result" ).css ("display" , "none"); $( ".ball5result" ).load( "ajax/ball5.php?token=a46b6b588543109f13ff64b2bf1104f0", function() { $( ".ball5result" ).fadeIn(300); }); } function loadball8 () { $( ".ball8result" ).css ("display" , "none"); $( ".ball8result" ).load( "ajax/ball8.php?token=a46b6b588543109f13ff64b2bf1104f0", function() { $( ".ball8result" ).fadeIn(300); }); } function loadball10 () { $( ".ball10result" ).css ("display" , "none"); $( ".ball10result" ).load( "ajax/ball10.php?token=a46b6b588543109f13ff64b2bf1104f0", function() { $( ".ball10result" ).fadeIn(300); }); } function loadball20 () { $( ".ball20result" ).css ("display" , "none"); $( ".ball20result" ).load( "ajax/ball20.php?token=a46b6b588543109f13ff64b2bf1104f0", function() { $( ".ball20result" ).fadeIn(300); }); } var timeLeft1; var timeLeft2; var timeLeft3; var timeLeft4; function convertTime (num) { var shownum = String (num); var countnum = shownum.length; if (countnum == 1) { shownum = "0" + shownum; return shownum; } else { return shownum; } } function countdown (sec,countdiv) { var minute = sec /60; minute = Math.floor(minute); if (minute == 0) { var showminute = "00"; } else { var showminute = String (minute); showminute = convertTime (showminute); } var second = sec - (minute * 60); var showsec = convertTime (second); if (sec < 0) { $(".countdown" + countdiv).html ("00:00"); } else { $(".countdown" + countdiv).html (showminute + ":" + showsec); } } function timeleft () { if (timeLeft1 == 0) { countdown (timeLeft1, "1"); setTimeout(function(){ loadball5 (); }, 14000); } else { countdown (timeLeft1, "1"); } if (timeLeft2 == 0) { countdown (timeLeft2, "2"); setTimeout(function(){ loadball8 (); }, 16000); } else { countdown (timeLeft2, "2"); } if (timeLeft3 == 0) { countdown (timeLeft3, "3"); setTimeout(function(){ loadball10 (); }, 18000); } else { countdown (timeLeft3, "3"); } if (timeLeft4 == 0) { countdown (timeLeft4, "4"); setTimeout(function(){ loadball20 (); }, 26000); } else { countdown (timeLeft4, "4"); } timeLeft1 --; timeLeft2 --; timeLeft3 --; timeLeft4 --; } setInterval(function(){ timeleft(); }, 1000); loadball5 (); loadball8 (); loadball10 (); loadball20 ();