$(function() {updateProfit(); });
function validateBetSizeD(inp) {inp.value = inp.value.replace(/[,]/g, '.') .replace(/[^\d,.]*/g, '') .replace(/([,.])[,.]+/g, '$1') .replace(/^[^\d]*(\d+([.,]\d{0,2})?).*$/g, '$1'); if (inp.value > 95) {inp.value = 95; } }
function validateBetSizeD2(inp) {inp.value = inp.value.replace(/[,]/g, '.') .replace(/[^\d,.]*/g, '') .replace(/([,.])[,.]+/g, '$1') .replace(/^[^\d]*(\d+([.,]\d{0,2})?).*$/g, '$1'); if (inp.value > 50000) {inp.value = 50000; } }
function updateProfit() {$('#BetProfit').html(((100 / $('#BetPercent').val()) * $('#BetSize').val()).toFixed(2)); $('#MinRange').html(Math.floor(($('#BetPercent').val() / 100) * 999999)); $('#MaxRange').html(999999 - Math.floor(($('#BetPercent').val() / 100) * 999999)); $('#BetPercent').keyup(function() {$('#BetProfit').html(((100 / $('#BetPercent').val()) * $('#BetSize').val()).toFixed(2)); $('#MinRange').html(Math.floor(($('#BetPercent').val() / 100) * 999999)); $('#MaxRange').html(999999 - Math.floor(($('#BetPercent').val() / 100) * 999999)); }); $('#BetSize').keyup(function() {$('#BetProfit').html(((100 / $('#BetPercent').val()) * $('#BetSize').val()).toFixed(2)); $('#MinRange').html(Math.floor(($('#BetPercent').val() / 100) * 999999)); $('#MaxRange').html(999999 - Math.floor(($('#BetPercent').val() / 100) * 999999)); }); }
function post_rulet(name, data) {var str = ''; if (name!='exit') {$.each( data.split('.'), function(k, v) {str += '&' + v + '=' + $('#' + v).val(); }); } $.ajax({url: "/ajax/gogame.php", type: 'POST', data: {name: name, str: str}, cache: false, success: function(html) {obj = jQuery.parseJSON(html); $("#userBalance").html(obj.u_pay_money_new); if (obj.type=='success') {$('#error_bet').css('display', 'none'); $('#success_bet').css('display', ''); $("#success_bet").html(obj.message); }else{$('#success_bet').css('display', 'none'); $('#error_bet').css('display', ''); $("#error_bet").html(obj.message); } } }); }
function load_20_games() {$.ajax({url : '/ajax/gamer.php', type: 'POST', cache: false, success: function(result) {obj = jQuery.parseJSON(result); $('.story_app').html(obj.html); $('#userss').html(obj.users); $('#onluses').html(obj.usonll); $('#gameonl').html(obj.gameonl); } }); }
window.onload = function() {setInterval( load_20_games, 700 );}
function bonus_go() {$.ajax({url: "/ajax/bonus.php", type: 'POST', data: {}, cache: false, success: function(html) {obj = jQuery.parseJSON(html); $("#userBalance").html(obj.u_pay_money_new); if (obj.type=='success') {$('#error_bet').css('display', 'none');$('#popoln').css('display', 'none'); $('#referal').css('display', 'none'); $('#vivod').css('display', 'none'); $('#game').css('display', ''); $('.bonus').css('display', 'none'); $('#success_bet').css('display', ''); $("#success_bet").html(obj.message); }else{$('#success_bet').css('display', 'none'); $('.bonus').css('display', 'none'); $('#error_bet').css('display', ''); $("#error_bet").html(obj.message); } } }); }
function popoln(){ $('#vivod').css('display', 'none'); $('#statgame').css('display', 'none'); $('#game').css('display', 'none'); $('#referal').css('display', 'none'); $('#popoln').css('display', ''); }
function deposit() {if ( $('#depositSize').val() == ''){$('#error_bet2').show(); return $('#error_bet2').html('Введите сумму'); } if (!$.isNumeric($('#depositSize').val())){$('#error_bet2').show(); return $('#error_bet2').html('Введите корректную сумму'); } $.ajax({type: 'POST', url: '/ajax/popol.php', data: {type: 'deposit', size: $('#depositSize').val() }, success: function(data) {var obj = jQuery.parseJSON(data); if (obj.type == 'success') {window.location.href = obj.location; } } }); }
function referal() { $('#vivod').css('display', 'none'); $('#statgame').css('display', 'none'); $('#popoln').css('display', 'none'); $('#game').css('display', 'none'); $('#referal').css('display', ''); }
function vivod(){$('#popoln').css('display', 'none'); $('#statgame').css('display', 'none'); $('#game').css('display', 'none'); $('#referal').css('display', 'none'); $('#vivod').css('display', ''); }
function withdraw() {if ($('#rekvv').val() == '' || $('#summa').val() == '' || $('#namepl').val() == '') {$('#error_bet3').show(); return $('#error_bet3').html('Заполните все поля'); } $.ajax({type: 'POST', url: '/ajax/vivod.php', data: {type: 'addvivod', namepl: $('#namepl').val(), rekvv: $('#rekvv').val(), summa: $('#summa').val() }, success: function(data) {var obj = jQuery.parseJSON(data); if(obj.type == 'success'){$('#error_bet3').hide(); $("#userBalance").html(obj.u_pay_money_new); var tt = $('#withdrawT').html(); $('#withdrawT').html(obj.add + tt); }else{$('#error_bet3').show(); return $('#error_bet3').html(obj.message); } } }); }
function removeWithdraw(id) {$.ajax({type: 'POST', url: '/ajax/vivod.php', data: {type: 'removeWithdraw', id: id }, success: function(data) {var obj = jQuery.parseJSON(data); if(obj.type == 'success'){$('#' + id + '_his').fadeOut('slow'); $("#userBalance").html(obj.u_pay_money_new); }else{$('#error_bet3').show(); return $('#error_bet3').html(obj.message); } } }); }
function autos(){$('#aut').css('display', 'none'); $('#error_bet3').css('display', 'none'); $('#regas').css('display', 'none'); $('#statgame').css('display', 'none'); $('#gamerstat').css('display', 'none'); $('#autos').css('display', ''); }
function regas(){$('#aut').css('display', 'none'); $('#error_bet3').css('display', 'none'); $('#regas').css('display', ''); $('#autos').css('display', 'none'); $('#statgame').css('display', 'none'); $('#gamerstat').css('display', 'none'); }
function okregas(){
if ($('#email2').val() == '' || $('#password2').val() == '' || $('#login2').val() == '' || $('#vcaptcha2').val() == '') {
$('#error_bet3').show();
return $('#error_bet3').html('Заполните все поля');
}
$.ajax({
type: 'POST',
url: '/ajax/aut.php',
data: {
type: 'regas',
captcha: $('#vcaptcha2').val(),
login: $('#login2').val(),
email: $('#email2').val(),
password: $('#password2').val()
},
success: function(data) {
var obj = jQuery.parseJSON(data);
if(obj.type == 'success'){
$('#error_bet3').hide();
window.location.href = obj.location;
}else if(obj.type == 'error'){
$('#error_bet3').show();
$('#error_bet3').html(obj.message);
}
}
});
}
function okautos(){if ($('#email').val() == '' || $('#password').val() == '' || $('#vcaptcha').val() == '') {$('#error_bet3').show(); return $('#error_bet3').html('Заполните все поля'); } $.ajax({type: 'POST', url: '/ajax/aut.php', data: {type: 'auts', captcha: $('#vcaptcha').val(), email: $('#email').val(), password: $('#password').val() }, success: function(data) {var obj = jQuery.parseJSON(data); if(obj.type == 'success'){$('#error_bet3').hide(); window.location.href = obj.location; }else if(obj.type == 'error'){$('#error_bet3').show(); $('#error_bet3').html(obj.message); } } }); }