var game_data, flag = 0;
var $t, fp, at, xz;
//启动
$(function(){
})
function loadinfo() {
clearTimeout($t);
get_player();
$.post("/time.php", function (data) {
game_data = data;
autotime();
}, "json");
$t = setTimeout("loadinfo()", 5000);
}
function autotime() {
clearTimeout(fp);
endtime(game_data);
fp = setTimeout("autotime()", 1000);
}
function endtime(iTime) {
if (iTime <= 0) {
$(".app-btn").removeClass('flipTurn');
$('.open-radius').removeClass('hide');
$('#alertred').removeClass('show');
$('#open-wish').text('');
clearTimeout(fp);
clearTimeout($t);
loadinfo();
} else {
iTime--;
if (iTime > 6) {
$('.time span').text(iTime);
$('#btn-ok').addClass('btn-ok');
$("#btn-ok").removeAttr("disabled")
}
if (iTime == 29) {
get_fjjl();
$('.boxul').html("");
}
if (iTime <= 6 && iTime > 0) {
$('.time span').text(iTime);
$('#btn-ok').removeClass('btn-ok');
$("#btn-ok").attr("disabled", "disabled");
}
game_data = iTime;
}
}