Guest User

Untitled

a guest
Jan 7th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 226.21 KB | None | 0 0
  1. var stop_autobet = false;
  2. var autobet_dnr = false;
  3. var autobet_running = false;
  4. var free_play_sound = false;
  5. var detached_captcha;
  6. var autobet_history = [];
  7. var submissionEnabled = true;
  8. var bet_history_page = 0;
  9. var jackpot_costs = ["", "0.00000002", "0.00000013", "0.00000125", "0.00001250", "0.00012500"];
  10. var se_msg_timeout_id;
  11. var bonus_table_closed = 0;
  12. var hide_pending_payments = 0;
  13. var hide_pending_deposits = 0;
  14. var profile_withdraw_address = "";
  15. var withdraw_max_amount = 0;
  16. eval("var " + window[tcGiQefA] + " = ''");
  17. var balance_last_changed = 0;
  18. $.ajaxSetup({
  19. data: {
  20. csrf_token: $.cookie('csrf_token')
  21. },
  22. beforeSend: function(xhr) {
  23. xhr.setRequestHeader('x-csrf-token', $.cookie('csrf_token'));
  24. },
  25. timeout: 120000
  26. });
  27. $.extend({
  28. redirectPost: function(location, args) {
  29. var form = '';
  30. $.each(args, function(key, value) {
  31. form += '<input type="hidden" name="' + key + '" value="' + value + '">';
  32. });
  33. $('<form action="' + location + '" method="POST">' + form + '</form>').appendTo('body').submit();
  34. }
  35. });
  36. $(document).ready(function() {
  37. if (!Date.now) {
  38. Date.now = function() {
  39. return new Date().getTime();
  40. }
  41. }
  42. $.get('/cgi-bin/fp_check.pl?s=' + tcGiQefA, function(data) {
  43. var hash = CryptoJS.SHA256(data).toString(CryptoJS.enc.Hex);
  44. window[tcGiQefA] = hash;
  45. });
  46. $("#hide_site_message").click(function() {
  47. $('#common_site_message').hide();
  48. $.get('/?op=hide_site_message');
  49. });
  50. $("#hide_payout_message").click(function() {
  51. $('#common_payout_message').hide();
  52. $.get('/?op=hide_payout_message');
  53. });
  54. charSet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
  55. var randomString = '';
  56. for (var i = 0; i < 16; i++) {
  57. var randomPoz = Math.floor(Math.random() * charSet.length);
  58. randomString += charSet.substring(randomPoz, randomPoz + 1);
  59. }
  60. $('#next_client_seed').val(randomString);
  61. $('.tabs a').click(function() {
  62. if ($(this).attr('id') != "mining_link") {
  63. $('.tabs li').removeClass('active');
  64. $(this).parent().addClass('active');
  65. }
  66. });
  67. $('#free_play_link_li').addClass('active');
  68. $('#faq_tab').on('load', function() {
  69. $('.faq_answer').hide();
  70. });
  71. $('#faq_tab').on('click', '.faq_question', function() {
  72. $(this).next('.faq_answer').show();
  73. });
  74. $('#what_is_bitcoin_signup_page_read_more_link').click(function() {
  75. $('#what_is_bitcoin_signup_page_read_more_link').hide();
  76. $('#what_is_bitcoin_signup_page_more').show();
  77. insertBitcoinMore("what_is_bitcoin_signup_page_more", "afterBegin");
  78. });
  79. $('#provably_fair_link').click(function() {
  80. $("html, body").animate({
  81. scrollTop: $("#provably_fair").offset().top - 45
  82. }, "fast");
  83. });
  84. $('#auto_withdraw').change(function() {
  85. var $input = $(this);
  86. var val = 0;
  87. if ($input.is(":checked")) {
  88. val = 1;
  89. $('#earn_btc_aw_msg').show();
  90. $('#earn_btc_msg').show();
  91. $('#hide_earn_btc_msg').hide();
  92. } else {
  93. $('#hide_earn_btc_msg').show();
  94. $('#earn_btc_aw_msg').hide();
  95. }
  96. $.get('/?op=toggle_auto_withdraw&val=' + val, function(data) {
  97. var result = data.split(":");
  98. DisplaySEMessage(result[0], result[1]);
  99. if (result[0] == "e" && val == 1) {
  100. $('#earn_btc_aw_msg').hide();
  101. $('#hide_earn_btc_msg').show();
  102. $('#auto_withdraw').attr('checked', false);
  103. }
  104. });
  105. });
  106. $('#earn_btc_disable_aw').click(function() {
  107. $.get('/?op=toggle_auto_withdraw&val=0', function(data) {
  108. $('#earn_btc_aw_msg').hide();
  109. DisplaySEMessage("s", "Auto-withdraw disabled");
  110. $('#auto_withdraw').attr('checked', false);
  111. $('#hide_earn_btc_msg').show();
  112. });
  113. });
  114. $("#signup_form").submit(function(event) {
  115. event.preventDefault();
  116. $("#signup_button").prop("disabled", true);
  117. var $form = $(this);
  118. setTimeout(function() {
  119. var fingerprint = $.fingerprint();
  120. var tag = $.url().param("tag");
  121. var op = $form.find('input[name="op"]').val(),
  122. referrer = $form.find('input[name="referrer"]').val(),
  123. btc_address = $form.find('input[name="btc_address"]').val(),
  124. password = $form.find('input[name="password"]').val(),
  125. email = $form.find('input[name="email"]').val(),
  126. token = $form.find('input[name="token"]').val(),
  127. url = $form.attr('action');
  128. var post_variables = {
  129. op: op,
  130. btc_address: btc_address,
  131. password: password,
  132. email: email,
  133. fingerprint: fingerprint,
  134. referrer: referrer,
  135. tag: tag,
  136. token: token
  137. };
  138. if ($("#signup_recaptcha").find('#g-recaptcha-response').val() && $("#signup_recaptcha").find('#g-recaptcha-response').val().length > 0) {
  139. post_variables['g_recaptcha_response'] = $("#signup_recaptcha").find('#g-recaptcha-response').val();
  140. }
  141. if ($('#captchasnet_signup_captcha .captchasnet_captcha_input_box').val() && $('#captchasnet_signup_captcha .captchasnet_captcha_input_box').val().length > 0) {
  142. post_variables['captchasnet_random'] = $('#captchasnet_signup_captcha .captchasnet_captcha_random').val();
  143. post_variables['captchasnet_response'] = $('#captchasnet_signup_captcha .captchasnet_captcha_input_box').val();
  144. }
  145. if ($('#captchasnet_signup_captcha2 .captchasnet_captcha_input_box').val() && $('#captchasnet_signup_captcha2 .captchasnet_captcha_input_box').val().length > 0) {
  146. post_variables['captchasnet_random2'] = $('#captchasnet_signup_captcha2 .captchasnet_captcha_random').val();
  147. post_variables['captchasnet_response2'] = $('#captchasnet_signup_captcha2 .captchasnet_captcha_input_box').val();
  148. }
  149. if ($("#signup_solvemedia").find('#adcopy_response').val() && $("#signup_solvemedia").find('#adcopy_response').val().length > 0) {
  150. post_variables['solvemedia_challenge'] = $("#signup_solvemedia").find('#adcopy_challenge').val();
  151. post_variables['solvemedia_response'] = $("#signup_solvemedia").find('#adcopy_response').val();
  152. }
  153. if ($('#securimage_signup_captcha .captchasnet_captcha_input_box').val() && $('#securimage_signup_captcha .captchasnet_captcha_input_box').val().length > 0) {
  154. post_variables['securimage_random'] = $('#securimage_signup_captcha .captchasnet_captcha_random').val();
  155. post_variables['securimage_response'] = $('#securimage_signup_captcha .captchasnet_captcha_input_box').val();
  156. }
  157. if ($('#botdetect_signup_captcha .captchasnet_captcha_input_box').val() && $('#botdetect_signup_captcha .captchasnet_captcha_input_box').val().length > 0) {
  158. post_variables['botdetect_random'] = $('#botdetect_signup_captcha .captchasnet_captcha_random').val();
  159. post_variables['botdetect_response'] = $('#botdetect_signup_captcha .captchasnet_captcha_input_box').val();
  160. }
  161. var posting = $.post(url, post_variables);
  162. posting.done(function(data) {
  163. var result = data.split(":");
  164. if (result[0] == "e") {
  165. DisplaySEMessage(result[0], result[1]);
  166. if ($("#signup_recaptcha") && $("#signup_recaptcha").length > 0) {
  167. if (typeof grecaptcha !== 'undefined') {
  168. grecaptcha.reset();
  169. }
  170. }
  171. if ($("#captchasnet_signup_captcha") && $("#captchasnet_signup_captcha").length > 0) {
  172. GenerateCaptchasNetCaptcha('captchasnet_signup_captcha', 0);
  173. }
  174. if ($("#captchasnet_signup_captcha2") && $("#captchasnet_signup_captcha2").length > 0) {
  175. GenerateCaptchasNetCaptcha('captchasnet_signup_captcha2', 0);
  176. }
  177. if ($("#signup_solvemedia") && $("#signup_solvemedia").length > 0) {
  178. if (typeof ACPuzzle !== 'undefined') {
  179. ACPuzzle.reload();
  180. }
  181. }
  182. if ($("#securimage_signup_captcha") && $("#securimage_signup_captcha").length > 0) {
  183. GenerateCaptchasNetCaptcha('securimage_signup_captcha', 2);
  184. }
  185. if ($("#botdetect_signup_captcha") && $("#botdetect_signup_captcha").length > 0) {
  186. GenerateCaptchasNetCaptcha('botdetect_signup_captcha', 3);
  187. }
  188. } else if (result[0] == "s") {
  189. $.cookie.raw = true;
  190. $.cookie('btc_address', result[1], {
  191. expires: 3650,
  192. secure: true
  193. });
  194. $.cookie('password', result[2], {
  195. expires: 3650,
  196. secure: true
  197. });
  198. $.cookie('have_account', 1, {
  199. expires: 3650,
  200. secure: true
  201. });
  202. window.location.replace("http://freebitco.in/?op=home");
  203. }
  204. $("#signup_button").prop("disabled", false);
  205. });
  206. }, 0);
  207. });
  208. $('.captchasnet_captcha_info').hover(function() {
  209. $(this).find('.captchasnet_captcha_info_span, .arrow-up, .arrow-up-small').show();
  210. }, function() {
  211. $(this).find('.captchasnet_captcha_info_span, .arrow-up, .arrow-up-small').hide();
  212. });
  213. $("#login_button").click(function(event) {
  214. $("#login_button").prop("disabled", true);
  215. var posting = $.post('/', {
  216. op: 'login_new',
  217. btc_address: $("#login_form_btc_address").val(),
  218. password: $("#login_form_password").val(),
  219. tfa_code: $("#login_form_2fa").val()
  220. });
  221. posting.done(function(data) {
  222. var result = data.split(":");
  223. if (result[0] == "e") {
  224. DisplaySEMessage(result[0], result[1]);
  225. } else if (result[0] == "s") {
  226. $.cookie.raw = true;
  227. $.cookie('btc_address', result[1], {
  228. expires: 3650,
  229. secure: true
  230. });
  231. $.cookie('password', result[2], {
  232. expires: 3650,
  233. secure: true
  234. });
  235. $.cookie('have_account', 1, {
  236. expires: 3650,
  237. secure: true
  238. });
  239. window.location.replace("http://freebitco.in/?op=home");
  240. }
  241. $("#login_button").prop("disabled", false);
  242. });
  243. });
  244. $("#reset_2fa_form_submit").click(function(event) {
  245. $("#reset_2fa_form_submit").prop("disabled", true);
  246. var posting = $.post('/', {
  247. op: 'login_new',
  248. type: 'reset_2fa',
  249. subtype: $("#reset_2fa_subtype").val(),
  250. btc_address: $("#forgot_2fa_email").val(),
  251. password: $("#forgot_2fa_password").val(),
  252. forgot_2fa_extra_input: $("#forgot_2fa_extra_input").val(),
  253. });
  254. posting.done(function(data) {
  255. var result = data.split(":");
  256. DisplaySEMessage(result[0], result[1]);
  257. $("#reset_2fa_form_submit").prop("disabled", false);
  258. if ($("#reset_2fa_subtype").val() == "mobile_ver" && $('#forgot_2fa_secret_key_container_div').is(':hidden') && result[0] == "s") {
  259. $('#forgot_2fa_secret_key_container_div').show();
  260. $('#forgot_2fa_extra_input').val('');
  261. $('#forgot_2fa_extra_field').html('VERIFICATION CODE');
  262. }
  263. });
  264. });
  265. $("#enable_2fa_msg").click(function() {
  266. SwitchPageTabs('edit');
  267. $("html, body").animate({
  268. scrollTop: $("#2fa_profile_box").offset().top - 45
  269. }, "fast");
  270. $("#2fa_profile_box").click();
  271. });
  272. $("#advertise_imp_note").click(function(event) {
  273. alert("Please note that the balance in your advertising account is non-refundable and cannot be transferred to your main account balance on the website so only send/transfer in what you intend to use.");
  274. });
  275. $(".free_play_link").click(function(event) {
  276. SwitchPageTabs('free_play');
  277. });
  278. $(".double_your_btc_link").click(function(event) {
  279. SwitchPageTabs('double_your_btc');
  280. });
  281. $(".lottery_link").click(function(event) {
  282. SwitchPageTabs('lottery');
  283. $('.tabs li').removeClass('active');
  284. $('.tabs li').find('.lottery_link').parent().addClass('active');
  285. UpdateLotteryStats();
  286. });
  287. $(".faq_link").click(function(event) {
  288. SwitchPageTabs('faq');
  289. document.getElementById("faq_tab").insertAdjacentHTML("afterBegin", '<h3>WEBSITE FAQ</h3><p class="faq_question bold">When will I get paid if I have Auto Withdraw enabled?</p><div class="faq_answer"><p>If you have Auto-Withdraw enabled in your account, your account balance will go into PENDING on Sunday (if it is more than the min. withdraw amount) and you will be able to see this under PENDING PAYOUT on the FREE BTC page. The Bitcoins will be sent to your Bitcoin wallet soon after. You will receive an email notifying you of the payment if you have an email address associated with your account. If you wish to know the exact time when your balance will go into pending, click on the button that says <b>WITHDRAW</b> in the <b>FREE BTC</b> page and then click on <b>AUTO</b> and you will see a timer counting down to the payout time.</p></div><p class="faq_question bold">How do I enable Auto Withdraw?</p><div class="faq_answer"><p>By clicking on the button that says <b>WITHDRAW</b> in the <b>FREE BTC</b> page, then clicking on <b>AUTO</b> and checking the box next to <b>AUTO WITHDRAW</b>. If you enable auto-withdraw after the countdown timer has run out for the current payout cycle, you will receive your payment the next week.</p></div><p class="faq_question bold">When will I get paid if I have requested a Manual Withdraw?</p><div class="faq_answer"><p>If you request a manual withdrawal, the Bitcoins will be sent to your wallet within 6 hours of you initiating the request.</p></div><p class="faq_question bold">When will I get paid if I have requested an Instant Withdraw?</p><div class="faq_answer"><p>If you request an instant withdrawal, the Bitcoins will be sent to your wallet within 15 minutes of you initiating the request.</p></div><p class="faq_question bold">How can I change my Bitcoin address or Email address?</p><div class="faq_answer"><p>By clicking on the button that says <b>PROFILE</b> in the top menu. You will be able to change your email address only if the email that is currently attached to your account is invalid or it is bouncing our emails back.</p></div><p class="faq_question bold">Where can I see my referral link or my referrals?</p><div class="faq_answer"><p>By clicking on the button that says <b>REFER</b> in the top menu.</p></div><p class="faq_question bold">How do I refer my friends?</p><div class="faq_answer"><p>Share your referral link with your friends and ask them to visit it and create an account. On doing so, they will be automatically added as your referral and you will get 50% of their free btc winnings as commission! Nothing will be deducted from their account, we pay the 50% out of our pocket. You will also receive 1 free ticket to our weekly lottery every time your friend plays a free roll! If you do not know how to get your referral link, please see the question above.</p></div><p class="faq_question bold">I have lost/wish to reset my password?</p><div class="faq_answer"><p>Please go to the login page and click on the link that says <b>Forgot Password</b> in the login box.</p></div><p class="faq_question bold">Why does the amount of Bitcoins that you can win, keep changing?</p><div class="faq_answer"><p>The amount of bitcoins that you can win with <b>FREE BTC</b> depends on the current bitcoin price and the biggest prize is fixed at US$200 and the other prizes in proportion to it. So, when the price of a bitcoin goes down, the reward amount calculated in bitcoins goes up and the other way round is also true. So, regardless of the current bitcoin price, you have a fair chance of winning US$200 in bitcoins on each roll.</p></div><p class="faq_question bold">Can you reverse a payment that has already been sent?</p><div class="faq_answer"><p>Unfortunately bitcoin payments are irreversible and so once a payment has been sent, we have no way of getting it back. You should ensure that the correct withdrawal address is specified in the <b>PROFILE</b> page before requesting a payment or enabling auto-withdraw.</p></div><p class="faq_question bold">Where can I check my activity on this website?</p><div class="faq_answer"><p>By clicking on <b>STATS</b> in the above menu and then on <b>PERSONAL STATS</b>.</p></div><p class="faq_question bold">How can I keep my account secure?</p><div class="faq_answer"><p>By using a strong password, not re-using the same password on any other website and not sharing your password with anybody else. We recommend using a password manager like <a href="https://lastpass.com/" target=_blank>LastPass</a> to create and store your passwords. If you do not use these security practices and your account gets hacked, we shall not be able to help you.</p></div><p class="faq_question bold">How can I contact you?</p><div class="faq_answer"><p>By filling in the form below. Please read the questions above before sending us an email. We receive hundreds of emails everyday and do not have the resources to reply to all of them, so we have a policy of not responding to emails asking questions that have already been answered on this page.</p>');
  290. insertBitcoinMore("faq_tab", "beforeEnd");
  291. });
  292. $(".refer_link").click(function(event) {
  293. SwitchPageTabs('refer');
  294. });
  295. $(".rewards_link").click(function(event) {
  296. $('.tabs li').removeClass('active');
  297. $('.tabs li').find('.rewards_link').parent().addClass('active');
  298. SwitchPageTabs('rewards');
  299. });
  300. $(".earn_btc_link").click(function(event) {
  301. $('.tabs li').removeClass('active');
  302. $('.tabs li').find('.earn_btc_link').parent().addClass('active');
  303. SwitchPageTabs('earn_btc');
  304. });
  305. $(".edit_link").click(function(event) {
  306. SwitchPageTabs('edit');
  307. });
  308. $(".news_link").click(function(event) {
  309. SwitchPageTabs('news');
  310. });
  311. $(".advertise_link").click(function(event) {
  312. SwitchPageTabs('advertise');
  313. $('ul.tabs li').removeClass('active');
  314. $('#advertise_link_li').addClass('active');
  315. });
  316. $(".advertise_link_stats").click(function(event) {
  317. window.location.replace("http://freebitco.in/?op=home&tab=advertise");
  318. });
  319. $(".stats_link").click(function(event) {
  320. window.location.replace("http://freebitco.in/?op=stats");
  321. });
  322. $(".free_play_link_stats").click(function(event) {
  323. window.location.replace("http://freebitco.in/?op=home&tab=free_play");
  324. });
  325. $(".double_your_btc_link_stats").click(function(event) {
  326. window.location.replace("http://freebitco.in/?op=home&tab=double_your_btc");
  327. });
  328. $(".lottery_link_stats").click(function(event) {
  329. window.location.replace("http://freebitco.in/?op=home&tab=lottery");
  330. });
  331. $(".rewards_link_stats").click(function(event) {
  332. window.location.replace("http://freebitco.in/?op=home&tab=rewards");
  333. });
  334. $(".faq_link_stats").click(function(event) {
  335. window.location.replace("http://freebitco.in/?op=home&tab=faq");
  336. });
  337. $(".refer_link_stats").click(function(event) {
  338. window.location.replace("http://freebitco.in/?op=home&tab=refer");
  339. });
  340. $(".earn_btc_link_stats").click(function(event) {
  341. window.location.replace("http://freebitco.in/?op=home&tab=earn_btc");
  342. });
  343. $(".edit_link_stats").click(function(event) {
  344. window.location.replace("http://freebitco.in/?op=home&tab=edit");
  345. });
  346. $(".news_link_stats").click(function(event) {
  347. window.location.replace("http://freebitco.in/?op=home&tab=news");
  348. });
  349. $('#site_stats_button').click(function() {
  350. $('#personal_stats_button').show();
  351. $('#site_stats_button').hide();
  352. $('#site_stats').show();
  353. $('#personal_stats').hide();
  354. });
  355. $('#personal_stats_button').click(function() {
  356. $('#personal_stats_button').hide();
  357. $('#site_stats_button').show();
  358. $('#site_stats').hide();
  359. $('#personal_stats').show();
  360. });
  361. $("#double_your_btc_2x").click(function(event) {
  362. var bet = $("#double_your_btc_stake").val();
  363. var bonus_bal = parseFloat($("#bonus_account_balance").html());
  364. var bal = parseFloat($("#balance").html());
  365. var balance = parseFloat(Math.round((bonus_bal + bal) * 100000000) / 100000000).toFixed(8);
  366. if (bet * 2 <= balance) {
  367. if (bet * 2 * ($("#double_your_btc_payout_multiplier").val() - 1) <= max_win_amount) {
  368. $("#double_your_btc_stake").val(parseFloat(Math.round(bet * 2 * 100000000) / 100000000).toFixed(8));
  369. } else {
  370. $("#double_your_btc_stake").val(parseFloat(Math.round(max_win_amount / ($("#double_your_btc_payout_multiplier").val() - 1) * 100000000) / 100000000).toFixed(8));
  371. }
  372. } else {
  373. if (bet * 2 * ($("#double_your_btc_payout_multiplier").val() - 1) <= max_win_amount) {
  374. $("#double_your_btc_stake").val(balance);
  375. } else {
  376. $("#double_your_btc_stake").val(parseFloat(Math.round(max_win_amount / ($("#double_your_btc_payout_multiplier").val() - 1) * 100000000) / 100000000).toFixed(8));
  377. }
  378. }
  379. CalculateWinAmount();
  380. });
  381. $("#double_your_btc_half").click(function(event) {
  382. var bet = $("#double_your_btc_stake").val();
  383. var bonus_bal = parseFloat($("#bonus_account_balance").html());
  384. var bal = parseFloat($("#balance").html());
  385. var balance = parseFloat(Math.round((bonus_bal + bal) * 100000000) / 100000000).toFixed(8);
  386. if (bet * 0.5 <= balance) {
  387. if (bet * 0.5 * ($("#double_your_btc_payout_multiplier").val() - 1) <= max_win_amount) {
  388. $("#double_your_btc_stake").val(parseFloat(Math.round(bet * 0.5 * 100000000) / 100000000).toFixed(8));
  389. } else {
  390. $("#double_your_btc_stake").val(parseFloat(Math.round(max_win_amount / ($("#double_your_btc_payout_multiplier").val() - 1) * 100000000) / 100000000).toFixed(8));
  391. }
  392. } else {
  393. if (bet * 0.5 * ($("#double_your_btc_payout_multiplier").val() - 1) <= max_win_amount) {
  394. $("#double_your_btc_stake").val(balance);
  395. } else {
  396. $("#double_your_btc_stake").val(parseFloat(Math.round(max_win_amount / ($("#double_your_btc_payout_multiplier").val() - 1) * 100000000) / 100000000).toFixed(8));
  397. }
  398. }
  399. CalculateWinAmount();
  400. });
  401. $("#double_your_btc_max").click(function(event) {
  402. var conf = confirm("Are you sure you wish to bet the maximum amount? Click OK if you would like to proceed else click CANCEL.");
  403. if (conf == true) {
  404. var bet = $("#double_your_btc_stake").val();
  405. var bonus_bal = parseFloat($("#bonus_account_balance").html());
  406. var bal = parseFloat($("#balance").html());
  407. var balance = parseFloat(Math.round((bonus_bal + bal) * 100000000) / 100000000).toFixed(8);
  408. if (balance * ($("#double_your_btc_payout_multiplier").val() - 1) <= max_win_amount) {
  409. $("#double_your_btc_stake").val(balance);
  410. } else {
  411. $("#double_your_btc_stake").val(parseFloat(Math.round(max_win_amount / ($("#double_your_btc_payout_multiplier").val() - 1) * 100000000) / 100000000).toFixed(8));
  412. }
  413. CalculateWinAmount();
  414. }
  415. });
  416. $("#double_your_btc_min").click(function(event) {
  417. var bet = $("#double_your_btc_stake").val();
  418. var bonus_bal = parseFloat($("#bonus_account_balance").html());
  419. var bal = parseFloat($("#balance").html());
  420. var balance = parseFloat(Math.round((bonus_bal + bal) * 100000000) / 100000000).toFixed(8);
  421. if (balance >= 0.00000001) {
  422. $("#double_your_btc_stake").val('0.00000001');
  423. } else {
  424. $("#double_your_btc_stake").val('0.00000000');
  425. }
  426. CalculateWinAmount();
  427. });
  428. $("#double_your_btc_stake").keyup(function(event) {
  429. CalculateWinAmount();
  430. });
  431. $("#double_your_btc_stake").keydown(function(event) {
  432. $("#double_your_btc_stake").keyup();
  433. });
  434. $("#double_your_btc_stake").keypress(function(event) {
  435. $("#double_your_btc_stake").keyup();
  436. });
  437. $("#double_your_btc_stake").focusout(function(event) {
  438. $("#double_your_btc_stake").keyup();
  439. });
  440. $("#double_your_btc_bet_hi_button").click(function(event) {
  441. DoubleYourBTC('hi');
  442. });
  443. $("#double_your_btc_bet_lo_button").click(function(event) {
  444. DoubleYourBTC('lo');
  445. });
  446. $("#contact_form").submit(function(event) {
  447. event.preventDefault();
  448. $("#contact_form_button").attr("disabled", true);
  449. var $form = $(this),
  450. op = $form.find('input[name="op"]').val(),
  451. name = $form.find('input[name="name"]').val(),
  452. email = $form.find('input[name="email"]').val(),
  453. message = $form.find('textarea[name="message"]').val(),
  454. url = $form.attr('action');
  455. var posting = $.post(url, {
  456. op: op,
  457. name: name,
  458. email: email,
  459. message: message
  460. });
  461. posting.done(function(data) {
  462. var result = data.split(":");
  463. $('#contact_form_error').html("");
  464. $('#contact_form_error').hide();
  465. $('#contact_form_success').html("");
  466. $('#contact_form_success').hide();
  467. $('#contact_form_name').removeClass('input-error');
  468. $('#contact_form_email').removeClass('input-error');
  469. $('#contact_form_message').removeClass('input-error');
  470. if (result[0] == "e1") {
  471. $('#contact_form_error').show();
  472. $('#contact_form_error').html("Please enter your name");
  473. $('#contact_form_name').addClass('input-error');
  474. }
  475. if (result[0] == "e2") {
  476. $('#contact_form_error').show();
  477. $('#contact_form_error').html("Invalid email address entered");
  478. $('#contact_form_email').addClass('input-error');
  479. }
  480. if (result[0] == "e3") {
  481. $('#contact_form_error').show();
  482. $('#contact_form_error').html("Message must be atleast 10 characters");
  483. $('#contact_form_message').addClass('input-error');
  484. }
  485. if (result[0] == "s1") {
  486. $('#contact_form_success').show();
  487. $('#contact_form_success').html("Message sent successfully!");
  488. $('#contact_form_message').val('');
  489. }
  490. $("#contact_form_button").attr("disabled", false);
  491. });
  492. });
  493. $("#forgot_password_button").click(function(event) {
  494. $("#forgot_password_button").prop("disabled", true);
  495. var fingerprint = $.fingerprint();
  496. var posting = $.post('/', {
  497. op: 'forgot_password',
  498. email: $("#forgot_password_email").val(),
  499. captchasnet_random: $('#captchasnet_forgot_password_captcha .captchasnet_captcha_random').val(),
  500. captchasnet_response: $('#captchasnet_forgot_password_captcha .captchasnet_captcha_input_box').val(),
  501. fingerprint: fingerprint
  502. });
  503. posting.done(function(data) {
  504. var result = data.split(":");
  505. DisplaySEMessage(result[0], result[1]);
  506. $("#forgot_password_button").prop("disabled", false);
  507. GenerateCaptchasNetCaptcha('captchasnet_forgot_password_captcha', 0);
  508. });
  509. });
  510. $("#password_reset_form").submit(function(event) {
  511. event.preventDefault();
  512. $("#password_reset_form_button").attr("disabled", true);
  513. var a = $("#password_reset_form_btc_address").val();
  514. var s = $("#password_reset_form_signature").val();
  515. var m = $("#password_reset_form_message").val();
  516. var verified = verify_message(s, m);
  517. if (verified == a) {
  518. var $form = $(this),
  519. op = $form.find('input[name="op"]').val(),
  520. btc_address = $form.find('input[name="btc_address"]').val(),
  521. message = $form.find('input[name="message"]').val(),
  522. signature = $form.find('input[name="signature"]').val(),
  523. url = $form.attr('action');
  524. var posting = $.post(url, {
  525. op: op,
  526. btc_address: btc_address,
  527. message: message,
  528. signature: signature
  529. });
  530. posting.done(function(data) {
  531. $('#password_reset_message').hide();
  532. $('#password_reset_message').html("");
  533. $('#password_reset_message').removeClass('green');
  534. $('#password_reset_message').removeClass('red');
  535. if (data == "e1") {
  536. $('#password_reset_message').show();
  537. $('#password_reset_message').html("Invalid Bitcoin Address entered");
  538. $('#password_reset_message').addClass('red');
  539. }
  540. if (data == "e2") {
  541. $('#password_reset_message').show();
  542. $('#password_reset_message').html("Invalid Email Address");
  543. $('#password_reset_message').addClass('red');
  544. }
  545. if (data == "e3") {
  546. $('#password_reset_message').show();
  547. $('#password_reset_message').html("Signature cannot be blank");
  548. $('#password_reset_message').addClass('red');
  549. }
  550. if (data == "e4") {
  551. $('#password_reset_message').show();
  552. $('#password_reset_message').html("No account associated with this Bitcoin Address exists in our database");
  553. $('#password_reset_message').addClass('red');
  554. }
  555. if (data == "e5") {
  556. $('#password_reset_message').show();
  557. $('#password_reset_message').html("An account with this email address already exists. Please use the forgot password box above instead.");
  558. $('#password_reset_message').addClass('red');
  559. }
  560. if (data == "s1") {
  561. $('#password_reset_message').show();
  562. $('#password_reset_message').html("Password reset request queued. Please check your email inbox after 1 hour for the password reset link.");
  563. $('#password_reset_message').addClass('green');
  564. }
  565. });
  566. } else {
  567. $('#password_reset_message').show();
  568. $('#password_reset_message').html("Incorrect signature. Please follow the instructions for signing messages above and then try again.");
  569. $('#password_reset_message').addClass('red');
  570. }
  571. $("#password_reset_form_button").attr("disabled", false);
  572. });
  573. $("#change_password_button").click(function() {
  574. var posting = $.post('/', {
  575. op: 'change_password',
  576. old_password: $('#cp_old_password').val(),
  577. new_password: $('#cp_new_password').val(),
  578. repeat_new_password: $('#cp_repeat_new_password').val(),
  579. tfa_code: $('#cp_tfa_code').val()
  580. });
  581. posting.done(function(data) {
  582. var result = data.split(":");
  583. DisplaySEMessage(result[0], result[1]);
  584. if (result[0] == "s") {
  585. $.cookie.raw = true;
  586. $.cookie('password', result[2], {
  587. expires: 3650,
  588. secure: true
  589. });
  590. }
  591. });
  592. });
  593. $("#edit_profile_button").click(function() {
  594. var posting = $.post('/', {
  595. op: 'edit_profile',
  596. func: 'change_btc_address',
  597. new_btc_address: $('#edit_profile_form_btc_address').val(),
  598. password: $('#cba_password').val(),
  599. tfa_code: $('#cba_tfa_code').val()
  600. });
  601. posting.done(function(data) {
  602. var result = data.split(":");
  603. DisplaySEMessage(result[0], result[1]);
  604. if (result[2] == "s1") {
  605. $.cookie.raw = true;
  606. $.cookie('btc_address', result[3], {
  607. expires: 3650,
  608. secure: true
  609. });
  610. $('.withdraw_btc_address').html(result[3]);
  611. $('.withdraw_btc_address').val(result[3]);
  612. profile_withdraw_address = result[3];
  613. } else if (result[2] == "s2") {
  614. $('#edit_profile_form_btc_address').val(result[3]);
  615. }
  616. });
  617. });
  618. $("#change_email_button").click(function() {
  619. var posting = $.post('/', {
  620. op: 'edit_profile',
  621. func: 'change_email',
  622. new_email: $('#edit_profile_form_email').val(),
  623. password: $('#ce_password').val(),
  624. tfa_code: $('#ce_tfa_code').val()
  625. });
  626. posting.done(function(data) {
  627. var result = data.split(":");
  628. DisplaySEMessage(result[0], result[1]);
  629. });
  630. });
  631. $("#equal_share").click(function(event) {
  632. $("#weighted_share").attr("checked", false);
  633. $("#last_payout_share").attr("checked", false);
  634. });
  635. $("#weighted_share").click(function(event) {
  636. $("#equal_share").attr("checked", false);
  637. $("#last_payout_share").attr("checked", false);
  638. });
  639. $("#last_payout_share").click(function(event) {
  640. $("#equal_share").attr("checked", false);
  641. $("#weighted_share").attr("checked", false);
  642. });
  643. $('.footer_cur_year').html(new Date().getFullYear());
  644. $("#get_tag_stats").change(function() {
  645. var tag = $("#get_tag_stats").val();
  646. $.get('/?op=show_advanced_tag_stats&tag=' + tag, function(data) {
  647. $('#detailed_tag_stats_table').show();
  648. $('#detailed_tag_stats_table').find("tr:gt(0)").remove();
  649. $("#detailed_tag_stats_table").append(data);
  650. });
  651. });
  652. $("#main_to_adv_button").click(function(event) {
  653. var transfer_amt = $("#main_to_adv_amount").val();
  654. $("#main_to_adv_button").attr("disabled", true);
  655. $.get('/?op=transfer_from_main_to_adv&transfer_amount=' + transfer_amt, function(data) {
  656. var result = data.split(":");
  657. $('#main_to_adv_error').hide();
  658. $('#main_to_adv_success').hide();
  659. if (result[0] == "e1") {
  660. $('#main_to_adv_error').show();
  661. $('#main_to_adv_error').html("Unexpected error. Please log out and then log back in.");
  662. }
  663. if (result[0] == "e2") {
  664. $('#main_to_adv_error').show();
  665. $('#main_to_adv_error').html("Minimum amount that you can transfer is 0.00000001 BTC.");
  666. }
  667. if (result[0] == "e3") {
  668. $('#main_to_adv_error').show();
  669. $('#main_to_adv_error').html("Transfer amount cannot be greater than your main account balance.");
  670. }
  671. if (result[0] == "s1") {
  672. $('#main_to_adv_success').show();
  673. $('#main_to_adv_success').html(transfer_amt + " BTC successfully transferred.");
  674. $('#balance').html(parseFloat(parseInt(result[1]) / 100000000).toFixed(8));
  675. balanceChanged();
  676. $('#ad_balance').html(parseFloat(parseInt(result[2]) / 100000000).toFixed(8));
  677. }
  678. $("#main_to_adv_button").attr("disabled", false);
  679. });
  680. });
  681. $(".button").click(function() {
  682. $(this).blur();
  683. });
  684. $("#banner_image_button").click(function() {
  685. $('#ad_banner').click();
  686. });
  687. $('#ad_banner').bind('change', function() {
  688. var str = "";
  689. str = $(this).val();
  690. $("#banner_file_name").show();
  691. $("#banner_file_name").html('<small class="bold">' + str + '</small>');
  692. }).change();
  693. $('#ad_banner').bind('change', function() {
  694. $('#image_upload_error').hide();
  695. var fsize = this.files[0].size;
  696. if (fsize > 1048576) {
  697. $('#image_upload_error').show();
  698. $('#image_upload_error').html("Banner image size exceeds 1Mb");
  699. submitEvent.preventDefault();
  700. }
  701. var filename = $("#ad_banner").val();
  702. var extension = filename.replace(/^.*\./, '');
  703. if (extension == filename) {
  704. extension = '';
  705. } else {
  706. extension = extension.toLowerCase();
  707. }
  708. switch (extension) {
  709. case 'jpg':
  710. case 'jpeg':
  711. case 'png':
  712. case 'gif':
  713. break;
  714. default:
  715. $('#image_upload_error').show();
  716. $('#image_upload_error').html("Invalid banner file type. Only JPG, JPEG, PNG and GIF allowed.");
  717. submitEvent.preventDefault();
  718. }
  719. });
  720. $("#ad_name").click(function() {
  721. $('#create_ad_error').hide();
  722. $('#create_ad_success').hide();
  723. });
  724. $("#create_an_ad_form").ajaxForm(function(data) {
  725. $("#create_ad_button").attr("disabled", false);
  726. $("#create_ad_button").val("CREATE AD!");
  727. submissionEnabled = true;
  728. var result = data.split(":");
  729. $('#image_upload_error').hide();
  730. $('#create_ad_error').hide();
  731. $('#create_ad_success').hide();
  732. if (result[0] == "e1") {
  733. $('#create_ad_error').show();
  734. $('#create_ad_error').html("Please enter a campaign name");
  735. }
  736. if (result[0] == "e2") {
  737. $('#create_ad_error').show();
  738. $('#create_ad_error').html("Invalid campaign name");
  739. }
  740. if (result[0] == "e3") {
  741. $('#create_ad_error').show();
  742. $('#create_ad_error').html("Invalid banner file type. Only JPG, JPEG, PNG and GIF allowed.");
  743. }
  744. if (result[0] == "e4") {
  745. $('#create_ad_error').show();
  746. $('#create_ad_error').html("Banner image size exceeds 1Mb");
  747. }
  748. if (result[0] == "e5") {
  749. $('#create_ad_error').show();
  750. $('#create_ad_error').html("Invalid destination URL");
  751. }
  752. if (result[0] == "e6") {
  753. $('#create_ad_error').show();
  754. $('#create_ad_error').html("Invalid budget amount");
  755. }
  756. if (result[0] == "e7") {
  757. $('#create_ad_error').show();
  758. $('#create_ad_error').html("Please pick a banner or upload a banner less than 1Mb in size");
  759. }
  760. if (result[0] == "e8") {
  761. $('#create_ad_error').show();
  762. $('#create_ad_error').html("Please enter a Destination URL");
  763. }
  764. if (result[0] == "e9") {
  765. $('#create_ad_error').show();
  766. $('#create_ad_error').html("Banner image dimensions must be " + result[1] + "px * " + result[2] + "px");
  767. }
  768. if (result[0] == "e10") {
  769. $('#create_ad_error').show();
  770. $('#create_ad_error').html("Please select atleast one website to advertise in");
  771. }
  772. if (result[0] == "e11") {
  773. $('#create_ad_error').show();
  774. $('#create_ad_error').html("Please select the ad position where you want your banner to be placed");
  775. }
  776. if (result[0] == "e12") {
  777. $('#create_ad_error').show();
  778. $('#create_ad_error').html("Frequency cap must be between 0 (unlimited) and 100.");
  779. }
  780. if (result[0] == "s1") {
  781. $('#create_ad_success').show();
  782. $('#create_ad_success').html("Ad campaign created successfully");
  783. $('#ad_campaigns_table tr:last').after('<tr id="ad_campaign_' + result[1] + '"><td><span id="campaign_name_' + result[1] + '">' + result[2] + '</span></td><td id="ad_campaign_status_' + result[1] + '"><span style="color:#FF6600;">PENDING APPROVAL</span></td><td id="campaign_views_' + result[1] + '">0</td><td id="campaign_clicks_' + result[1] + '">0</td><td id="campaign_total_cost_' + result[1] + '">0.00000000</td><td id="start_pause_ad_campaign_icon_' + result[1] + '"></td><td><a href="javascript:void(0);" onclick="ShowAdDetails(' + result[1] + ');" data-reveal-id="myModal8"><img src="//static6.freebitco.in/images/settings.png" border=0 alt="SETTINGS"></a></td><td><a href="javascript:void(0);" onclick="ShowAdStats(' + result[1] + ');" data-reveal-id="myModal9"><img src="//static6.freebitco.in/images/stats.png" border=0 alt="STATS"></a></td><td><a href="javascript:void(0);" onclick="DeleteAdCampaign(' + result[1] + ');"><img src="//static6.freebitco.in/images/delete.png" border=0 alt="DELETE"></a></td></tr>');
  784. $('#ad_name').val('');
  785. $('#ad_banner').val('');
  786. $('#banner_file_name').html('');
  787. $('#ad_url').val('http://');
  788. $('#daily_budget').val('0.00000000');
  789. $('#total_budget').val('0.00000000');
  790. }
  791. });
  792. $("#edit_ad_params_button").click(function() {
  793. var daily_budget = $('#ad_details_popup_daily_budget').val();
  794. var total_budget = $('#ad_details_popup_total_budget').val();
  795. var campaign_name = $('#ad_details_popup_campaign_name').val();
  796. var ad_id = $('#ad_details_popup_ad_id').val();
  797. var freq_cap = $('#ad_details_popup_freq_cap').val();
  798. var adv_bit = 0;
  799. var adv_doge = 0;
  800. if ($("#ad_details_popup_adv_bit").is(":checked")) {
  801. adv_bit = 1;
  802. }
  803. if ($("#ad_details_popup_adv_doge").is(":checked")) {
  804. adv_doge = 1;
  805. }
  806. $("#edit_ad_params_button").attr("disabled", true);
  807. var target_countries_list = "";
  808. if ($("#ad_details_target_country_code").val()) {
  809. target_countries_list = $("#ad_details_target_country_code").val().join(" ");
  810. }
  811. var posting = $.post('/', {
  812. op: 'edit_ad',
  813. id: ad_id,
  814. daily: daily_budget,
  815. total: total_budget,
  816. campaign: campaign_name,
  817. adv_bit: adv_bit,
  818. adv_doge: adv_doge,
  819. user_ads_target_country_code: target_countries_list,
  820. freq_cap: freq_cap
  821. });
  822. posting.done(function(data) {
  823. $('#edit_ad_error').hide();
  824. $('#edit_ad_success').hide();
  825. if (data == "e1") {
  826. $('#edit_ad_error').show();
  827. $('#edit_ad_error').html('Invalid ad id');
  828. }
  829. if (data == "e2") {
  830. $('#edit_ad_error').show();
  831. $('#edit_ad_error').html('Invalid daily budget');
  832. }
  833. if (data == "e3") {
  834. $('#edit_ad_error').show();
  835. $('#edit_ad_error').html('Invalid total budget');
  836. }
  837. if (data == "e4") {
  838. $('#edit_ad_error').show();
  839. $('#edit_ad_error').html("Invalid campaign name");
  840. }
  841. if (data == "e5") {
  842. $('#edit_ad_error').show();
  843. $('#edit_ad_error').html("Please select atleast one website to advertise in");
  844. }
  845. if (data == "e12") {
  846. $('#edit_ad_error').show();
  847. $('#edit_ad_error').html("Frequency cap must be between 0 (unlimited) and 100.");
  848. }
  849. if (data == "s1") {
  850. $('#edit_ad_success').show();
  851. $('#edit_ad_success').html('Ad details edited successfully');
  852. $('#ad_details_popup_campaign_name').val(campaign_name);
  853. $('#ad_details_popup_daily_budget').val(daily_budget);
  854. $('#ad_details_popup_total_budget').val(total_budget);
  855. $('#campaign_name_' + ad_id).html(campaign_name);
  856. }
  857. $("#edit_ad_params_button").attr("disabled", false);
  858. });
  859. });
  860. $("#as_equal_share").click(function(event) {
  861. $("#as_weighted_share").attr("checked", false);
  862. $("#as_last_payout_share").attr("checked", false);
  863. });
  864. $("#as_weighted_share").click(function(event) {
  865. $("#as_equal_share").attr("checked", false);
  866. $("#as_last_payout_share").attr("checked", false);
  867. });
  868. $("#as_last_payout_share").click(function(event) {
  869. $("#as_equal_share").attr("checked", false);
  870. $("#as_weighted_share").attr("checked", false);
  871. });
  872. $("#as_button").click(function(event) {
  873. var as_percent = $('#as_percent').val();
  874. $("#as_button").attr("disabled", true);
  875. var method;
  876. if ($("#as_equal_share").is(":checked")) {
  877. method = 1;
  878. }
  879. if ($("#as_weighted_share").is(":checked")) {
  880. method = 2;
  881. }
  882. if ($("#as_last_payout_share").is(":checked")) {
  883. method = 3;
  884. }
  885. $.get('/?op=set_auto_share&mode=' + method + '&as_percent=' + as_percent, function(data) {
  886. var result = data.split(":");
  887. $('#as_error').hide();
  888. $('#as_success').hide();
  889. if (result[0] == "e1") {
  890. $('#as_error').show();
  891. $('#as_error').html("Invalid auto-share percentage");
  892. }
  893. if (result[0] == "e2") {
  894. $('#as_error').show();
  895. $('#as_error').html("Invalid auto-share mode");
  896. }
  897. if (result[0] == "s1") {
  898. $('#as_success').show();
  899. $('#as_success').html("Auto-share set successfully!");
  900. }
  901. $("#as_button").attr("disabled", false);
  902. });
  903. });
  904. $("#hide_bouncing_email_address_msg").click(function() {
  905. $('#bouncing_email_address_msg').hide();
  906. $.cookie.raw = true;
  907. $.cookie('sbem', 0, {
  908. expires: 3650,
  909. secure: true
  910. });
  911. });
  912. $(".withdraw_box_button").click(function() {
  913. $.get('/?op=get_current_address_and_balance', function(data) {
  914. var result = data.split(":");
  915. if (result[0] == "s") {
  916. $("#balance").html(result[2]);
  917. balanceChanged();
  918. m_w_fee = result[3];
  919. i_w_fee = result[4];
  920. $(".withdraw_btc_address").html(result[1]);
  921. $('#edit_profile_form_btc_address').val(result[1]);
  922. profile_withdraw_address = result[1];
  923. }
  924. var balance = $("#balance").html();
  925. var withdraw_amount = parseFloat(Math.floor((balance - 0.00000001) * 100000000) / 100000000).toFixed(8);
  926. withdraw_max_amount = withdraw_amount;
  927. $("#withdrawal_amount").val('');
  928. $("#instant_withdrawal_amount").val('');
  929. $("#manual_min_withdraw").html(parseFloat(min_withdraw).toFixed(8));
  930. $("#instant_min_withdraw").html(parseFloat(min_withdraw).toFixed(8));
  931. $(".manual_withdraw_fee").html(m_w_fee);
  932. $(".instant_withdraw_fee").html(i_w_fee);
  933. $('#manual_withdraw_btc_add').val('');
  934. $('#instant_withdraw_btc_add').val('');
  935. $("#manual_withdraw_amt_recv").html('0.00000000');
  936. $("#instant_withdraw_amt_recv").html('0.00000000');
  937. });
  938. });
  939. $(".withdraw_use_profile_address").click(function() {
  940. $('#manual_withdraw_btc_add').val(profile_withdraw_address);
  941. $('#instant_withdraw_btc_add').val(profile_withdraw_address);
  942. });
  943. $(".withdraw_all_link").click(function() {
  944. $('#withdrawal_amount').val(parseFloat(withdraw_max_amount - parseFloat(m_w_fee)).toFixed(8));
  945. $('#instant_withdrawal_amount').val(parseFloat(withdraw_max_amount - parseFloat(i_w_fee)).toFixed(8));
  946. $("#withdrawal_amount").keyup();
  947. $("#instant_withdrawal_amount").keyup();
  948. });
  949. $("#withdrawal_amount").keyup(function() {
  950. $("#manual_withdraw_amt_recv").html(parseFloat(parseFloat($("#withdrawal_amount").val()) + parseFloat(m_w_fee)).toFixed(8));
  951. });
  952. $("#withdrawal_amount").keypress(function() {
  953. $("#withdrawal_amount").keyup();
  954. });
  955. $("#withdrawal_amount").keydown(function() {
  956. $("#withdrawal_amount").keyup();
  957. });
  958. $("#instant_withdrawal_amount").keyup(function() {
  959. $("#instant_withdraw_amt_recv").html(parseFloat(parseFloat($("#instant_withdrawal_amount").val()) + parseFloat(i_w_fee)).toFixed(8));
  960. });
  961. $("#instant_withdrawal_amount").keypress(function() {
  962. $("#instant_withdrawal_amount").keyup();
  963. });
  964. $("#instant_withdrawal_amount").keydown(function() {
  965. $("#instant_withdrawal_amount").keyup();
  966. });
  967. $("#autobet_win_return_to_base").click(function(event) {
  968. $("#autobet_win_increase_bet").attr("checked", false);
  969. });
  970. $("#autobet_win_increase_bet").click(function(event) {
  971. $("#autobet_win_return_to_base").attr("checked", false);
  972. });
  973. $("#autobet_lose_return_to_base").click(function(event) {
  974. $("#autobet_lose_increase_bet").attr("checked", false);
  975. });
  976. $("#autobet_lose_increase_bet").click(function(event) {
  977. $("#autobet_lose_return_to_base").attr("checked", false);
  978. });
  979. $("#autobet_bet_hi").click(function(event) {
  980. $("#autobet_bet_lo").attr("checked", false);
  981. $("#autobet_bet_alternate").attr("checked", false);
  982. });
  983. $("#autobet_bet_lo").click(function(event) {
  984. $("#autobet_bet_hi").attr("checked", false);
  985. $("#autobet_bet_alternate").attr("checked", false);
  986. });
  987. $("#autobet_bet_alternate").click(function(event) {
  988. $("#autobet_bet_hi").attr("checked", false);
  989. $("#autobet_bet_lo").attr("checked", false);
  990. });
  991. $("#autobet_max_bet_reset").click(function(event) {
  992. $("#autobet_max_bet_stop").attr("checked", false);
  993. });
  994. $("#autobet_max_bet_stop").click(function(event) {
  995. $("#autobet_max_bet_reset").attr("checked", false);
  996. });
  997. $("#start_autobet").click(function(event) {
  998. $("#autobet_error").hide();
  999. $("#autobet_error").html('');
  1000. $(".play_jackpot").prop("checked", false);
  1001. $('.autobet_play_jackpot:checkbox:checked').map(function() {
  1002. $(".play_jackpot:checkbox[value=" + this.value + "]").prop("checked", true)
  1003. });
  1004. var base_bet = $('#autobet_base_bet').val();
  1005. var bet_odds = $('#autobet_bet_odds').val();
  1006. var max_bet = $('#autobet_max_bet').val();
  1007. var bet_count = $('#autobet_roll_count').val();
  1008. var mode = "alternate";
  1009. var autobet_win_return_to_base = 0,
  1010. autobet_win_increase_bet_percent = 0,
  1011. autobet_lose_return_to_base = 0,
  1012. autobet_lose_increase_bet_percent = 0,
  1013. autobet_win_change_odds = 0,
  1014. autobet_lose_change_odds = 0,
  1015. change_client_seed = 0,
  1016. reset_after_max_bet = 0,
  1017. rolls_played = 0,
  1018. biggest_bet = 0,
  1019. biggest_win = 0,
  1020. stop_after_profit = 0,
  1021. stop_after_loss = 0,
  1022. session_pl = parseFloat(0).toFixed(8),
  1023. logging = 0,
  1024. enable_worker = 0,
  1025. enable_sounds = 0;
  1026. if ($("#autobet_bet_hi").is(":checked")) {
  1027. mode = "hi";
  1028. }
  1029. if ($("#autobet_bet_lo").is(":checked")) {
  1030. mode = "lo";
  1031. }
  1032. if (base_bet < 0.00000001 || base_bet > max_win_amount) {
  1033. AutoBetErrors("e1");
  1034. } else if (bet_odds < 1.01 || bet_odds > 4750) {
  1035. AutoBetErrors("e2");
  1036. } else if (max_bet < 0.00000001 || max_bet > max_win_amount) {
  1037. AutoBetErrors("e3");
  1038. } else if (bet_count < 1) {
  1039. AutoBetErrors("e4");
  1040. } else if ($("#autobet_win_change_odds").is(":checked") && ($("#autobet_win_change_odds_value").val() < 1.01 || $("#autobet_win_change_odds_value").val() > 4750)) {
  1041. AutoBetErrors("e5");
  1042. } else if ($("#autobet_lose_change_odds").is(":checked") && ($("#autobet_lose_change_odds_value").val() < 1.01 || $("#autobet_lose_change_odds_value").val() > 4750)) {
  1043. AutoBetErrors("e6");
  1044. } else if ($("#stop_after_profit").is(":checked") && $("#stop_after_profit_value").val() <= 0) {
  1045. AutoBetErrors("e7");
  1046. } else if ($("#stop_after_loss").is(":checked") && $("#stop_after_loss_value").val() <= 0) {
  1047. AutoBetErrors("e8");
  1048. } else {
  1049. stop_autobet = false;
  1050. $("#auto_betting_button").hide();
  1051. $("#stop_auto_betting").show();
  1052. $("#double_your_btc_middle_section").css({
  1053. 'height': 'auto',
  1054. 'border-radius': '0 0 10px 10px',
  1055. 'padding-bottom': '20px'
  1056. });
  1057. $("#double_your_btc_stake").val(base_bet);
  1058. $("#double_your_btc_payout_multiplier").val(bet_odds);
  1059. $("#double_your_btc_payout_multiplier").keyup();
  1060. $('#rolls_played_count').html('0');
  1061. $('#rolls_played_count').html('0');
  1062. $('#rolls_status').show();
  1063. $('#autobet_highest_bet_msg').show();
  1064. $('#autobet_highest_bet').html('0.00000000 BTC');
  1065. $('#autobet_highest_win_msg').show();
  1066. $('#autobet_highest_win').html('0.00000000 BTC');
  1067. $('#autobet_pl_msg').show();
  1068. $('#autobet_pl').addClass('green');
  1069. $('#autobet_pl').css({
  1070. 'background-color': '#33FF33'
  1071. });
  1072. $('#autobet_pl').html('0.00000000 BTC');
  1073. if ($("#autobet_win_return_to_base").is(":checked")) {
  1074. autobet_win_return_to_base = 1;
  1075. }
  1076. if ($("#autobet_lose_return_to_base").is(":checked")) {
  1077. autobet_lose_return_to_base = 1;
  1078. }
  1079. if ($("#autobet_win_increase_bet").is(":checked")) {
  1080. autobet_win_increase_bet_percent = $("#autobet_win_increase_bet_percent").val();
  1081. }
  1082. if ($("#autobet_lose_increase_bet").is(":checked")) {
  1083. autobet_lose_increase_bet_percent = $("#autobet_lose_increase_bet_percent").val();
  1084. }
  1085. if ($("#autobet_win_change_odds").is(":checked")) {
  1086. autobet_win_change_odds = $("#autobet_win_change_odds_value").val();
  1087. }
  1088. if ($("#autobet_lose_change_odds").is(":checked")) {
  1089. autobet_lose_change_odds = $("#autobet_lose_change_odds_value").val();
  1090. }
  1091. if ($("#autobet_change_client_seed").is(":checked")) {
  1092. change_client_seed = 1;
  1093. }
  1094. if ($("#autobet_max_bet_reset").is(":checked")) {
  1095. reset_after_max_bet = 1;
  1096. }
  1097. if ($("#autobet_dnr").is(":checked")) {
  1098. autobet_dnr = true;
  1099. }
  1100. if ($("#stop_after_profit").is(":checked")) {
  1101. stop_after_profit = $("#stop_after_profit_value").val();
  1102. }
  1103. if ($("#stop_after_loss").is(":checked")) {
  1104. stop_after_loss = $("#stop_after_loss_value").val();
  1105. }
  1106. if ($("#autobet_log_bets").is(":checked")) {
  1107. logging = 1;
  1108. $("#autobet_view_bet_log").show();
  1109. }
  1110. if ($("#autobet_enable_worker").is(":checked")) {
  1111. enable_worker = 1;
  1112. }
  1113. if ($("#autobet_log_bets").is(":checked")) {
  1114. logging = 1;
  1115. $(".autobet_view_bet_log").show();
  1116. }
  1117. if ($("#autobet_enable_sounds").is(":checked")) {
  1118. enable_sounds = 1;
  1119. }
  1120. autobet_running = true;
  1121. autobet_history = [];
  1122. AutoBet(mode, bet_count, max_bet, base_bet, autobet_win_return_to_base, autobet_lose_return_to_base, autobet_win_increase_bet_percent, autobet_lose_increase_bet_percent, change_client_seed, reset_after_max_bet, rolls_played, biggest_bet, biggest_win, session_pl, autobet_win_change_odds, autobet_lose_change_odds, stop_after_profit, stop_after_loss, logging, enable_sounds);
  1123. }
  1124. });
  1125. $("#stop_autobet_button").click(function(event) {
  1126. stop_autobet = true;
  1127. });
  1128. var free_play_sound_cookie = $.cookie('free_play_sound');
  1129. if (free_play_sound_cookie == 1) {
  1130. $("#free_play_sound").prop("checked", true);
  1131. free_play_sound = true;
  1132. }
  1133. $.ionSound({
  1134. sounds: ["jump_up", "bell_ring", "tap"],
  1135. path: "https://fbtc-audio.freebitco.in/",
  1136. multiPlay: true
  1137. });
  1138. $("#test_sound").click(function(event) {
  1139. $.ionSound.play("jump_up");
  1140. });
  1141. $("#free_play_sound").click(function(event) {
  1142. $.cookie.raw = true;
  1143. if ($("#free_play_sound").is(":checked")) {
  1144. $.cookie('free_play_sound', 1, {
  1145. expires: 3650,
  1146. secure: true
  1147. });
  1148. free_play_sound = true;
  1149. } else {
  1150. $.cookie('free_play_sound', 0, {
  1151. expires: 3650,
  1152. secure: true
  1153. });
  1154. free_play_sound = false;
  1155. }
  1156. });
  1157. $("#auto_withdraw_option_link").click(function(event) {
  1158. $(".withdraw_options").hide();
  1159. $("#auto_withdraw_option").show();
  1160. });
  1161. $("#manual_withdraw_option_link").click(function(event) {
  1162. $(".withdraw_options").hide();
  1163. $("#manual_withdraw_option").show();
  1164. });
  1165. $("#instant_withdraw_option_link").click(function(event) {
  1166. $(".withdraw_options").hide();
  1167. $("#instant_withdraw_option").show();
  1168. });
  1169. $("#bcc_withdraw_option_link").click(function(event) {
  1170. $(".withdraw_options").hide();
  1171. $("#bcc_withdraw_option").show();
  1172. });
  1173. $(".withdraw_options_ul a").click(function() {
  1174. $(".withdraw_options_ul a.active").removeClass();
  1175. $(this).addClass('active').blur();
  1176. return false;
  1177. });
  1178. $("#auto_withdraw_option_link").click();
  1179. $(".remove_autobet_error").focus(function() {
  1180. $("#autobet_error").hide();
  1181. $("#autobet_error").html('');
  1182. });
  1183. $("#instant_withdrawal_button").click(function(event) {
  1184. $("#instant_withdrawal_button").attr("disabled", true);
  1185. var posting = $.post('/', {
  1186. op: 'withdraw',
  1187. type: 'instant',
  1188. amount: $("#instant_withdrawal_amount").val(),
  1189. withdraw_address: $("#instant_withdraw_btc_add").val(),
  1190. tfa_code: $("#iw_tfa_code").val()
  1191. });
  1192. posting.done(function(data) {
  1193. var result = data.split(":");
  1194. if (result[0] == "s") {
  1195. $('#balance').html(result[2]);
  1196. balanceChanged();
  1197. $('#manual_withdraw_btc_add').val('');
  1198. $('#instant_withdraw_btc_add').val('');
  1199. withdraw_max_amount = parseFloat(Math.floor((result[2] - 0.00000001) * 100000000) / 100000000).toFixed(8);
  1200. $("#withdrawal_amount").val('');
  1201. $("#instant_withdrawal_amount").val('');
  1202. $("#manual_withdraw_amt_recv").html('0.00000000');
  1203. $("#instant_withdraw_amt_recv").html('0.00000000');
  1204. }
  1205. DisplaySEMessage(result[0], result[1]);
  1206. $("#instant_withdrawal_button").attr("disabled", false);
  1207. });
  1208. });
  1209. $("#withdrawal_button").click(function(event) {
  1210. $("#withdrawal_button").attr("disabled", true);
  1211. var posting = $.post('/', {
  1212. op: 'withdraw',
  1213. type: 'slow',
  1214. amount: $("#withdrawal_amount").val(),
  1215. withdraw_address: $("#manual_withdraw_btc_add").val(),
  1216. tfa_code: $("#mw_tfa_code").val()
  1217. });
  1218. posting.done(function(data) {
  1219. var result = data.split(":");
  1220. if (result[0] == "s") {
  1221. $('#balance').html(result[2]);
  1222. balanceChanged();
  1223. $('#manual_withdraw_btc_add').val('');
  1224. $('#instant_withdraw_btc_add').val('');
  1225. withdraw_max_amount = parseFloat(Math.floor((result[2] - 0.00000001) * 100000000) / 100000000).toFixed(8);
  1226. $("#withdrawal_amount").val('');
  1227. $("#instant_withdrawal_amount").val('');
  1228. $("#manual_withdraw_amt_recv").html('0.00000000');
  1229. $("#instant_withdraw_amt_recv").html('0.00000000');
  1230. }
  1231. DisplaySEMessage(result[0], result[1]);
  1232. $("#withdrawal_button").attr("disabled", false);
  1233. });
  1234. });
  1235. $("#bcc_withdrawal_button").click(function(event) {
  1236. $("#bcc_withdrawal_button").attr("disabled", true);
  1237. var posting = $.post('/', {
  1238. op: 'withdraw_bcc',
  1239. withdraw_address: $("#bcc_withdraw_btc_add").val(),
  1240. tfa_code: $("#bcc_tfa_code").val()
  1241. });
  1242. posting.done(function(data) {
  1243. var result = data.split(":");
  1244. if (result[0] == "s") {
  1245. $('#bcc_withdraw_btc_add').val('');
  1246. }
  1247. DisplaySEMessage(result[0], result[1]);
  1248. $("#bcc_withdrawal_button").attr("disabled", false);
  1249. });
  1250. });
  1251. $("#exchange_bcc_button").click(function(event) {
  1252. $("#exchange_bcc_button").attr("disabled", true);
  1253. var posting = $.post('/', {
  1254. op: 'exchange_bcc'
  1255. });
  1256. posting.done(function(data) {
  1257. var result = data.split(":");
  1258. if (result[0] == "s") {
  1259. $('#balance').html(result[2]);
  1260. balanceChanged();
  1261. $('#exchange_bcc_link').hide();
  1262. }
  1263. DisplaySEMessage(result[0], result[1]);
  1264. $("#exchange_bcc_button").attr("disabled", false);
  1265. });
  1266. });
  1267. $("#main_deposit_address_qr_code_link").click(function() {
  1268. $("#main_deposit_address_qr_code").show();
  1269. });
  1270. $("#hide_xapo_wallet_msg").click(function() {
  1271. $('#create_xapo_wallet_msg').hide();
  1272. $.cookie.raw = true;
  1273. $.cookie('hide_xapo_message', 1, {
  1274. expires: 3650,
  1275. secure: true
  1276. });
  1277. });
  1278. var hide_sharing_password_message_cookie = $.cookie('hide_sharing_password_message');
  1279. if (hide_sharing_password_message_cookie != 1) {
  1280. $('#sharing_password_message').show();
  1281. }
  1282. $("#hide_sharing_password_message").click(function() {
  1283. $('#sharing_password_message').hide();
  1284. $.cookie.raw = true;
  1285. $.cookie('hide_sharing_password_message', 1, {
  1286. expires: 3650,
  1287. secure: true
  1288. });
  1289. });
  1290. $(".logout_link").click(function(event) {
  1291. $.cookie.raw = true;
  1292. $.removeCookie('btc_address');
  1293. $.removeCookie('password');
  1294. window.location.replace("http://freebitco.in/?op=home");
  1295. });
  1296. $("#mob_ver_button").click(function(event) {
  1297. $("#mob_ver_button").attr("disabled", true);
  1298. $.get('/?op=verify_phone&country_code=' + $("#mob_ver_country_code").val() + '&phone_number=' + $("#mob_ver_mobile_number").val(), function(data) {
  1299. var result = data.split(":");
  1300. $('#mob_ver_message').html("");
  1301. $('#mob_ver_message').show();
  1302. $('#mob_ver_message').removeClass('red');
  1303. $('#mob_ver_message').removeClass('green');
  1304. $('#reset_mob_ver').hide();
  1305. if (result[0] == "e") {
  1306. $('#mob_ver_message').addClass('red');
  1307. }
  1308. if (result[0] == "s") {
  1309. $('#mob_ver_message').addClass('green');
  1310. }
  1311. if (result[1] == "e1") {
  1312. $('#mob_ver_message').html("Message could not be sent - " + result[2]);
  1313. }
  1314. if (result[1] == "e2") {
  1315. $('#mob_ver_message').html("Someone has already used this mobile number.");
  1316. }
  1317. if (result[1] == "e3") {
  1318. $('#mob_ver_message').html("Invalid country code or mobile number.");
  1319. }
  1320. if (result[1] == "e4") {
  1321. $('#mob_ver_message').html("We have already sent you a verification code. Click the link below to change your mobile number to a different one to get a code.");
  1322. }
  1323. if (result[1] == "e5") {
  1324. $('#mob_ver_message').html("You have already tried to send a code to this mobile number. Please try a different number.");
  1325. }
  1326. if (result[1] == "e6") {
  1327. $('#mob_ver_message').html("Please wait " + result[2] + " minutes before requesting another code");
  1328. }
  1329. if (result[1] == "e7") {
  1330. $('#mob_ver_message').html("You have entered an incorrect mobile number 10 times. You cannot enter another one.");
  1331. }
  1332. if (result[1] == "e8") {
  1333. $('#mob_ver_message').html("You do not have sufficient balance to verify your phone. Phone verification has a one-time charge of " + result[2] + " BTC to cover network costs.");
  1334. }
  1335. if (result[1] == "s1") {
  1336. $('#mob_ver_message').html("Verification message sent to +" + result[2] + ". Please enter the 6 digit code that you get into the box below.");
  1337. $('#mob_ver_button').hide();
  1338. $('#mob_ver_enter_number').hide();
  1339. $('#reset_mob_ver').show();
  1340. $("html, body").animate({
  1341. scrollTop: $("#mob_ver_enter_number").offset().top - 45
  1342. }, "fast");
  1343. }
  1344. if (result[1] == "s2") {
  1345. $('#mob_ver_message').html("Your mobile number has already been verified.");
  1346. }
  1347. $("#mob_ver_button").attr("disabled", false);
  1348. });
  1349. });
  1350. $("#mob_ver_code_button").click(function(event) {
  1351. $("#mob_ver_code_button").attr("disabled", true);
  1352. $.get('/?op=verify_phone_code&code=' + $("#mob_ver_code").val(), function(data) {
  1353. var result = data.split(":");
  1354. $('#mob_ver_code_message').html("");
  1355. $('#mob_ver_code_message').show();
  1356. $('#mob_ver_code_message').removeClass('red');
  1357. $('#mob_ver_code_message').removeClass('green');
  1358. if (result[0] == "e") {
  1359. $('#mob_ver_code_message').addClass('red');
  1360. }
  1361. if (result[0] == "s") {
  1362. $('#mob_ver_code_message').addClass('green');
  1363. }
  1364. if (result[1] == "e1") {
  1365. $('#mob_ver_code_message').html("Incorrect code. " + result[3] + "<BR>You have " + result[2] + " tries remaining.");
  1366. }
  1367. if (result[1] == "e2") {
  1368. $('#mob_ver_code_message').html("Invalid code entered.");
  1369. }
  1370. if (result[1] == "e3") {
  1371. $('#mob_ver_code_message').html("You cannot verify your mobile number anymore as you have entered incorrect codes 5 times.");
  1372. }
  1373. if (result[1] == "e4") {
  1374. $('#mob_ver_code_message').html("You need to request a code before trying to verify it. Use the box above to request a code.");
  1375. }
  1376. if (result[1] == "e5") {
  1377. $('#mob_ver_code_message').html("Someone has already used this mobile number.");
  1378. }
  1379. if (result[1] == "s1") {
  1380. $('#mob_ver_code_message').html("Code verified successfully!");
  1381. $('#reset_mob_ver').hide();
  1382. }
  1383. if (result[1] == "s2") {
  1384. $('#mob_ver_code_message').html("Your mobile number has already been verified.");
  1385. $('#reset_mob_ver').hide();
  1386. }
  1387. $("#mob_ver_code_button").attr("disabled", false);
  1388. });
  1389. });
  1390. $("#reset_mob_ver_link").click(function(event) {
  1391. $.get('/?op=enter_phone_again', function(data) {
  1392. var result = data.split(":");
  1393. $('#reset_mob_ver_msg').html("");
  1394. $('#reset_mob_ver_msg').show();
  1395. $('#reset_mob_ver_msg').removeClass('red');
  1396. $('#reset_mob_ver_msg').removeClass('green');
  1397. if (result[0] == "e") {
  1398. $('#reset_mob_ver_msg').addClass('red');
  1399. }
  1400. if (result[0] == "s") {
  1401. $('#reset_mob_ver_msg').addClass('green');
  1402. }
  1403. if (result[1] == "e1") {
  1404. $('#reset_mob_ver_msg').html("You have entered an incorrect mobile number 10 times. You cannot enter another one.");
  1405. } else if (result[1] == "e2") {
  1406. $('#reset_mob_ver').hide();
  1407. $('#mob_ver_mobile_number').val('');
  1408. $('#mob_ver_button').show();
  1409. $('#mob_ver_enter_number').show();
  1410. $('#mob_ver_message').hide();
  1411. } else if (result[1] == "e3") {
  1412. $('#reset_mob_ver_msg').html("Please wait " + result[2] + " minutes before requesting another code");
  1413. } else if (result[1] == "s1") {
  1414. $('#reset_mob_ver').hide();
  1415. $('#mob_ver_mobile_number').val('');
  1416. $('#mob_ver_button').show();
  1417. $('#mob_ver_enter_number').show();
  1418. $('#mob_ver_message').hide();
  1419. } else if (result[1] == "s1") {
  1420. $('#reset_mob_ver').html("Your mobile number has already been verified.");
  1421. }
  1422. });
  1423. });
  1424. $("#hide_enable_2fa_msg_alert").click(function() {
  1425. $('#enable_2fa_msg_alert').hide();
  1426. $.cookie.raw = true;
  1427. $.cookie('hide_enable_2fa_msg_alert', 1, {
  1428. expires: 7,
  1429. secure: true
  1430. });
  1431. });
  1432. $("#hide_high_network_load_msg").click(function() {
  1433. $('#high_network_load_msg').hide();
  1434. $.cookie.raw = true;
  1435. $.cookie('hide_high_network_load_msg', 1, {
  1436. expires: 2,
  1437. secure: true
  1438. });
  1439. });
  1440. $("#hide_high_network_load_msg_short").click(function() {
  1441. $('#high_network_load_msg_short').hide();
  1442. $.cookie.raw = true;
  1443. $.cookie('hide_high_network_load_msg_short', 1, {
  1444. expires: 2,
  1445. secure: true
  1446. });
  1447. });
  1448. $("#hide_earn_btc_msg").click(function() {
  1449. $('#earn_btc_msg').hide();
  1450. $.cookie.raw = true;
  1451. $.cookie('hide_earn_btc_msg', 1, {
  1452. expires: 3650,
  1453. secure: true
  1454. });
  1455. });
  1456. $("#hide_mine_btc_msg").click(function() {
  1457. $('#mine_btc_msg').hide();
  1458. $.cookie.raw = true;
  1459. $.cookie('hide_mine_btc_msg', 1, {
  1460. expires: 3650,
  1461. secure: true
  1462. });
  1463. });
  1464. $("#double_your_btc_tab").on('keydown', '#double_your_btc_stake', function(e) {
  1465. var keyCode = e.keyCode || e.which;
  1466. if (keyCode == 72) {
  1467. e.preventDefault();
  1468. if ($("#double_your_btc_bet_hi_button").is(":enabled")) {
  1469. $("#double_your_btc_bet_hi_button").click();
  1470. }
  1471. } else if (keyCode == 76) {
  1472. e.preventDefault();
  1473. if ($("#double_your_btc_bet_lo_button").is(":enabled")) {
  1474. $("#double_your_btc_bet_lo_button").click();
  1475. }
  1476. } else if (keyCode == 65) {
  1477. e.preventDefault();
  1478. if ($("#double_your_btc_stake").val() > 0.00000001) {
  1479. $("#double_your_btc_half").click();
  1480. }
  1481. } else if (keyCode == 83) {
  1482. e.preventDefault();
  1483. $("#double_your_btc_2x").click();
  1484. } else if (keyCode == 68) {
  1485. e.preventDefault();
  1486. $("#double_your_btc_min").click();
  1487. } else if (keyCode == 70) {
  1488. e.preventDefault();
  1489. $("#double_your_btc_max").click();
  1490. } else if (keyCode == 81) {
  1491. e.preventDefault();
  1492. $("#double_your_btc_payout_multiplier").val(parseFloat($("#double_your_btc_payout_multiplier").val()) + 1);
  1493. $("#double_your_btc_payout_multiplier").keyup();
  1494. } else if (keyCode == 87) {
  1495. e.preventDefault();
  1496. $("#double_your_btc_payout_multiplier").val(parseFloat($("#double_your_btc_payout_multiplier").val()) - 1);
  1497. $("#double_your_btc_payout_multiplier").keyup();
  1498. } else if (keyCode == 69) {
  1499. e.preventDefault();
  1500. $("#double_your_btc_payout_multiplier").val(parseFloat($("#double_your_btc_payout_multiplier").val()) + 5);
  1501. $("#double_your_btc_payout_multiplier").keyup();
  1502. } else if (keyCode == 82) {
  1503. e.preventDefault();
  1504. $("#double_your_btc_payout_multiplier").val(parseFloat($("#double_your_btc_payout_multiplier").val()) - 5);
  1505. $("#double_your_btc_payout_multiplier").keyup();
  1506. } else if (keyCode == 84) {
  1507. e.preventDefault();
  1508. $("#double_your_btc_payout_multiplier").val(parseFloat($("#double_your_btc_payout_multiplier").val()) + 10);
  1509. $("#double_your_btc_payout_multiplier").keyup();
  1510. } else if (keyCode == 89) {
  1511. e.preventDefault();
  1512. $("#double_your_btc_payout_multiplier").val(parseFloat($("#double_your_btc_payout_multiplier").val()) - 10);
  1513. $("#double_your_btc_payout_multiplier").keyup();
  1514. }
  1515. });
  1516. $("#lottery_tickets_purchase_count").keyup(function(event) {
  1517. var lottery_tickets_purchase_count = parseInt($("#lottery_tickets_purchase_count").val());
  1518. var lottery_ticket_price = parseFloat($(".lottery_ticket_price").html()).toFixed(8);
  1519. $("#lottery_total_purchase_price").html(parseFloat(lottery_tickets_purchase_count * lottery_ticket_price * 100000000 / 100000000).toFixed(8));
  1520. });
  1521. $("#lottery_tickets_purchase_count").keypress(function() {
  1522. $("#lottery_tickets_purchase_count").keyup();
  1523. });
  1524. $("#lottery_tickets_purchase_count").keydown(function() {
  1525. $("#lottery_tickets_purchase_count").keyup();
  1526. });
  1527. $("#purchase_lottery_tickets_button").click(function(event) {
  1528. $("#purchase_lottery_tickets_button").attr("disabled", true);
  1529. $.get('/?op=purchase_lott_tickets&num=' + $("#lottery_tickets_purchase_count").val(), function(data) {
  1530. var result = data.split(":");
  1531. $('#lottery_tickets_purchase_message').html("");
  1532. $('#lottery_tickets_purchase_message').show();
  1533. $('#lottery_tickets_purchase_message').removeClass('free_play_result_error');
  1534. $('#lottery_tickets_purchase_message').removeClass('free_play_result_success');
  1535. if (result[0] == "e") {
  1536. $('#lottery_tickets_purchase_message').addClass('free_play_result_error');
  1537. $('#lottery_tickets_purchase_message').html(result[1]);
  1538. }
  1539. if (result[0] == "s") {
  1540. $('#lottery_tickets_purchase_message').addClass('free_play_result_success');
  1541. if (result[1] == "s1") {
  1542. var ticket_word = "tickets";
  1543. if (parseInt(result[2]) == 1) {
  1544. ticket_word = "ticket";
  1545. }
  1546. $('#lottery_tickets_purchase_message').html("Successfully purchased " + result[2] + " " + ticket_word + " in lottery round " + result[5] + " for " + parseFloat(result[4] / 100000000).toFixed(8) + " BTC.");
  1547. $('#user_lottery_tickets').html(ReplaceNumberWithCommas(result[3]));
  1548. $('#balance').html(parseFloat(result[6] / 100000000).toFixed(8));
  1549. balanceChanged();
  1550. }
  1551. }
  1552. $("#purchase_lottery_tickets_button").attr("disabled", false);
  1553. });
  1554. });
  1555. var free_play_claim_amount = 0;
  1556. $(window).scroll(function() {
  1557. $('.fbtc_left_sky').css('top', $(this).scrollTop());
  1558. });
  1559. $("#free_play_claim_button").click(function(event) {
  1560. window.location.href = 'https://freebitco.in/?op=home&free_play_claim=' + free_play_claim_amount;
  1561. });
  1562. $("#free_play_form_button").click(function(event) {
  1563. event.preventDefault();
  1564. $('#free_play_digits').show();
  1565. $('.free_play_element').hide();
  1566. var fingerprint = $.fingerprint();
  1567. var fingerprint2 = new Fingerprint({
  1568. canvas: true,
  1569. screen_resolution: true,
  1570. ie_activex: true
  1571. }).get();
  1572. var token = $("#free_play_form").find('[name="' + token_name + '"]').val();
  1573. var intervalID = setInterval(function() {
  1574. $("#free_play_first_digit").html(Math.floor(Math.random() * 10));
  1575. $("#free_play_second_digit").html(Math.floor(Math.random() * 10));
  1576. $("#free_play_third_digit").html(Math.floor(Math.random() * 10));
  1577. $("#free_play_fourth_digit").html(Math.floor(Math.random() * 10));
  1578. $("#free_play_fifth_digit").html(Math.floor(Math.random() * 10));
  1579. }, 10);
  1580. $("#free_play_form_button").attr("disabled", true);
  1581. $("html, body").animate({
  1582. scrollTop: $("#free_play_digits").offset().top - 50
  1583. }, "fast");
  1584. var post_variables = {
  1585. op: 'free_play',
  1586. fingerprint: fingerprint,
  1587. client_seed: $('#next_client_seed').val(),
  1588. fingerprint2: fingerprint2
  1589. };
  1590. post_variables[token_name] = token;
  1591. post_variables[tcGiQefA] = window[tcGiQefA];
  1592. if ($("#free_play_form").find('#g-recaptcha-response').val() && $("#free_play_form").find('#g-recaptcha-response').val().length > 0) {
  1593. post_variables['g_recaptcha_response'] = $("#free_play_form").find('#g-recaptcha-response').val();
  1594. }
  1595. if ($('#captchasnet_free_play_captcha .captchasnet_captcha_input_box').val() && $('#captchasnet_free_play_captcha .captchasnet_captcha_input_box').val().length > 0) {
  1596. post_variables['captchasnet_random'] = $('#captchasnet_free_play_captcha .captchasnet_captcha_random').val();
  1597. post_variables['captchasnet_response'] = $('#captchasnet_free_play_captcha .captchasnet_captcha_input_box').val();
  1598. }
  1599. if ($('#captchasnet_free_play_captcha2 .captchasnet_captcha_input_box').val() && $('#captchasnet_free_play_captcha2 .captchasnet_captcha_input_box').val().length > 0) {
  1600. post_variables['captchasnet_random2'] = $('#captchasnet_free_play_captcha2 .captchasnet_captcha_random').val();
  1601. post_variables['captchasnet_response2'] = $('#captchasnet_free_play_captcha2 .captchasnet_captcha_input_box').val();
  1602. }
  1603. if ($("#free_play_form").find('#adcopy_response').val() && $("#free_play_form").find('#adcopy_response').val().length > 0) {
  1604. post_variables['solvemedia_challenge'] = $("#free_play_form").find('#adcopy_challenge').val();
  1605. post_variables['solvemedia_response'] = $("#free_play_form").find('#adcopy_response').val();
  1606. }
  1607. if ($('#securimage_free_play_captcha .captchasnet_captcha_input_box').val() && $('#securimage_free_play_captcha .captchasnet_captcha_input_box').val().length > 0) {
  1608. post_variables['securimage_random'] = $('#securimage_free_play_captcha .captchasnet_captcha_random').val();
  1609. post_variables['securimage_response'] = $('#securimage_free_play_captcha .captchasnet_captcha_input_box').val();
  1610. }
  1611. if ($('#botdetect_free_play_captcha .captchasnet_captcha_input_box').val() && $('#botdetect_free_play_captcha .captchasnet_captcha_input_box').val().length > 0) {
  1612. post_variables['botdetect_random'] = $('#botdetect_free_play_captcha .captchasnet_captcha_random').val();
  1613. post_variables['botdetect_response'] = $('#botdetect_free_play_captcha .captchasnet_captcha_input_box').val();
  1614. }
  1615. var posting = $.post('/', post_variables);
  1616. posting.done(function(data) {
  1617. var result = data.split(":");
  1618. $('#free_play_error').html("");
  1619. $('#free_play_error').hide();
  1620. clearInterval(intervalID);
  1621. $("#free_play_first_digit").html(0);
  1622. $("#free_play_second_digit").html(0);
  1623. $("#free_play_third_digit").html(0);
  1624. $("#free_play_fourth_digit").html(0);
  1625. $("#free_play_fifth_digit").html(0);
  1626. if (result[0] == "e") {
  1627. $('#free_play_digits').hide();
  1628. $('.free_play_element').show();
  1629. $('#free_play_error').show();
  1630. $('#free_play_error').html(result[1]);
  1631. if ($("#free_play_recaptcha") && $("#free_play_recaptcha").length > 0) {
  1632. if (typeof grecaptcha !== 'undefined') {
  1633. grecaptcha.reset();
  1634. }
  1635. }
  1636. if ($("#captchasnet_free_play_captcha") && $("#captchasnet_free_play_captcha").length > 0) {
  1637. GenerateCaptchasNetCaptcha('captchasnet_free_play_captcha', 0);
  1638. }
  1639. if ($("#captchasnet_free_play_captcha2") && $("#captchasnet_free_play_captcha2").length > 0) {
  1640. GenerateCaptchasNetCaptcha('captchasnet_free_play_captcha2', 0);
  1641. }
  1642. if ($("#free_play_solvemedia") && $("#free_play_solvemedia").length > 0 && $("#free_play_solvemedia:visible").length > 0) {
  1643. if (typeof ACPuzzle !== 'undefined') {
  1644. ACPuzzle.reload();
  1645. }
  1646. }
  1647. if ($("#botdetect_free_play_captcha") && $("#botdetect_free_play_captcha").length > 0) {
  1648. GenerateCaptchasNetCaptcha('botdetect_free_play_captcha', 3);
  1649. }
  1650. if ($("#securimage_free_play_captcha") && $("#securimage_free_play_captcha").length > 0) {
  1651. GenerateCaptchasNetCaptcha('securimage_free_play_captcha', 2);
  1652. }
  1653. if (result[3] == "e1") {
  1654. $('#free_play_error').hide();
  1655. $('.free_play_element').hide();
  1656. $('#wait').show();
  1657. $('#same_ip_error').show();
  1658. $('#same_ip_error').html(result[1]);
  1659. $('#time_remaining').countdown({
  1660. until: +result[2],
  1661. format: 'MS'
  1662. });
  1663. setTimeout(function() {
  1664. RefreshPageAfterFreePlayTimerEnds();
  1665. }, parseInt(result[2]) * 1000);
  1666. title_countdown(parseInt(result[2]));
  1667. }
  1668. } else if (result[0] == "s") {
  1669. var number = result[1];
  1670. var single_digit = number.split("");
  1671. if (number.toString().length < 5) {
  1672. var remaining = 5 - number.toString().length;
  1673. for (var i = 0; i < remaining; i++) {
  1674. single_digit.unshift('0');
  1675. }
  1676. }
  1677. $("#free_play_first_digit").html(single_digit[0]);
  1678. $("#free_play_second_digit").html(single_digit[1]);
  1679. $("#free_play_third_digit").html(single_digit[2]);
  1680. $("#free_play_fourth_digit").html(single_digit[3]);
  1681. $("#free_play_fifth_digit").html(single_digit[4]);
  1682. $.cookie.raw = true;
  1683. $.cookie('last_play', result[4], {
  1684. expires: 3650,
  1685. secure: true
  1686. });
  1687. $.removeCookie('ivp7GpJPvMtG');
  1688. $('.free_play_element').hide();
  1689. $('#free_play_result').show();
  1690. $('#wait').show();
  1691. $('#balance').html(result[2]);
  1692. balanceChanged();
  1693. $('#time_remaining').countdown({
  1694. until: +3600,
  1695. format: 'MS'
  1696. });
  1697. setTimeout(function() {
  1698. RefreshPageAfterFreePlayTimerEnds();
  1699. }, 3600 * 1000);
  1700. title_countdown(3600);
  1701. free_play_claim_amount = parseFloat(Math.round(result[3] * 100000000) / 100000000).toFixed(8);
  1702. $('#winnings').html(free_play_claim_amount);
  1703. $('#balance_usd').html(result[5]);
  1704. $('#next_server_seed_hash').val(result[6]);
  1705. $('#next_nonce').html(result[8]);
  1706. $('.previous_server_seed').html(result[9]);
  1707. $('#previous_server_seed_hash').val(result[10]);
  1708. $('.previous_client_seed').html(result[11]);
  1709. $('.previous_nonce').html(result[12]);
  1710. $('#previous_roll').html(result[1]);
  1711. $('#no_previous_rolls_msg').hide();
  1712. $('#previous_rolls_table').show();
  1713. $('#previous_roll_strings').show();
  1714. $("#verify_rolls_link").attr("href", "https://s3.amazonaws.com/roll-verifier/verify.html?server_seed=" + result[9] + "&client_seed=" + result[11] + "&server_seed_hash=" + result[10] + "&nonce=" + result[12]);
  1715. $('#user_lottery_tickets').html(ReplaceNumberWithCommas(result[13]));
  1716. $('.user_reward_points').html(ReplaceNumberWithCommas(result[14]));
  1717. $('#fp_lottery_tickets_won').html(result[15]);
  1718. $('#fp_reward_points_won').html(result[16]);
  1719. $('#fp_multiplier_bonus').html(result[17]);
  1720. $('#fp_bonus_req_completed').html(result[18]);
  1721. if (parseInt(result[1]) > 9997) {
  1722. var fp_win_amt = 20;
  1723. if (parseInt(result[1]) > 9999) {
  1724. fp_win_amt = 200;
  1725. }
  1726. $('#make_extra_5_msg').show();
  1727. $('#fp_forum_msg').html('[b]I just won $' + fp_win_amt + ' at FreeBitco.in![/b]&#13;&#10;&#13;&#10;My user id is ' + socket_userid + '.&#13;&#10;&#13;&#10;My winning seeds: ' + "https://s3.amazonaws.com/roll-verifier/verify.html?server_seed=" + result[9] + "&client_seed=" + result[11] + "&server_seed_hash=" + result[10] + "&nonce=" + result[12]);
  1728. }
  1729. setTimeout(function() {
  1730. $('.show_multiply_modal').click();
  1731. }, 2000);
  1732. }
  1733. $("#free_play_form_button").attr("disabled", false);
  1734. });
  1735. });
  1736. var lottery_winners_start = 1;
  1737. var lottery_show_older = 0;
  1738. var lottery_show_newer = 0;
  1739. $("#older_lottery_winners_link").click(function() {
  1740. lottery_show_older = 1;
  1741. });
  1742. $("#newer_lottery_winners_link").click(function() {
  1743. lottery_show_newer = 1;
  1744. });
  1745. $(".browse_lottery_winners_link").click(function() {
  1746. if (lottery_show_older == 1) {
  1747. lottery_winners_start = lottery_winners_start + 1;
  1748. } else if (lottery_show_newer == 1) {
  1749. lottery_winners_start = lottery_winners_start - 1;
  1750. }
  1751. if (lottery_winners_start >= latest_lottery_round - 1) {
  1752. lottery_winners_start = latest_lottery_round - 1;
  1753. }
  1754. if (lottery_show_older == 1 && lottery_winners_start < 1) {
  1755. lottery_winners_start = 1;
  1756. }
  1757. $("#older_lottery_winners_link").attr("disabled", true);
  1758. $("#newer_lottery_winners_link").attr("disabled", true);
  1759. $.get('/cgi-bin/api.pl?op=show_lottery_results&start=' + lottery_winners_start, function(data) {
  1760. if (parseInt(data.round) > 0) {
  1761. $("#previous_lottery_winners_list_div").html("");
  1762. var mobile_class = "";
  1763. if (mobile_device == 1) {
  1764. mobile_class = " lottery_table_mobile_style ";
  1765. }
  1766. $("#previous_lottery_winners_list_div").html('<div class="large-12 small-12 columns center lottery_winner_table_box table_header_background br_5_5"><div class="center" style="margin:auto;">LOTTERY ROUND ' + data.round + '</div></div><div class="large-12 small-12 columns center lottery_winner_table_box"><div class="center" style="margin:auto; font-weight:bold;">TOTAL TICKETS: ' + data.total_tickets + '</div></div><div class="large-12 small-12 columns center lottery_winner_table_box_container effect2"><div class="font_bold large-1 small-1 columns center lottery_winner_table_box lottery_winner_table_first_last_cell' + mobile_class + '">#</div><div class="font_bold large-3 small-3 columns center lottery_winner_table_box lottery_winner_table_second_cell' + mobile_class + '">USER ID</div><div class="font_bold large-4 small-4 columns center lottery_winner_table_box lottery_winner_table_third_cell' + mobile_class + '">AMOUNT WON</div><div class="font_bold large-4 small-4 columns center lottery_winner_table_box lottery_winner_table_first_last_cell' + mobile_class + '">USER TICKETS</div></div>');
  1767. for (var i = 0; i < data.winners.length; i++) {
  1768. $("#previous_lottery_winners_list_div").append('<div class="large-12 small-12 columns center lottery_winner_table_box_container effect2"><div class="large-1 small-1 columns center lottery_winner_table_box lottery_winner_table_first_last_cell' + mobile_class + '">' + data.winners[i].rank + '</div><div class="large-3 small-3 columns center lottery_winner_table_box lottery_winner_table_second_cell' + mobile_class + '">' + data.winners[i].userid + '</div><div class="large-4 small-4 columns center lottery_winner_table_box lottery_winner_table_third_cell' + mobile_class + '">' + data.winners[i].amount + ' BTC</div><div class="large-4 small-4 columns center lottery_winner_table_box lottery_winner_table_first_last_cell' + mobile_class + '">' + data.winners[i].tickets_purchased + '</div> </div>');
  1769. }
  1770. }
  1771. lottery_show_older = 0;
  1772. lottery_show_newer = 0;
  1773. $("#older_lottery_winners_link").attr("disabled", false);
  1774. $("#newer_lottery_winners_link").attr("disabled", false);
  1775. });
  1776. });
  1777. $("#newer_lottery_winners_link").click();
  1778. $('.top-bar-section ul.right li').click(function() {
  1779. $('.top-bar').removeClass('expanded');
  1780. });
  1781. $("#set_email_preferences").click(function() {
  1782. $("#set_email_preferences").attr("disabled", true);
  1783. var subs_arr = $('.email_subs_checkbox:checkbox:checked').map(function() {
  1784. return this.value;
  1785. }).get().toString();
  1786. $.get('/?op=set_email_subscriptions&subs=' + subs_arr, function(data) {
  1787. $("#set_email_preferences").attr("disabled", false);
  1788. DisplaySEMessage('s', 'Succesfully updated email subscriptions');
  1789. });
  1790. });
  1791. $("#double_your_btc_payout_multiplier").keyup(function() {
  1792. if (parseFloat($("#double_your_btc_payout_multiplier").val()) < 1.01 && parseFloat($("#double_your_btc_payout_multiplier").val()) != 1) {
  1793. $("#double_your_btc_payout_multiplier").val(1.01);
  1794. } else if (parseFloat($("#double_your_btc_payout_multiplier").val()) > 4750.00) {
  1795. $("#double_your_btc_payout_multiplier").val(4750.00);
  1796. }
  1797. CalculateWinAmount();
  1798. $("#double_your_btc_win_chance").val((parseFloat(parseInt($(".lt").html()) / 10000 * 100).toFixed(2)) + "%");
  1799. });
  1800. $("#double_your_btc_win_chance").keyup(function() {
  1801. if (parseFloat($("#double_your_btc_win_chance").val()) > 94.06) {
  1802. $("#double_your_btc_win_chance").val(94.06 + "%");
  1803. } else if (parseFloat($("#double_your_btc_win_chance").val()) < 0.02 && parseFloat($("#double_your_btc_win_chance").val()) != 0) {
  1804. $("#double_your_btc_win_chance").val(0.02 + "%");
  1805. }
  1806. $("#double_your_btc_payout_multiplier").val(parseFloat(95 / parseFloat($("#double_your_btc_win_chance").val())).toFixed(2));
  1807. CalculateWinAmount();
  1808. });
  1809. $("#double_your_btc_payout_multiplier").change(function() {
  1810. $("#double_your_btc_payout_multiplier").val(parseFloat(9500 / parseInt($(".lt").html())).toFixed(2));
  1811. });
  1812. $("#double_your_btc_win_chance").change(function() {
  1813. $("#double_your_btc_win_chance").val((parseFloat(parseInt($(".lt").html()) / 10000 * 100).toFixed(2)) + "%");
  1814. });
  1815. $("#double_your_btc_win_chance").focus(function() {
  1816. $("#win_chance_value_message").show();
  1817. });
  1818. $("#double_your_btc_win_chance").focusout(function() {
  1819. $("#win_chance_value_message").hide();
  1820. });
  1821. $("#double_your_btc_payout_multiplier").focus(function() {
  1822. $("#payout_value_message").show();
  1823. });
  1824. $("#double_your_btc_payout_multiplier").focusout(function() {
  1825. $("#payout_value_message").hide();
  1826. });
  1827. $('#login_form').hide(); /*var int_page_captchas = $("#int_page_captchas").detach();int_page_captchas.appendTo('#signup_page_captchas');*/
  1828. $('body').on('click', '.login_menu_button', function() {
  1829. $('#signup_form').hide();
  1830. $('#homepage_login_button').hide();
  1831. $('#homepage_signup_button').show();
  1832. $('#login_form').fadeIn(); /*int_page_captchas.appendTo('#login_page_captchas');*/
  1833. });
  1834. $('body').on('click', '.signup_menu_button', function() {
  1835. $('#login_form').hide();
  1836. $('#homepage_login_button').show();
  1837. $('#homepage_signup_button').hide();
  1838. $('#signup_form').fadeIn(); /*int_page_captchas.appendTo('#signup_page_captchas');*/
  1839. });
  1840. $("#link_features").click(function() {
  1841. $('html, body').animate({
  1842. scrollTop: $("#features").offset().top - 40
  1843. }, 800);
  1844. });
  1845. $("#link_home, .login_menu_button, .signup_menu_button").click(function() {
  1846. $('html, body').animate({
  1847. scrollTop: $("#new_home").offset().top - 40
  1848. }, 800);
  1849. });
  1850. $("#link_bitcoin").click(function() {
  1851. $('html, body').animate({
  1852. scrollTop: $("#home_bitcoin").offset().top - 40
  1853. }, 800);
  1854. });
  1855. $("#link_news").click(function() {
  1856. $('html, body').animate({
  1857. scrollTop: $("#home_news").offset().top - 40
  1858. }, 800);
  1859. });
  1860. var have_account_cookie = $.cookie('have_account');
  1861. if (have_account_cookie == 1) {
  1862. $(".login_menu_button").click();
  1863. }
  1864. if (document.createElement("input").placeholder == undefined) {
  1865. $(".form_placeholders").show();
  1866. }
  1867. $("#user_ads_unselect_all_countries").click(function(event) {
  1868. $("#user_ads_target_country_code option").prop("selected", false);
  1869. });
  1870. $("#ad_details_unselect_all_countries").click(function(event) {
  1871. $("#ad_details_target_country_code option").prop("selected", false);
  1872. });
  1873. $(".ad_position_checkbox").click(function(event) {
  1874. $(".ad_position_checkbox").prop("checked", false);
  1875. $(".ad_position_checkbox:checkbox[value=" + this.value + "]").prop("checked", true);
  1876. });
  1877. $("#autobet_bet_odds").focus(function() {
  1878. $("#autobet_payout_value_message").show();
  1879. });
  1880. $("#autobet_bet_odds").focusout(function() {
  1881. $("#autobet_payout_value_message").hide();
  1882. });
  1883. var auto_to_manual = 0;
  1884. $('#auto_bet_on').click(function() {
  1885. $('#double_your_btc_result').hide();
  1886. $('#double_your_btc_left_section').hide();
  1887. $('#double_your_btc_auto_bet_left_section').show();
  1888. $('#double_your_btc_right_section').hide();
  1889. $('#double_your_btc_auto_bet_right_section').show();
  1890. $('.manual_bet_element').hide();
  1891. $('.auto_bet_element').show();
  1892. $("#double_your_btc_middle_section").css({
  1893. 'height': 'auto',
  1894. 'padding-bottom': '6px'
  1895. });
  1896. $(this).addClass('betting_mode_on');
  1897. $(this).removeClass('manual_auto_bet_on_button');
  1898. $('#manual_bet_on').removeClass('betting_mode_on');
  1899. $('#manual_bet_on').addClass('manual_auto_bet_on_button');
  1900. $('#multiplier_first_digit').html('0');
  1901. $('#multiplier_second_digit').html('0');
  1902. $('#multiplier_third_digit').html('0');
  1903. $('#multiplier_fourth_digit').html('0');
  1904. $('#multiplier_fifth_digit').html('0');
  1905. $('#multiplier_enable_sound_div').hide();
  1906. auto_to_manual = 1;
  1907. });
  1908. $('#manual_bet_on').click(function() {
  1909. if (autobet_running === true) {
  1910. $('#auto_bet_running').show();
  1911. } else {
  1912. if (auto_to_manual === 1 && $('body').innerWidth() > 1255) {
  1913. auto_to_manual = 0;
  1914. $("#double_your_btc_middle_section").css({
  1915. 'border-radius': '0'
  1916. });
  1917. }
  1918. $('#autobet_results_box').hide();
  1919. $('#double_your_btc_result').hide();
  1920. $('#double_your_btc_auto_bet_left_section').hide();
  1921. $('#double_your_btc_left_section').show();
  1922. $('#double_your_btc_auto_bet_right_section').hide();
  1923. $('#double_your_btc_right_section').show();
  1924. $('.auto_bet_element').hide();
  1925. $('.manual_bet_element').show();
  1926. $("#double_your_btc_middle_section").css({
  1927. 'height': '362.781px'
  1928. });
  1929. $(this).addClass('betting_mode_on');
  1930. $(this).removeClass('manual_auto_bet_on_button');
  1931. $('#auto_bet_on').removeClass('betting_mode_on');
  1932. $('#auto_bet_on').addClass('manual_auto_bet_on_button');
  1933. $('#multiplier_first_digit').html('0');
  1934. $('#multiplier_second_digit').html('0');
  1935. $('#multiplier_third_digit').html('0');
  1936. $('#multiplier_fourth_digit').html('0');
  1937. $('#multiplier_fifth_digit').html('0');
  1938. $('#multiplier_enable_sound_div').show();
  1939. $("#autobet_error").hide();
  1940. }
  1941. });
  1942. $('#close_auto_bet_running_message').click(function() {
  1943. $('#auto_bet_running').hide();
  1944. });
  1945. $('#show_double_your_btc_auto_bet_on_lose').click(function() {
  1946. $(this).addClass('multiplier_header_background');
  1947. $('#show_double_your_btc_auto_bet_on_win').removeClass('multiplier_header_background');
  1948. $('#double_your_btc_auto_bet_on_win').hide();
  1949. $('#double_your_btc_auto_bet_on_lose').show();
  1950. });
  1951. $('#show_double_your_btc_auto_bet_on_win').click(function() {
  1952. $(this).addClass('multiplier_header_background');
  1953. $('#show_double_your_btc_auto_bet_on_lose').removeClass('multiplier_header_background');
  1954. $('#double_your_btc_auto_bet_on_lose').hide();
  1955. $('#double_your_btc_auto_bet_on_win').show();
  1956. });
  1957. $('#manual_bet_on').click();
  1958. $("#home_news").find(".news_content:first").show();
  1959. $("#news_tab").find(".inside_news_content:first").show();
  1960. $('#newer_bet_history').click(function() {
  1961. bet_history_page--;
  1962. if (bet_history_page < 0) {
  1963. bet_history_page = 0;
  1964. }
  1965. GetBetHistory(bet_history_page);
  1966. });
  1967. $('#older_bet_history').click(function() {
  1968. bet_history_page++;
  1969. if (bet_history_page < 0) {
  1970. bet_history_page = 0;
  1971. }
  1972. GetBetHistory(bet_history_page);
  1973. });
  1974. $('#show_roll_history_mobile').click(function() {
  1975. $('#bet_history_table').toggle();
  1976. });
  1977. $("#signup_page_captcha_types").change(function() {
  1978. $('.signup_page_captcha').hide();
  1979. $('#' + $("#signup_page_captcha_types").val() + '_captcha').show();
  1980. });
  1981. GetRPPrizes();
  1982. $(".reward_point_redeem_result_box_close").click(function() {
  1983. $('#reward_point_redeem_result_container_div').hide();
  1984. });
  1985. $("#encash_points_number").keyup(function(event) {
  1986. var encash_points_number = parseInt($("#encash_points_number").val());
  1987. var lottery_ticket_price = parseFloat($(".lottery_ticket_price").html()).toFixed(8);
  1988. $("#reward_points_redeem_price").html(parseFloat(encash_points_number * lottery_ticket_price * 100000000 / 100000000).toFixed(8));
  1989. });
  1990. $("#encash_points_number").keypress(function() {
  1991. $("#encash_points_number").keyup();
  1992. });
  1993. $("#encash_points_number").keydown(function() {
  1994. $("#encash_points_number").keyup();
  1995. });
  1996. $(".reward_category_name").click(function() {
  1997. if ($(this).find('.toggle_down_up').prop('className').split(' ').indexOf("fa-arrow-down") > -1) {
  1998. $(this).find('.toggle_down_up').remove();
  1999. $(this).append('<i class="toggle_down_up fa fa-arrow-up" style="float:right; color: #fff;" aria-hidden="true"></i>');
  2000. } else if ($(this).find('.toggle_down_up').prop('className').split(' ').indexOf("fa-arrow-up") > -1) {
  2001. $(this).find('.toggle_down_up').remove();
  2002. $(this).append('<i class="toggle_down_up fa fa-arrow-down" style="float:right; color: #fff;" aria-hidden="true"></i>');
  2003. }
  2004. $(this).next(".reward_category_details").slideToggle("200");
  2005. $(this).next(".profile_change_box").slideToggle("200");
  2006. });
  2007. $('#disable_lottery_checkbox').click(function() {
  2008. var val = 0;
  2009. if ($("#disable_lottery_checkbox").is(":checked")) {
  2010. val = 1;
  2011. }
  2012. $.get('/?op=toggle_lottery&value=' + val, function(data) {
  2013. var result = data.split(":");
  2014. DisplaySEMessage(result[0], result[1]);
  2015. });
  2016. });
  2017. $('#disable_interest_checkbox').click(function() {
  2018. var val = 0;
  2019. if ($("#disable_interest_checkbox").is(":checked")) {
  2020. val = 1;
  2021. }
  2022. $.get('/?op=toggle_interest&value=' + val, function(data) {
  2023. var result = data.split(":");
  2024. DisplaySEMessage(result[0], result[1]);
  2025. });
  2026. });
  2027. $("#enable_2fa_0").click(function() {
  2028. $.get('/?op=confirm_email', function(data) {
  2029. var result = data.split(":");
  2030. var custom_timeout = 0;
  2031. if (result[2] == "s2") {
  2032. $("#enable_2fa_0").parent("div").hide();
  2033. $("#enable_2fa_2").parent("div").show();
  2034. }
  2035. if (result[0] == "s") {
  2036. custom_timeout = 30000;
  2037. }
  2038. DisplaySEMessage(result[0], result[1], custom_timeout);
  2039. });
  2040. });
  2041. $("#enable_2fa_2").click(function() {
  2042. $.get('/?op=enable_2fa&func=show', function(data) {
  2043. var result = data.split(":");
  2044. if (result[0] == "s") {
  2045. $("#enable_2fa_2").parent("div").hide();
  2046. $("#show_2fa_secret").show();
  2047. var totp = "otpauth://totp/" + result[2] + "%3Fsecret%3D" + result[3];
  2048. $("#2fa_secret").html("<p><img src='https://chart.googleapis.com/chart?chs=200x200&cht=qr&chl=200x200&chld=M|0&cht=qr&chl=" + totp + "'></p><p style='height: 45px; margin-right: auto; margin-left: auto; width: 300px; border-radius: 3px;'><span class='secret_key_background left'>Secret Key </span><span class='left bold' style='width: 180px; padding: 10px; border: 1px solid #ccc; border-left: none; border-radius: 0 3px 3px 0;'>" + result[3] + "</span></p>");
  2049. } else {
  2050. DisplaySEMessage(result[0], result[1]);
  2051. }
  2052. });
  2053. });
  2054. $("#activate_2fa").click(function() {
  2055. var posting = $.post('/', {
  2056. op: 'enable_2fa',
  2057. func: 'enable',
  2058. code: $("#activate_2fa_code").val(),
  2059. phone: $("#tfa_recovery_phone").val()
  2060. });
  2061. posting.done(function(data) {
  2062. var result = data.split(":");
  2063. DisplaySEMessage(result[0], result[1]);
  2064. if (result[0] == "s") {
  2065. $("#activate_2fa").parent("div").hide();
  2066. $("#disable_2fa").parent("div").show();
  2067. $(".profile_2fa_field").show();
  2068. $("html, body").animate({
  2069. scrollTop: $("#2fa_profile_box").offset().top - 45
  2070. }, "fast");
  2071. $('#enable_2fa_msg_alert').hide();
  2072. }
  2073. });
  2074. });
  2075. $("#disable_2fa").click(function() {
  2076. var posting = $.post('/', {
  2077. op: 'enable_2fa',
  2078. func: 'disable',
  2079. code: $("#disable_2fa_code").val()
  2080. });
  2081. posting.done(function(data) {
  2082. var result = data.split(":");
  2083. DisplaySEMessage(result[0], result[1]);
  2084. if (result[0] == "s") {
  2085. $("#enable_2fa_0").parent("div").show();
  2086. $(".profile_2fa_field").hide();
  2087. $("#disable_2fa").parent("div").hide();
  2088. }
  2089. });
  2090. });
  2091. $("#submit_2fa_recovery_details").click(function() {
  2092. var posting = $.post('/', {
  2093. op: 'change_2fa_phone',
  2094. code: $("#rp_tfa_code").val(),
  2095. phone: $("#rp_phone_number").val()
  2096. });
  2097. posting.done(function(data) {
  2098. var result = data.split(":");
  2099. DisplaySEMessage(result[0], result[1]);
  2100. });
  2101. });
  2102. $(".tfa_enter_recovery_phone_link").click(function() {
  2103. SwitchPageTabs('edit');
  2104. $("html, body").animate({
  2105. scrollTop: $("#2fa_recovery_phone_box").offset().top - 45
  2106. }, "fast");
  2107. $("#2fa_recovery_phone_box").click();
  2108. });
  2109. $("#share_button").click(function() {
  2110. var amount = $('#share_amount').val();
  2111. var conf = confirm("If you click OK, then " + amount + " BTC will be deducted from your account and distributed among your referrals. If you do not wish to do this, please click CANCEL");
  2112. if (conf == true) {
  2113. $("#share_button").attr("disabled", true);
  2114. var method = 0;
  2115. if ($("#equal_share").is(":checked")) {
  2116. method = 1;
  2117. }
  2118. if ($("#weighted_share").is(":checked")) {
  2119. method = 2;
  2120. }
  2121. if ($("#last_payout_share").is(":checked")) {
  2122. method = 3;
  2123. }
  2124. $.get('/?op=share_coins&method=' + method + '&amount=' + amount, function(data) {
  2125. var result = data.split(":");
  2126. if (result[0] == "e") {
  2127. DisplaySEMessage(result[0], result[1]);
  2128. } else if (result[0] == "s") {
  2129. var share_amount = parseFloat(parseInt(result[2]) / 100000000).toFixed(8);
  2130. $('#balance').html(parseFloat(parseInt(result[1]) / 100000000).toFixed(8));
  2131. balanceChanged();
  2132. $('#share_given').html(result[4]);
  2133. $('#recent_share_given').html(result[5]);
  2134. DisplaySEMessage(result[0], share_amount + " BTC shared with " + result[3] + " referrals");
  2135. }
  2136. $("#share_button").attr("disabled", false);
  2137. });
  2138. }
  2139. });
  2140. $("#claim_bonus_button").click(function() {
  2141. if ($("#accept_bonus_terms").is(":checked")) {
  2142. $.get('/?op=credit_deposit_bonus&amount=' + $("#claim_bonus_amount").val(), function(data) {
  2143. var result = data.split(":");
  2144. if (result[0] == "e") {
  2145. DisplaySEMessage(result[0], result[1]);
  2146. } else if (result[0] == "s") {
  2147. $('#bonus_account_table').show();
  2148. $('#user_claimed_deposit_bonus').show();
  2149. $('#bonus_account_balance').html(result[1] + " BTC");
  2150. $('#bonus_account_wager').html(result[2] + " BTC");
  2151. $('#balance').html(result[3]);
  2152. balanceChanged();
  2153. $('#bonus_eligible_msg').hide();
  2154. DisplaySEMessage(result[0], result[4]);
  2155. $("#myModal24").foundation('reveal', 'close');
  2156. bonus_table_closed = 0;
  2157. }
  2158. });
  2159. } else {
  2160. DisplaySEMessage("e", "Please read and agree to the terms below");
  2161. }
  2162. });
  2163. $("#earn_btc_acc_balance").keyup(function(event) {
  2164. var acc_bal = parseInt($("#earn_btc_acc_balance").val() * 100000000);
  2165. if (acc_bal > 29000) {
  2166. $("#earn_btc_daily_interest").html(parseFloat((Math.floor(acc_bal * 0.0109589 / 100)) / 100000000).toFixed(8));
  2167. $("#earn_btc_monthly_interest").html(parseFloat((Math.floor(acc_bal * 0.32928995 / 100)) / 100000000).toFixed(8));
  2168. $("#earn_btc_yearly_interest").html(parseFloat((Math.floor(acc_bal * 4.08050588 / 100)) / 100000000).toFixed(8));
  2169. } else {
  2170. $("#earn_btc_daily_interest").html("0");
  2171. $("#earn_btc_monthly_interest").html("0");
  2172. $("#earn_btc_yearly_interest").html("0");
  2173. }
  2174. });
  2175. $("#earn_btc_acc_balance").keypress(function() {
  2176. $("#earn_btc_acc_balance").keyup();
  2177. });
  2178. $("#earn_btc_acc_balance").keydown(function() {
  2179. $("#earn_btc_acc_balance").keyup();
  2180. });
  2181. $("#earn_btc_acc_balance").val($('#balance').html());
  2182. $("#earn_btc_acc_balance").keyup();
  2183. $.get('/cgi-bin/api.pl?op=get_interest_history', function(data) {
  2184. if (data.length > 0) {
  2185. var mobile_class = "";
  2186. if (mobile_device == 1) {
  2187. mobile_class = " lottery_table_mobile_style ";
  2188. }
  2189. for (var i = 0; i < data.length; i++) {
  2190. $("#interest_history_table").append('<div class="large-12 small-12 columns center lottery_winner_table_box_container effect2"><div class="large-4 small-4 columns center lottery_winner_table_box lottery_winner_table_first_last_cell' + mobile_class + '">' + data[i].date + '</div><div class="large-4 small-4 columns center lottery_winner_table_box lottery_winner_table_third_cell' + mobile_class + '">' + data[i].balance + '</div><div class="large-4 small-4 columns center lottery_winner_table_box lottery_winner_table_first_last_cell' + mobile_class + '">' + data[i].interest + '</div> </div>');
  2191. }
  2192. $("#interest_history_table_row").show();
  2193. }
  2194. });
  2195. $("#hide_pending_payouts_table").click(function() {
  2196. hide_pending_payments = 1;
  2197. $('#pending_payouts_table_new').hide();
  2198. });
  2199. $("#hide_pending_deposits_table").click(function() {
  2200. hide_pending_deposits = 1;
  2201. $('#unconfirmed_deposits_table').hide();
  2202. });
  2203. $("#claim_bonus_link").click(function() {
  2204. if (max_deposit_bonus > parseFloat(min_bonus_amount)) {
  2205. $('.dep_bonus_max').html(max_deposit_bonus + " BTC");
  2206. if (max_deposit_bonus > parseFloat($('#balance').html())) {
  2207. $('.dep_bonus_max').val($('#balance').html());
  2208. } else {
  2209. $('.dep_bonus_max').val(max_deposit_bonus);
  2210. }
  2211. }
  2212. $('#balance2').html($('#balance').html());
  2213. });
  2214. $('#bet_history_table_rows').on('click', '.show_balance_before_after', function() {
  2215. $(this).toggleClass('fa-arrows-alt fa-arrow-up');
  2216. $(this).parents('.multiply_bet_history_table_row').children('.balance_before_after').toggle();
  2217. });
  2218. if ($.cookie('hide_no_apps_msg') != 1) {
  2219. $('#no_apps_msg').show();
  2220. }
  2221. $("#hide_no_apps_msg").click(function() {
  2222. $('#no_apps_msg').hide();
  2223. $.cookie.raw = true;
  2224. $.cookie('hide_no_apps_msg', 1, {
  2225. expires: 3650,
  2226. secure: true
  2227. });
  2228. });
  2229. if ($.cookie('hide_mine_btc_msg') != 1) {
  2230. $('#mine_btc_msg').show();
  2231. }
  2232. $("#exchange_btg_button").click(function(event) {
  2233. $("#exchange_btg_button").attr("disabled", true);
  2234. var posting = $.post('/', {
  2235. op: 'exchange_btg'
  2236. });
  2237. posting.done(function(data) {
  2238. var result = data.split(":");
  2239. if (result[0] == "s") {
  2240. $('#balance').html(result[2]);
  2241. balanceChanged();
  2242. $('#exchange_btg_link').hide();
  2243. }
  2244. DisplaySEMessage(result[0], result[1]);
  2245. $("#exchange_btg_button").attr("disabled", false);
  2246. });
  2247. });
  2248. var default_captcha = $.cookie('default_captcha');
  2249. if (default_captcha === 'recaptcha' || default_captcha === 'double_captchas') {
  2250. SwitchCaptchas(default_captcha);
  2251. }
  2252. if ($.cookie('hide_aw_fees_message') != 1) {
  2253. $('#aw_fees_message').show();
  2254. }
  2255. $("#hide_aw_fees_message").click(function() {
  2256. $('#aw_fees_message').hide();
  2257. $.cookie.raw = true;
  2258. $.cookie('hide_aw_fees_message', 1, {
  2259. expires: 3650,
  2260. secure: true
  2261. });
  2262. });
  2263. });
  2264.  
  2265. function BetErrors(code) {
  2266. if (code == "e1") {
  2267. $('#double_your_btc_error').html("Insufficient balance to make this bet");
  2268. }
  2269. if (code == "e2") {
  2270. $('#double_your_btc_error').html("Bet amount cannot be less than 0.00000001 BTC");
  2271. }
  2272. if (code == "e3") {
  2273. $('#double_your_btc_error').html("Bet amount cannot be empty");
  2274. }
  2275. if (code == "e4") {
  2276. $('#double_your_btc_error').html("Invalid bet method");
  2277. }
  2278. if (code == "e5") {
  2279. $('#double_your_btc_error').html("Bet amount cannot be more than " + max_win_amount + " BTC");
  2280. }
  2281. if (code == "e6") {
  2282. $('#double_your_btc_error').html("Unexpected error. Please log out and then log back in");
  2283. }
  2284. if (code == "e7") {
  2285. $('#double_your_btc_error').html("Payout multiplier has to be between 2x and 4750x");
  2286. }
  2287. if (code == "e8") {
  2288. $('#double_your_btc_error').html("Win amount cannot be more than " + max_win_amount + " BTC");
  2289. }
  2290. if (code == "e9") {
  2291. $('#double_your_btc_error').html("Your balance is insufficient to make this bet and try to win the jackpot<BR>Please un-select the jackpot bet option and try again");
  2292. }
  2293. if (code == "e10") {
  2294. $('#double_your_btc_error').html("Client Seed is either empty or has invalid characters (only letters and numbers allowed).<BR>Please correct it by clicking on the PROVABLY FAIR link above.");
  2295. }
  2296. if (code == "e11") {
  2297. $('#double_your_btc_error').html("Please wait for your previous bet to finish rolling.");
  2298. }
  2299. if (code == "e12") {
  2300. $('#double_your_btc_error').html("Betting is disabled in your country.");
  2301. }
  2302. }
  2303.  
  2304. function DoubleYourBTC(mode) {
  2305. $('#double_your_btc_digits').show();
  2306. var intervalID = setInterval(function() {
  2307. $("#multiplier_first_digit").html(Math.floor(Math.random() * 10));
  2308. $("#multiplier_second_digit").html(Math.floor(Math.random() * 10));
  2309. $("#multiplier_third_digit").html(Math.floor(Math.random() * 10));
  2310. $("#multiplier_fourth_digit").html(Math.floor(Math.random() * 10));
  2311. $("#multiplier_fifth_digit").html(Math.floor(Math.random() * 10));
  2312. }, 1);
  2313. $("#double_your_btc_bet_hi_button").attr("disabled", true);
  2314. $("#double_your_btc_bet_lo_button").attr("disabled", true);
  2315. var bet = $("#double_your_btc_stake").val();
  2316. var jackpot = 0;
  2317. var jackpot_arr = $('.play_jackpot:checkbox:checked').map(function() {
  2318. return this.value;
  2319. }).get();
  2320. if (jackpot_arr.length > 0) {
  2321. jackpot = jackpot_arr.toString();
  2322. }
  2323. var client_seed = $('#next_client_seed').val();
  2324. $.get('/cgi-bin/bet.pl?m=' + mode + '&client_seed=' + client_seed + '&jackpot=' + jackpot + '&stake=' + bet + '&multiplier=' + $("#double_your_btc_payout_multiplier").val() + '&rand=' + Math.random(), function(data) {
  2325. var result = data.split(":");
  2326. $('#double_your_btc_error').html("");
  2327. $('#double_your_btc_error').hide();
  2328. $('#double_your_btc_stake').removeClass('input-error');
  2329. $('#double_your_btc_bet_win').html("");
  2330. $('#double_your_btc_bet_lose').html("");
  2331. $('#double_your_btc_bet_win').hide();
  2332. $('#double_your_btc_bet_lose').hide();
  2333. $('#jackpot_message').removeClass('green');
  2334. $('#jackpot_message').removeClass('red');
  2335. $('#jackpot_message').html('');
  2336. $('#jackpot_message').hide();
  2337. $('#double_your_btc_result').show();
  2338. if (result[0] == "s1") {
  2339. var number = result[2];
  2340. var single_digit = number.split("");
  2341. if (number.toString().length < 5) {
  2342. var remaining = 5 - number.toString().length;
  2343. for (var i = 0; i < remaining; i++) {
  2344. single_digit.unshift('0');
  2345. }
  2346. }
  2347. clearInterval(intervalID);
  2348. $("#multiplier_first_digit").html(single_digit[0]);
  2349. $("#multiplier_second_digit").html(single_digit[1]);
  2350. $("#multiplier_third_digit").html(single_digit[2]);
  2351. $("#multiplier_fourth_digit").html(single_digit[3]);
  2352. $("#multiplier_fifth_digit").html(single_digit[4]);
  2353. $('#balance').html(result[3]);
  2354. max_deposit_bonus = parseFloat(result[18]).toFixed(8);
  2355. balanceChanged();
  2356. $('#balance_usd').html(result[5]);
  2357. $('#next_server_seed_hash').val(result[6]);
  2358. $('#next_nonce').html(result[8]);
  2359. $('.previous_server_seed').html(result[9]);
  2360. $('.previous_server_seed').val(result[9]);
  2361. $('#previous_server_seed_hash').val(result[10]);
  2362. $('.previous_client_seed').html(result[11]);
  2363. $('.previous_client_seed').val(result[11]);
  2364. $('.previous_nonce').html(result[12]);
  2365. $('#previous_roll').html(result[2]);
  2366. $('#no_previous_rolls_msg').hide();
  2367. $('#previous_rolls_table').show();
  2368. $('#previous_roll_strings').show();
  2369. $('#bonus_account_balance').html(result[16] + " BTC");
  2370. $('#bonus_account_wager').html(result[17] + " BTC");
  2371. if ((parseFloat(result[16]) <= 0 || parseFloat(result[17]) <= 0) && bonus_table_closed == 0) {
  2372. setTimeout(function() {
  2373. $('#bonus_account_table').hide();
  2374. $('#user_claimed_deposit_bonus').hide();
  2375. bonus_table_closed = 1;
  2376. }, 5000);
  2377. }
  2378. if (max_deposit_bonus >= parseFloat(min_bonus_amount) && bonus_table_closed == 1) {
  2379. $('#bonus_eligible_msg').show();
  2380. }
  2381. if (parseFloat(result[19]) > 0 && parseFloat(result[19]) < 100) {
  2382. $('.multiply_max_bet').html(result[19] + " BTC");
  2383. $('.multiply_max_bet').val(result[19]);
  2384. max_win_amount = parseFloat(result[19]);
  2385. }
  2386. $("#verify_rolls_link").attr("href", "https://s3.amazonaws.com/roll-verifier/verify.html?server_seed=" + result[9] + "&client_seed=" + result[11] + "&server_seed_hash=" + result[10] + "&nonce=" + result[12]);
  2387. var capsmode = mode.toUpperCase();
  2388. if (result[1] == "w") {
  2389. $('#double_your_btc_bet_win').show();
  2390. $('#double_your_btc_bet_win').html("You BET " + capsmode + " so you win " + result[4] + " BTC!");
  2391. if ($("#manual_enable_sounds").is(":checked")) {
  2392. $.ionSound.play("bell_ring");
  2393. }
  2394. }
  2395. if (result[1] == "l") {
  2396. $('#double_your_btc_bet_lose').show();
  2397. $('#double_your_btc_bet_lose').html("You BET " + capsmode + " so you lose " + result[4] + " BTC");
  2398. if ($("#manual_enable_sounds").is(":checked")) {
  2399. $.ionSound.play("tap");
  2400. }
  2401. }
  2402. if (jackpot != 0) {
  2403. $('#jackpot_message').show();
  2404. if (result[13] == "1") {
  2405. $('#jackpot_message').addClass('green');
  2406. $('#jackpot_message').html("Congratulations! You have won the jackpot of " + result[15] + " BTC");
  2407. } else {
  2408. $('#jackpot_message').addClass('red');
  2409. $('#jackpot_message').html("Sorry, you did not win the jackpot.");
  2410. }
  2411. }
  2412. $("#double_your_btc_bet_hi_button").attr("disabled", false);
  2413. $("#double_your_btc_bet_lo_button").attr("disabled", false);
  2414. insertIntoBetHistory(result[1], result[4], result[2], result[9], result[11], result[10], result[12], "DICE", mode, jackpot, bet, $("#double_your_btc_payout_multiplier").val(), result[20], result[21], result[22], result[23]);
  2415. } else {
  2416. $('#double_your_btc_error').show();
  2417. $('#double_your_btc_digits').hide();
  2418. if (parseFloat(result[1]) > 0 && parseFloat(result[1]) < 100) {
  2419. $('.multiply_max_bet').html(result[1] + " BTC");
  2420. $('.multiply_max_bet').val(result[1]);
  2421. max_win_amount = parseFloat(result[1]);
  2422. }
  2423. BetErrors(result[0]);
  2424. clearInterval(intervalID);
  2425. $("#multiplier_first_digit").html(0);
  2426. $("#multiplier_second_digit").html(0);
  2427. $("#multiplier_third_digit").html(0);
  2428. $("#multiplier_fourth_digit").html(0);
  2429. $("#multiplier_fifth_digit").html(0);
  2430. if (result[0] == "e6") {
  2431. $("#double_your_btc_bet_hi_button").attr("disabled", true);
  2432. $("#double_your_btc_bet_lo_button").attr("disabled", true);
  2433. } else {
  2434. $("#double_your_btc_bet_hi_button").attr("disabled", false);
  2435. $("#double_your_btc_bet_lo_button").attr("disabled", false);
  2436. }
  2437. }
  2438. }).fail(function() {
  2439. $('#double_your_btc_result').show();
  2440. $('#double_your_btc_error').show();
  2441. $('#double_your_btc_digits').hide();
  2442. $('#double_your_btc_error').html("Request timed out. Please try again.");
  2443. clearInterval(intervalID);
  2444. $("#multiplier_first_digit").html(0);
  2445. $("#multiplier_second_digit").html(0);
  2446. $("#multiplier_third_digit").html(0);
  2447. $("#multiplier_fourth_digit").html(0);
  2448. $("#multiplier_fifth_digit").html(0);
  2449. $("#double_your_btc_bet_hi_button").attr("disabled", false);
  2450. $("#double_your_btc_bet_lo_button").attr("disabled", false);
  2451. });
  2452. }
  2453.  
  2454. function title_countdown(tot_time) {
  2455. var countdown_end = (new Date() / 1000) + tot_time;
  2456. setInterval(function() {
  2457. if (tot_time < 1) {
  2458. $('title').html('0m:0s - FreeBitco.in - Win free bitcoins every hour!');
  2459. return;
  2460. } else {
  2461. tot_time = countdown_end - (new Date() / 1000) - 1;
  2462. var mins = Math.floor(tot_time / 60);
  2463. var secs = Math.floor(tot_time - (mins * 60));
  2464. $('title').html(mins + 'm:' + secs + 's - ' + 'FreeBitco.in - Win free bitcoins every hour!');
  2465. }
  2466. }, 1000);
  2467. }
  2468.  
  2469. function ShowMoreRefs(count) {
  2470. var refs_shown = parseInt($('#referrals_shown').val(), 0);
  2471. $.get('/?op=show_more_refs&start=' + refs_shown + '&count=' + count, function(data) {
  2472. $("#referral_list_table").append(data);
  2473. if (count == 10) {
  2474. $('#referrals_shown').val(refs_shown + 10);
  2475. } else if (count == 20) {
  2476. $('#referrals_shown').val(refs_shown + 20);
  2477. } else if (count == 9999999) {
  2478. $('#show_more_refs_options').hide();
  2479. }
  2480. });
  2481. }
  2482.  
  2483. function ShowAdvancedStats(days) {
  2484. $.get('/?op=show_advanced_stats&days=' + days, function(data) {
  2485. $('#detailed_ref_stats_table').show();
  2486. $('#detailed_ref_stats_table').find("tr:gt(0)").remove();
  2487. $("#detailed_ref_stats_table").append(data);
  2488. });
  2489. }
  2490.  
  2491. function SwitchTabs() {
  2492. $('#top_leader_iframe').attr('src', $('#top_leader_iframe').attr('src'));
  2493. $('#left_sky_iframe').attr('src', $('#left_sky_iframe').attr('src'));
  2494. $('#right_sky_iframe').attr('src', $('#right_sky_iframe').attr('src'));
  2495. }
  2496.  
  2497. function GenerateDepositAddress() {
  2498. $.get('/?op=generate_bitcoin_deposit_address', function(data) {
  2499. $('#deposit_address').html('<p>Send bitcoins to the address below to top up your advertising account balance.</p><p><div style="width:400px;"><input type="text" size=40 style="text-align:center;" value="' + data + '" onClick="this.select();"></div></p>');
  2500. });
  2501. }
  2502.  
  2503. function DeleteAdCampaign(id) {
  2504. var conf = confirm("Are you sure you wish to delete this ad campaign? Deleting an ad campaign also deletes it's stats. If you wish to stop running this ad but want to retain it's stats, please pause it instead. Click OK if you would like to proceed with deleting this ad campaign else click CANCEL.");
  2505. if (conf == true) {
  2506. $('#ad_campaign_' + id).hide();
  2507. $('#ad_campaign_details_' + id).hide();
  2508. $.get('/?op=delete_ad_campaign&id=' + id, function() {});
  2509. }
  2510. }
  2511.  
  2512. function StartAdCampaign(id) {
  2513. $('#start_pause_ad_campaign_icon_' + id).html('<a href="javascript:void(0);" onclick="PauseAdCampaign(' + id + ');"><img src="//static6.freebitco.in/images/pause3.png" border=0 alt="PAUSE"></a>');
  2514. $('#ad_campaign_status_' + id).html('<span style="color:#006600;">RUNNING</span>');
  2515. $.get('/?op=start_ad_campaign&id=' + id, function(data) {
  2516. if (data == "e2") {
  2517. $('#ad_campaign_status_' + id).html('<span style="color:red;">REFILL ADVERTISING ACCOUNT</span>');
  2518. $('#start_pause_ad_campaign_icon_' + id).html('');
  2519. }
  2520. });
  2521. }
  2522.  
  2523. function PauseAdCampaign(id) {
  2524. $('#start_pause_ad_campaign_icon_' + id).html('<a href="javascript:void(0);" onclick="StartAdCampaign(' + id + ');"><img src="//static6.freebitco.in/images/start4.png" border=0 alt="START"></a>');
  2525. $('#ad_campaign_status_' + id).html('<span style="color:red;">PAUSED</span>');
  2526. $.get('/?op=pause_ad_campaign&id=' + id, function() {});
  2527. }
  2528.  
  2529. function ShowAdDetails(id) {
  2530. $('#ad_details_table').hide();
  2531. $('#edit_ad_error').hide();
  2532. $('#edit_ad_success').hide();
  2533. $.get('/?op=show_ad_details&id=' + id, function(data) {
  2534. var result = data.split(":");
  2535. $('#ad_details_table').show();
  2536. $('#ad_details_popup_campaign_name').val(result[0]);
  2537. $('#ad_details_popup_banner_image').attr("src", "//fbtc-uab.freebitco.in/" + result[1]);
  2538. $('#ad_details_popup_daily_budget').val(result[2]);
  2539. $('#ad_details_popup_total_budget').val(result[3]);
  2540. $('#ad_details_popup_destination_url').val(result[4]);
  2541. $('#ad_details_popup_max_cpm').val(result[8]);
  2542. $('#ad_details_popup_ad_id').val(id);
  2543. $('#ad_details_popup_freq_cap').val(result[9]);
  2544. var target_countries = result[10].split(",");
  2545. if (result[5] == '1') {
  2546. $('#ad_details_popup_adv_bit').prop('checked', true);
  2547. } else {
  2548. $('#ad_details_popup_adv_bit').prop('checked', false);
  2549. }
  2550. if (result[6] == '1') {
  2551. $('#ad_details_popup_adv_doge').prop('checked', true);
  2552. } else {
  2553. $('#ad_details_popup_adv_doge').prop('checked', false);
  2554. }
  2555. var ad_position = result[7].split("_");
  2556. $('#ad_details_popup_ad_position').html(ad_position[0].charAt(0).toUpperCase() + ad_position[0].slice(1) + ' - ' + ad_position[1] + 'x' + ad_position[2]);
  2557. $("#ad_details_target_country_code").val(target_countries);
  2558. });
  2559. }
  2560.  
  2561. function ShowAdStats(id) {
  2562. $('#daily_ad_stats_table').hide();
  2563. $.get('/?op=show_daily_ad_stats&id=' + id, function(data) {
  2564. var rows = data.split(";");
  2565. $('#daily_ad_stats_campaign_name').html(rows[0]);
  2566. rows.shift();
  2567. $('#daily_ad_stats_table').show();
  2568. $('#daily_ad_stats_table').find("tr:gt(0)").remove();
  2569. var last_but = rows.length - 1;
  2570. for (var i = 0; i < last_but; i++) {
  2571. var elements = rows[i].split(":");
  2572. $("#daily_ad_stats_table").append("<tr><td>" + elements[0] + "</td><td>" + commaSeparateNumber(elements[1]) + "</td><td>" + commaSeparateNumber(elements[2]) + "</td><td>" + elements[3] + "</td><td>" + elements[4] + "</td></tr>");
  2573. }
  2574. var totals = rows[last_but].split(":");
  2575. $("#daily_ad_stats_table").append("<tr><td class=bold>TOTAL</td><td>" + commaSeparateNumber(totals[0]) + "</td><td>" + commaSeparateNumber(totals[1]) + "</td><td>" + totals[2] + "</td><td>" + totals[3] + "</td></tr>");
  2576. });
  2577. }
  2578.  
  2579. function RefreshAdBalance() {
  2580. $.get('/?op=refresh_ad_balance', function(data) {
  2581. $('#ad_balance').html(data);
  2582. });
  2583. }
  2584.  
  2585. function UpdateAdStats() {
  2586. $.get('/?op=update_ad_stats', function(data) {
  2587. var rows = data.split(";");
  2588. for (var i = 0; i < rows.length; i++) {
  2589. var elements = rows[i].split(":");
  2590. if (elements[1] < 2) {
  2591. $('#ad_campaign_status_' + elements[0]).html("<span style='color:#FF6600;'>PENDING APPROVAL</span>");
  2592. $('#start_pause_ad_campaign_icon_' + elements[0]).html("");
  2593. } else if (elements[1] == 2) {
  2594. $('#ad_campaign_status_' + elements[0]).html("<span style='color:#006600;'>APPROVED</span>");
  2595. $('#start_pause_ad_campaign_icon_' + elements[0]).html("<a href='javascript:void(0);' onclick='StartAdCampaign(" + elements[0] + ");'><img src='//static6.freebitco.in/images/start4.png' border=0 alt='START'></a>");
  2596. } else if (elements[1] == 3) {
  2597. $('#ad_campaign_status_' + elements[0]).html("<span style='color:#006600;'>RUNNING</span>");
  2598. $('#start_pause_ad_campaign_icon_' + elements[0]).html("<a href='javascript:void(0);' onclick='PauseAdCampaign(" + elements[0] + ");'><img src='//static6.freebitco.in/images/pause3.png' border=0 alt='PAUSE'></a>");
  2599. } else if (elements[1] == 4) {
  2600. $('#ad_campaign_status_' + elements[0]).html("<span style='color:red;'>PAUSED</span>");
  2601. $('#start_pause_ad_campaign_icon_' + elements[0]).html("<a href='javascript:void(0);' onclick='StartAdCampaign(" + elements[0] + ");'><img src='//static6.freebitco.in/images/start4.png' border=0 alt='START'></a>");
  2602. } else if (elements[1] == 5) {
  2603. $('#ad_campaign_status_' + elements[0]).html("<span style='color:red;'>REJECTED&nbsp;<a href='javascript:void(0);' onclick='GetAdRejectedReason(" + elements[0] + ", " + elements[5] + ");'>?</a></span>");
  2604. $('#start_pause_ad_campaign_icon_' + elements[0]).html("");
  2605. } else if (elements[1] == 6) {
  2606. $('#ad_campaign_status_' + elements[0]).html("<span style='color:red;'>EXCEEDED DAILY BUDGET</span>");
  2607. $('#start_pause_ad_campaign_icon_' + elements[0]).html("<a href='javascript:void(0);' onclick='PauseAdCampaign(" + elements[0] + ");'><img src='//static6.freebitco.in/images/pause3.png' border=0 alt='PAUSE'></a>");
  2608. } else if (elements[1] == 7) {
  2609. $('#ad_campaign_status_' + elements[0]).html("<span style='color:red;'>EXCEEDED TOTAL BUDGET</span>");
  2610. $('#start_pause_ad_campaign_icon_' + elements[0]).html("<a href='javascript:void(0);' onclick='PauseAdCampaign(" + elements[0] + ");'><img src='//static6.freebitco.in/images/pause3.png' border=0 alt='PAUSE'></a>");
  2611. } else if (elements[1] == 8) {
  2612. $('#ad_campaign_status_' + elements[0]).html("<span style='color:red;'>REFILL ADVERTISING ACCOUNT</span>");
  2613. $('#start_pause_ad_campaign_icon_' + elements[0]).html("");
  2614. }
  2615. $('#campaign_views_' + elements[0]).html(commaSeparateNumber(elements[2]));
  2616. $('#campaign_clicks_' + elements[0]).html(commaSeparateNumber(elements[3]));
  2617. $('#campaign_total_cost_' + elements[0]).html(elements[4]);
  2618. }
  2619. });
  2620. }
  2621.  
  2622. function commaSeparateNumber(val) {
  2623. while (/(\d+)(\d{3})/.test(val.toString())) {
  2624. val = val.toString().replace(/(\d+)(\d{3})/, '$1' + ',' + '$2');
  2625. }
  2626. return val;
  2627. }
  2628.  
  2629. function AutoBet(mode, bet_count, max_bet, base_bet, autobet_win_return_to_base, autobet_lose_return_to_base, autobet_win_increase_bet_percent, autobet_lose_increase_bet_percent, change_client_seed, reset_after_max_bet, rolls_played, biggest_bet, biggest_win, session_pl, autobet_win_change_odds, autobet_lose_change_odds, stop_after_profit, stop_after_loss, logging, enable_sounds) {
  2630. if (stop_autobet == true) {
  2631. StopAutoBet();
  2632. return;
  2633. } else {
  2634. $('#double_your_btc_digits').show();
  2635. $('#autobet_results_box').show();
  2636. $("#double_your_btc_bet_hi_button").attr("disabled", true);
  2637. $("#double_your_btc_bet_lo_button").attr("disabled", true);
  2638. var bet = parseFloat($("#double_your_btc_stake").val()).toFixed(8);
  2639. if (parseFloat(bet) > parseFloat(biggest_bet)) {
  2640. biggest_bet = bet;
  2641. }
  2642. autobet_win_increase_bet_percent = parseFloat(autobet_win_increase_bet_percent).toFixed(2);
  2643. autobet_lose_increase_bet_percent = parseFloat(autobet_lose_increase_bet_percent).toFixed(2);
  2644. var jackpot = 0;
  2645. var jackpot_arr = $('.play_jackpot:checkbox:checked').map(function() {
  2646. return this.value;
  2647. }).get();
  2648. if (jackpot_arr.length > 0) {
  2649. jackpot = jackpot_arr.toString();
  2650. }
  2651. var client_seed = $('#next_client_seed').val();
  2652. var new_mode = mode;
  2653. if (mode == "alternate") {
  2654. if (bet_count % 2 == 0) {
  2655. new_mode = "hi";
  2656. } else {
  2657. new_mode = "lo";
  2658. }
  2659. }
  2660. $.get('/cgi-bin/bet.pl?m=' + new_mode + '&client_seed=' + client_seed + '&jackpot=' + jackpot + '&stake=' + bet + '&multiplier=' + $("#double_your_btc_payout_multiplier").val() + '&rand=' + Math.random(), function(data) {
  2661. var result = data.split(":");
  2662. $('#double_your_btc_error').html("");
  2663. $('#double_your_btc_error').hide();
  2664. $('#double_your_btc_stake').removeClass('input-error');
  2665. $('#double_your_btc_bet_win').html("");
  2666. $('#double_your_btc_bet_lose').html("");
  2667. $('#double_your_btc_bet_win').hide();
  2668. $('#double_your_btc_bet_lose').hide();
  2669. $('#jackpot_message').removeClass('green');
  2670. $('#jackpot_message').removeClass('red');
  2671. $('#jackpot_message').html('');
  2672. $('#jackpot_message').hide();
  2673. $('#double_your_btc_result').show();
  2674. if (result[0] == "s1") {
  2675. bet_count--;
  2676. rolls_played++;
  2677. $('#rolls_played_count').html(rolls_played);
  2678. $('#rolls_remaining_count').html(bet_count);
  2679. $('#autobet_highest_bet').html(biggest_bet + " BTC");
  2680. var number = result[2];
  2681. var single_digit = number.split("");
  2682. if (number.toString().length < 5) {
  2683. var remaining = 5 - number.toString().length;
  2684. for (var i = 0; i < remaining; i++) {
  2685. single_digit.unshift('0');
  2686. }
  2687. }
  2688. $("#multiplier_first_digit").html(single_digit[0]);
  2689. $("#multiplier_second_digit").html(single_digit[1]);
  2690. $("#multiplier_third_digit").html(single_digit[2]);
  2691. $("#multiplier_fourth_digit").html(single_digit[3]);
  2692. $("#multiplier_fifth_digit").html(single_digit[4]);
  2693. $('#balance').html(result[3]);
  2694. max_deposit_bonus = parseFloat(result[18]).toFixed(8);
  2695. balanceChanged();
  2696. $('#balance_usd').html(result[5]);
  2697. $('#next_server_seed_hash').val(result[6]);
  2698. $('#next_nonce').html(result[8]);
  2699. $('.previous_server_seed').html(result[9]);
  2700. $('.previous_server_seed').val(result[9]);
  2701. $('#previous_server_seed_hash').val(result[10]);
  2702. $('.previous_client_seed').html(result[11]);
  2703. $('.previous_client_seed').val(result[11]);
  2704. $('.previous_nonce').html(result[12]);
  2705. $('#previous_roll').html(result[2]);
  2706. $('#no_previous_rolls_msg').hide();
  2707. $('#previous_rolls_table').show();
  2708. $('#previous_roll_strings').show();
  2709. $('#bonus_account_balance').html(result[16] + " BTC");
  2710. $('#bonus_account_wager').html(result[17] + " BTC");
  2711. if ((parseFloat(result[16]) <= 0 || parseFloat(result[17]) <= 0) && bonus_table_closed == 0) {
  2712. setTimeout(function() {
  2713. $('#bonus_account_table').hide();
  2714. $('#user_claimed_deposit_bonus').hide();
  2715. bonus_table_closed = 1;
  2716. }, 5000);
  2717. }
  2718. if (max_deposit_bonus >= parseFloat(min_bonus_amount) && bonus_table_closed == 1) {
  2719. $('#bonus_eligible_msg').show();
  2720. }
  2721. if (parseFloat(result[19]) > 0 && parseFloat(result[19]) < 100) {
  2722. $('.multiply_max_bet').html(result[19] + " BTC");
  2723. $('.multiply_max_bet').val(result[19]);
  2724. max_win_amount = parseFloat(result[19]);
  2725. }
  2726. $("#verify_rolls_link").attr("href", "https://s3.amazonaws.com/roll-verifier/verify.html?server_seed=" + result[9] + "&client_seed=" + result[11] + "&server_seed_hash=" + result[10] + "&nonce=" + result[12]);
  2727. insertIntoBetHistory(result[1], result[4], result[2], result[9], result[11], result[10], result[12], "DICE", new_mode, jackpot, bet, $("#double_your_btc_payout_multiplier").val(), result[20], result[21], result[22], result[23]);
  2728. var capsmode = new_mode.toUpperCase();
  2729. var bet_profit = "";
  2730. if (result[1] == "w") {
  2731. $('#double_your_btc_bet_win').show();
  2732. $('#double_your_btc_bet_win').html("You BET " + capsmode + " so you win " + result[4] + " BTC!");
  2733. bet_profit = "<font color=green>+" + result[4] + "</font>";
  2734. session_pl = parseFloat(((session_pl * 100000000) + (result[4] * 100000000)) / 100000000).toFixed(8);
  2735. if (autobet_win_return_to_base == 1) {
  2736. $("#double_your_btc_stake").val(parseFloat(base_bet).toFixed(8));
  2737. } else if (parseFloat(autobet_win_increase_bet_percent) != 0) {
  2738. var new_bet_size = parseFloat((bet * ((autobet_win_increase_bet_percent / 100) + 1))).toFixed(8);
  2739. $("#double_your_btc_stake").val(new_bet_size);
  2740. }
  2741. if (parseFloat(result[4]) > parseFloat(biggest_win)) {
  2742. biggest_win = parseFloat(result[4]).toFixed(8);
  2743. }
  2744. $('#autobet_highest_win').html(biggest_win + " BTC");
  2745. if (autobet_win_change_odds != 0) {
  2746. $("#double_your_btc_payout_multiplier").val(autobet_win_change_odds);
  2747. $("#double_your_btc_payout_multiplier").keyup();
  2748. }
  2749. if (enable_sounds === 1) {
  2750. $.ionSound.play("bell_ring");
  2751. }
  2752. }
  2753. if (result[1] == "l") {
  2754. $('#double_your_btc_bet_lose').show();
  2755. $('#double_your_btc_bet_lose').html("You BET " + capsmode + " so you lose " + result[4] + " BTC");
  2756. bet_profit = "<font color=red>-" + result[4] + "</font>";
  2757. session_pl = parseFloat(((session_pl * 100000000) - (result[4] * 100000000)) / 100000000).toFixed(8);
  2758. if (autobet_lose_return_to_base == 1) {
  2759. $("#double_your_btc_stake").val(parseFloat(base_bet).toFixed(8));
  2760. } else if (autobet_lose_increase_bet_percent != 0) {
  2761. var new_bet_size = parseFloat((bet * ((autobet_lose_increase_bet_percent / 100) + 1))).toFixed(8);
  2762. $("#double_your_btc_stake").val(new_bet_size);
  2763. }
  2764. if (autobet_lose_change_odds != 0) {
  2765. $("#double_your_btc_payout_multiplier").val(autobet_lose_change_odds);
  2766. $("#double_your_btc_payout_multiplier").keyup();
  2767. }
  2768. if (enable_sounds === 1) {
  2769. $.ionSound.play("tap");
  2770. }
  2771. } /*if (logging === 1){var currentdate = new Date();var curtime = currentdate.getHours() + ":" + currentdate.getMinutes() + ":" + currentdate.getSeconds();autobet_history[rolls_played-1] = {'time': curtime, 'multiplier': $("#double_your_btc_payout_multiplier").val(),'stake': bet,'bet': capsmode,'roll': single_digit[0]+single_digit[1]+single_digit[2]+single_digit[3]+single_digit[4],'profit': bet_profit,'verify': "<a href='https://s3.amazonaws.com/roll-verifier/verify.html?server_seed="+result[9]+"&client_seed="+result[11]+"&server_seed_hash="+result[10]+"&nonce="+result[12]+"' target=_blank>CLICK</a>"};}*/
  2772. if (jackpot != 0) {
  2773. $('#jackpot_message').show();
  2774. if (result[13] == "1") {
  2775. $('#jackpot_message').addClass('green');
  2776. $('#jackpot_message').html("Congratulations! You have won the jackpot of " + result[15] + " BTC");
  2777. } else {
  2778. $('#jackpot_message').addClass('red');
  2779. $('#jackpot_message').html("Sorry, you did not win the jackpot.");
  2780. }
  2781. }
  2782. $("#double_your_btc_bet_hi_button").attr("disabled", false);
  2783. $("#double_your_btc_bet_lo_button").attr("disabled", false);
  2784. $('#autobet_pl').removeClass();
  2785. $('#autobet_pl').addClass('bold');
  2786. if (parseFloat(session_pl) < 0) {
  2787. $('#autobet_pl').css({
  2788. 'background-color': '#FF6666'
  2789. });
  2790. } else {
  2791. $('#autobet_pl').css({
  2792. 'background-color': '#33FF33'
  2793. });
  2794. }
  2795. $('#autobet_pl').html(session_pl + ' BTC');
  2796. if (bet_count > 0) {
  2797. bet = parseFloat($("#double_your_btc_stake").val()).toFixed(8);
  2798. if (parseFloat(bet) > parseFloat(max_bet) || parseFloat(bet * ($("#double_your_btc_payout_multiplier").val() - 1)) > parseFloat(max_win_amount)) {
  2799. if (reset_after_max_bet == 1) {
  2800. $("#double_your_btc_stake").val(parseFloat(base_bet).toFixed(8));
  2801. } else {
  2802. stop_autobet = true;
  2803. }
  2804. }
  2805. if (change_client_seed == 1) {
  2806. charSet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
  2807. var randomString = '';
  2808. for (var i = 0; i < 16; i++) {
  2809. var randomPoz = Math.floor(Math.random() * charSet.length);
  2810. randomString += charSet.substring(randomPoz, randomPoz + 1);
  2811. }
  2812. $('#next_client_seed').val(randomString);
  2813. }
  2814. if ((parseFloat(stop_after_profit) > 0 && parseFloat(session_pl) >= parseFloat(stop_after_profit)) || (parseFloat(stop_after_loss) > 0 && parseFloat(session_pl) <= -1 * parseFloat(stop_after_loss))) {
  2815. stop_autobet = true;
  2816. }
  2817. AutoBet(mode, bet_count, max_bet, base_bet, autobet_win_return_to_base, autobet_lose_return_to_base, autobet_win_increase_bet_percent, autobet_lose_increase_bet_percent, change_client_seed, reset_after_max_bet, rolls_played, biggest_bet, biggest_win, session_pl, autobet_win_change_odds, autobet_lose_change_odds, stop_after_profit, stop_after_loss, logging, enable_sounds);
  2818. } else {
  2819. StopAutoBet();
  2820. }
  2821. } else {
  2822. $('#double_your_btc_error').show();
  2823. $('#double_your_btc_digits').hide();
  2824. if (parseFloat(result[1]) > 0 && parseFloat(result[1]) < 100) {
  2825. $('.multiply_max_bet').html(result[1] + " BTC");
  2826. $('.multiply_max_bet').val(result[1]);
  2827. max_win_amount = parseFloat(result[1]);
  2828. }
  2829. BetErrors(result[0]);
  2830. StopAutoBet();
  2831. if (result[0] == "e6") {
  2832. $("#double_your_btc_bet_hi_button").attr("disabled", true);
  2833. $("#double_your_btc_bet_lo_button").attr("disabled", true);
  2834. } else {
  2835. $("#double_your_btc_bet_hi_button").attr("disabled", false);
  2836. $("#double_your_btc_bet_lo_button").attr("disabled", false);
  2837. }
  2838. }
  2839. }).fail(function() {
  2840. AutoBet(mode, bet_count, max_bet, base_bet, autobet_win_return_to_base, autobet_lose_return_to_base, autobet_win_increase_bet_percent, autobet_lose_increase_bet_percent, change_client_seed, reset_after_max_bet, rolls_played, biggest_bet, biggest_win, session_pl, autobet_win_change_odds, autobet_lose_change_odds, stop_after_profit, stop_after_loss, logging);
  2841. });
  2842. }
  2843. }
  2844.  
  2845. function RefreshPageAfterFreePlayTimerEnds() {
  2846. if (autobet_dnr == false) {
  2847. if (free_play_sound == true) {
  2848. $.ionSound.play("jump_up");
  2849. }
  2850. window.location.replace("http://freebitco.in/?op=home");
  2851. }
  2852. }
  2853.  
  2854. function StopAutoBet() {
  2855. $("#double_your_btc_stake").val('0.00000001');
  2856. $("#double_your_btc_payout_multiplier").val(2);
  2857. $("#double_your_btc_payout_multiplier").keyup();
  2858. $(".play_jackpot").prop("checked", false);
  2859. $("#auto_betting_button").show();
  2860. $("#stop_auto_betting").hide();
  2861. stop_autobet = false;
  2862. autobet_running = false;
  2863. autobet_dnr = false;
  2864. $("#start_autobet").removeClass('close-reveal-modal');
  2865. }
  2866.  
  2867. function GenerateMainDepositAddress() {
  2868. $.get('/?op=generate_main_bitcoin_deposit_address', function(data) {
  2869. var result = data.split(":");
  2870. DisplaySEMessage(result[0], result[1]);
  2871. if (result[0] == "s") {
  2872. $("#main_deposit_address_box").show();
  2873. $("#main_deposit_address_qr_code").show();
  2874. $("#main_deposit_address_qr_code").html('<img src="//chart.googleapis.com/chart?cht=qr&chs=200x200&chl=' + result[2] + '&chld=H|0">');
  2875. $("#main_deposit_address").val(result[2]);
  2876. $("#generate_new_address_msg").hide();
  2877. }
  2878. });
  2879. }
  2880.  
  2881. function myDecisionFunction() {
  2882. if (submissionEnabled) {
  2883. submissionEnabled = false;
  2884. return true;
  2885. } else {
  2886. return false;
  2887. }
  2888. }
  2889.  
  2890. function GetAdRejectedReason(ad_id, reject_code) {
  2891. var common = "Ad Rejection Reason: ";
  2892. if (reject_code == 1) {
  2893. alert(common + "Banner is too distracting.");
  2894. } else if (reject_code == 2) {
  2895. alert(common + "Banner or website contains 18+ content.");
  2896. } else if (reject_code == 3) {
  2897. alert(common + "Destination URL is invalid or does not load.");
  2898. } else if (reject_code == 4) {
  2899. $.get('/?op=banner_reject_reason&id=' + ad_id, function(data) {
  2900. alert(common + data);
  2901. });
  2902. }
  2903. }
  2904.  
  2905. function UpdateLotteryStats() {
  2906. var socket = io('wsnew.freebitco.in/fbtc_lottery_stats', {
  2907. autoConnect: true,
  2908. reconnectionDelayMax: 60000,
  2909. port: 443,
  2910. query: "userid=" + socket_userid + "&password=" + socket_password
  2911. });
  2912. socket.on('fbtc_lottery_stats', function(data) {
  2913. if (data.fbtc_current_lottery_round > 0) {
  2914. $(".current_lottery_round").html(ReplaceNumberWithCommas(parseInt(data.fbtc_current_lottery_round)));
  2915. }
  2916. if (data.fbtc_lottery_prize_amount >= 0) {
  2917. $(".lottery_first_prize").html(ReplaceNumberWithCommas(parseFloat(data.fbtc_lottery_prize_amount * 512 * 0.000977517 / 100000000).toFixed(8)));
  2918. $(".lottery_second_prize").html(ReplaceNumberWithCommas(parseFloat(data.fbtc_lottery_prize_amount * 256 * 0.000977517 / 100000000).toFixed(8)));
  2919. $(".lottery_third_prize").html(ReplaceNumberWithCommas(parseFloat(data.fbtc_lottery_prize_amount * 128 * 0.000977517 / 100000000).toFixed(8)));
  2920. $(".lottery_fourth_prize").html(ReplaceNumberWithCommas(parseFloat(data.fbtc_lottery_prize_amount * 64 * 0.000977517 / 100000000).toFixed(8)));
  2921. $(".lottery_fifth_prize").html(ReplaceNumberWithCommas(parseFloat(data.fbtc_lottery_prize_amount * 32 * 0.000977517 / 100000000).toFixed(8)));
  2922. $(".lottery_sixth_prize").html(ReplaceNumberWithCommas(parseFloat(data.fbtc_lottery_prize_amount * 16 * 0.000977517 / 100000000).toFixed(8)));
  2923. $(".lottery_seventh_prize").html(ReplaceNumberWithCommas(parseFloat(data.fbtc_lottery_prize_amount * 8 * 0.000977517 / 100000000).toFixed(8)));
  2924. $(".lottery_eighth_prize").html(ReplaceNumberWithCommas(parseFloat(data.fbtc_lottery_prize_amount * 4 * 0.000977517 / 100000000).toFixed(8)));
  2925. $(".lottery_ninth_prize").html(ReplaceNumberWithCommas(parseFloat(data.fbtc_lottery_prize_amount * 2 * 0.000977517 / 100000000).toFixed(8)));
  2926. $(".lottery_tenth_prize").html(ReplaceNumberWithCommas(parseFloat(data.fbtc_lottery_prize_amount * 1 * 0.000977517 / 100000000).toFixed(8)));
  2927. }
  2928. if (data.fbtc_total_lottery_tickets >= 0) {
  2929. $("#total_lottery_tickets").html(ReplaceNumberWithCommas(data.fbtc_total_lottery_tickets));
  2930. var user_lottery_tickets = parseInt($("#user_lottery_tickets").html().replace(/\,/g, ''));
  2931. if (user_lottery_tickets >= 0) {
  2932. $("#lottery_win_chance").html(ReplaceNumberWithCommas(parseFloat(((1 - Math.pow(((data.fbtc_total_lottery_tickets - user_lottery_tickets) / data.fbtc_total_lottery_tickets), 10)) * 100) * 100000000 / 100000000).toFixed(8)));
  2933. } else {
  2934. $("#lottery_win_chance").html('0.00000000');
  2935. }
  2936. }
  2937. if (data.fbtc_lottery_ticket_price > 0) {
  2938. $(".lottery_ticket_price").html(parseFloat(data.fbtc_lottery_ticket_price / 100000000).toFixed(8));
  2939. }
  2940. if (data.fbtc_current_lottery_round_end > 0) {
  2941. var lottery_timer_end = $('#lottery_round_end').countdown('option', 'until');
  2942. var d = new Date();
  2943. var curtime = parseInt(d.getTime() / 1000);
  2944. var lottery_end_time = curtime + parseInt(lottery_timer_end);
  2945. if (data.fbtc_current_lottery_round_end - lottery_end_time > 29 || lottery_end_time - data.fbtc_current_lottery_round_end > 29) {
  2946. $('#lottery_round_end').countdown('destroy');
  2947. $('#lottery_round_end').countdown({
  2948. until: '+' + parseInt(data.fbtc_current_lottery_round_end) - curtime,
  2949. format: 'DHMS'
  2950. });
  2951. }
  2952. }
  2953. });
  2954. }
  2955.  
  2956. function UpdateStats() {
  2957. var socket = io('wsnew.freebitco.in/fbtc_stats', {
  2958. autoConnect: true,
  2959. reconnectionDelayMax: 60000,
  2960. port: 443,
  2961. query: "userid=" + socket_userid + "&password=" + socket_password
  2962. });
  2963. socket.on('fbtc_stats', function(data) {
  2964. if (data.fbtc_total_btc_won_number > 0) {
  2965. $("#total_btc_won_number").html(ReplaceNumberWithCommas(parseFloat(data.fbtc_total_btc_won_number * 100000000 / 100000000).toFixed(8)) + " BTC");
  2966. $("#total_btc_won_number_signup_page").html(ReplaceNumberWithCommas(parseFloat(data.fbtc_total_btc_won_number * 100000000 / 100000000).toFixed(8)));
  2967. }
  2968. if (data.fbtc_total_plays_number > 0) {
  2969. $("#total_plays_number").html(ReplaceNumberWithCommas(data.fbtc_total_plays_number));
  2970. }
  2971. if (data.fbtc_total_signups_number > 0) {
  2972. $("#total_signups_number").html(ReplaceNumberWithCommas(data.fbtc_total_signups_number));
  2973. }
  2974. if (data.fbtc_total_wagered_number > 0) {
  2975. $("#total_wagered_number").html(ReplaceNumberWithCommas(parseFloat(data.fbtc_total_wagered_number * 100000000 / 100000000).toFixed(8)) + " BTC");
  2976. }
  2977. if (data.fbtc_btc_price > 0) {
  2978. $("#btc_usd_price").html(ReplaceNumberWithCommas("$" + parseFloat(data.fbtc_btc_price * 100 / 100).toFixed(2)));
  2979. }
  2980. });
  2981. }
  2982.  
  2983. function UpdateUserStats() {
  2984. var socket2 = io('wsnew.freebitco.in/fbtc_user_stats', {
  2985. autoConnect: true,
  2986. reconnectionDelayMax: 60000,
  2987. port: 443,
  2988. query: "userid=" + socket_userid + "&password=" + socket_password
  2989. });
  2990. socket2.on('connect', function() { /*setInterval(function (){socket2.emit('request_user_stats', { userid: socket_userid, password: socket_password });}, request_us_int*1000);*/
  2991. socket2.on('fbtc_user_stats_' + socket_userid, function(data) {
  2992. if (data.balance > 0) {
  2993. if ((Math.floor(Date.now() / 1000)) - balance_last_changed > 2) {
  2994. $('#balance').html(parseFloat(data.balance / 100000000).toFixed(8));
  2995. balanceChanged();
  2996. }
  2997. }
  2998. if (data.lottery_tickets >= 0) {
  2999. $('#user_lottery_tickets').html(ReplaceNumberWithCommas(data.lottery_tickets));
  3000. }
  3001. if (data.reward_points >= 0) {
  3002. $('.user_reward_points').html(ReplaceNumberWithCommas(data.reward_points));
  3003. }
  3004. if (data.unconf_tx.length > 0 && hide_pending_deposits == 0) {
  3005. $('#unconfirmed_deposits_table').show();
  3006. $('#unconfirmed_deposits_table_rows').html('');
  3007. var mobile_class = "";
  3008. if (mobile_device == 1) {
  3009. mobile_class = "lottery_table_mobile_style";
  3010. }
  3011. for (var i = 0; i < data.unconf_tx.length; i++) {
  3012. var tx_hash = data.unconf_tx[i].tx_hash.substring(0, 12) + "..." + data.unconf_tx[i].tx_hash.substring(data.unconf_tx[i].tx_hash.length - 12);
  3013. if (mobile_device == 1) {
  3014. tx_hash = data.unconf_tx[i].tx_hash.substring(0, 10) + "..." + data.unconf_tx[i].tx_hash.substring(data.unconf_tx[i].tx_hash.length - 10);
  3015. }
  3016. var amount = parseFloat(data.unconf_tx[i].amount / 100000000).toFixed(8);
  3017. $('#unconfirmed_deposits_table_rows').append('<div class="large-12 small-12 columns center lottery_winner_table_box_container effect2"><div class="large-8 small-8 columns center lottery_winner_table_box lottery_winner_table_first_last_cell ' + mobile_class + '"><a href="https://www.blocktrail.com/BTC/tx/' + data.unconf_tx[i].tx_hash + '" target=_blank>' + tx_hash + '</a></div><div class="large-4 small-4 columns center lottery_winner_table_box lottery_winner_table_first_last_cell ' + mobile_class + '">' + amount + '</div></div></div>');
  3018. }
  3019. } else {
  3020. $('#unconfirmed_deposits_table').hide();
  3021. }
  3022. var show_payout_table = 0;
  3023. if (data.instant_payment_requests.length > 0 && hide_pending_payments == 0) {
  3024. show_payout_table = 1;
  3025. $('#instant_pending_payout_table').show();
  3026. $('#instant_pending_payout_table').html('');
  3027. var mobile_class = "";
  3028. if (mobile_device == 1) {
  3029. mobile_class = "lottery_table_mobile_style";
  3030. }
  3031. $('#instant_pending_payout_table').append('<div class="large-12 small-12 columns center lottery_winner_table_box"><div class="center bold" style="margin:auto;">INSTANT</div></div>');
  3032. for (var i = 0; i < data.instant_payment_requests.length; i++) {
  3033. var amount = parseFloat(data.instant_payment_requests[i].amount / 100000000).toFixed(8);
  3034. var btc_address = data.instant_payment_requests[i].btc_address;
  3035. if (mobile_device == 1) {
  3036. btc_address = data.instant_payment_requests[i].btc_address.substring(0, 10) + "..." + data.instant_payment_requests[i].btc_address.substring(data.instant_payment_requests[i].btc_address.length - 10);
  3037. }
  3038. $('#instant_pending_payout_table').append('<div class="large-12 small-12 columns center lottery_winner_table_box_container effect2"><div class="large-8 small-8 columns center lottery_winner_table_box lottery_winner_table_first_last_cell ' + mobile_class + '"><a href="https://www.blocktrail.com/BTC/address/' + data.instant_payment_requests[i].btc_address + '" target=_blank>' + btc_address + '</a></div><div class="large-4 small-4 columns center lottery_winner_table_box lottery_winner_table_first_last_cell ' + mobile_class + '">' + amount + '</div></div>');
  3039. }
  3040. } else {
  3041. $('#instant_pending_payout_table').hide();
  3042. }
  3043. if (data.manual_payment_requests.length > 0 && hide_pending_payments == 0) {
  3044. show_payout_table = 1;
  3045. $('#pending_payout_table').show();
  3046. $('#pending_payout_table').html('');
  3047. var mobile_class = "";
  3048. if (mobile_device == 1) {
  3049. mobile_class = "lottery_table_mobile_style";
  3050. }
  3051. $('#pending_payout_table').append('<div class="large-12 small-12 columns center lottery_winner_table_box"><div class="center bold" style="margin:auto;">SLOW</div></div>');
  3052. for (var i = 0; i < data.manual_payment_requests.length; i++) {
  3053. var amount = parseFloat(data.manual_payment_requests[i].amount / 100000000).toFixed(8);
  3054. var btc_address = data.manual_payment_requests[i].btc_address;
  3055. if (mobile_device == 1) {
  3056. btc_address = data.manual_payment_requests[i].btc_address.substring(0, 10) + "..." + data.manual_payment_requests[i].btc_address.substring(data.manual_payment_requests[i].btc_address.length - 10);
  3057. }
  3058. $('#pending_payout_table').append('<div class="large-12 small-12 columns center lottery_winner_table_box_container effect2"><div class="large-8 small-8 columns center lottery_winner_table_box lottery_winner_table_first_last_cell ' + mobile_class + '"><a href="https://www.blocktrail.com/BTC/address/' + data.manual_payment_requests[i].btc_address + '" target=_blank>' + btc_address + '</a></div><div class="large-4 small-4 columns center lottery_winner_table_box lottery_winner_table_first_last_cell ' + mobile_class + '">' + amount + '</div></div>');
  3059. }
  3060. } else {
  3061. $('#pending_payout_table').hide();
  3062. }
  3063. if (show_payout_table == 1) {
  3064. $('#pending_payouts_table_new').show();
  3065. } else {
  3066. $('#pending_payouts_table_new').hide();
  3067. }
  3068. });
  3069. });
  3070. }
  3071.  
  3072. function ReplaceNumberWithCommas(yourNumber) {
  3073. var n = yourNumber.toString().split(".");
  3074. n[0] = n[0].replace(/\B(?=(\d{3})+(?!\d))/g, ",");
  3075. return n.join(".");
  3076. }
  3077.  
  3078. function CalculateWinAmount() {
  3079. $(".gt").html(parseInt(Math.round(10000 - (9500 / parseFloat($("#double_your_btc_payout_multiplier").val()).toFixed(2)))));
  3080. $(".lt").html(parseInt(Math.round((9500 / parseFloat($("#double_your_btc_payout_multiplier").val()).toFixed(2))))); /*var win_amount = 0;if ($( "#double_your_btc_stake" ).val()*100000000 > 999){win_amount = Math.round(($( "#double_your_btc_stake" ).val()*((parseFloat(9500/parseInt($( ".lt" ).html())).toFixed(2)) - 1))*100000000);}else{win_amount = Math.floor(($( "#double_your_btc_stake" ).val()*((parseFloat(9500/parseInt($( ".lt" ).html())).toFixed(2)) - 1))*100000000);}*/
  3081. var win_amount = Math.floor(($("#double_your_btc_stake").val() * ((parseFloat(9500 / parseInt($(".lt").html())).toFixed(2)) - 1)) * 100000000 + 1e-6);
  3082. $("#win_amount").html(parseFloat(win_amount / 100000000).toFixed(8));
  3083. }
  3084.  
  3085. function AutoBetErrors(code) {
  3086. $("#autobet_error").show();
  3087. $("#double_your_btc_result").hide();
  3088. $("#double_your_btc_middle_section").css({
  3089. 'border-radius': '0 0 10px 10px'
  3090. });
  3091. if (code == "e1") {
  3092. $("#autobet_error").html("Base bet has to be between 0.00000001 and " + max_win_amount + " BTC");
  3093. }
  3094. if (code == "e2") {
  3095. $("#autobet_error").html("Bet odds has to be an integer between 1.01 and 4750");
  3096. }
  3097. if (code == "e3") {
  3098. $("#autobet_error").html("Max bet has to be between 0.00000001 and " + max_win_amount + " BTC");
  3099. }
  3100. if (code == "e4") {
  3101. $("#autobet_error").html("Bet count has to be atleast 1");
  3102. }
  3103. if (code == "e5") {
  3104. $("#autobet_error").html("Bet odds after win has to be an integer between 1.01 and 4750");
  3105. }
  3106. if (code == "e6") {
  3107. $("#autobet_error").html("Bet odds after lose has to be an integer between 1.01 and 4750");
  3108. }
  3109. if (code == "e7") {
  3110. $("#autobet_error").html("Stop after profit value must be greater than 0");
  3111. }
  3112. if (code == "e8") {
  3113. $("#autobet_error").html("Stop after loss value must be greater than 0");
  3114. }
  3115. }
  3116.  
  3117. function ScreeSizeCSSChanges() {
  3118. if ($('body').innerWidth() < 1256) {
  3119. $("#double_your_btc_middle_section").appendTo($("#double_your_btc_main_container_outer"));
  3120. $("#double_your_btc_middle_section").css({
  3121. 'border-radius': '0 0 10px 10px'
  3122. });
  3123. }
  3124. if ($('body').innerWidth() > 1100) {
  3125. $('.change_size_css').addClass('large-7');
  3126. $('.change_size_css').removeClass('large-10 large-12');
  3127. }
  3128. if ($('body').innerWidth() < 1256 && $('body').innerWidth() > 970) {
  3129. $("#double_your_btc_main_container").addClass('double_your_btc_main_container_to_add');
  3130. $("#double_your_btc_main_container").removeClass('double_your_btc_main_container_remove double_your_btc_main_container_to_add_small');
  3131. $("#double_your_btc_left_section").addClass('double_your_btc_left_section_to_add');
  3132. $("#double_your_btc_left_section").removeClass('double_your_btc_left_section_remove double_your_btc_left_section_to_add_small');
  3133. $("#double_your_btc_middle_section").addClass('double_your_btc_middle_section_to_add');
  3134. $("#double_your_btc_middle_section").removeClass('double_your_btc_middle_section_remove double_your_btc_middle_section_to_add_small');
  3135. $("#double_your_btc_right_section").addClass('double_your_btc_right_section_to_add');
  3136. $("#double_your_btc_right_section").removeClass('double_your_btc_right_section_remove double_your_btc_right_section_to_add_small');
  3137. $("#double_your_btc_auto_bet_left_section").addClass('double_your_btc_left_section_to_add');
  3138. $("#double_your_btc_auto_bet_left_section").removeClass('double_your_btc_left_section_remove double_your_btc_left_section_to_add_small');
  3139. $("#double_your_btc_auto_bet_right_section").addClass('double_your_btc_auto_bet_right_section_to_add');
  3140. $("#double_your_btc_auto_bet_right_section").removeClass('double_your_btc_auto_bet_right_section_remove double_your_btc_auto_bet_right_section_to_add_small');
  3141. $("#bet_hi_button").addClass('bet_hi_button_to_add');
  3142. $("#bet_hi_button").removeClass('bet_hi_button_remove bet_hi_button_to_add_small');
  3143. $("#bet_lo_button").addClass('bet_lo_button_to_add');
  3144. $("#bet_lo_button").removeClass('bet_lo_button_remove bet_lo_button_to_add_small');
  3145. }
  3146. if ($('body').innerWidth() < 1100 && $('body').innerWidth() > 970) {
  3147. $('.change_size_css').addClass('large-10');
  3148. $('.change_size_css').removeClass('large-7 large-12');
  3149. }
  3150. if ($('body').innerWidth() < 971) {
  3151. $("#double_your_btc_main_container").addClass('double_your_btc_main_container_to_add_small');
  3152. $("#double_your_btc_main_container").removeClass('double_your_btc_main_container_remove double_your_btc_main_container_to_add');
  3153. $("#double_your_btc_left_section").addClass('double_your_btc_left_section_to_add_small');
  3154. $("#double_your_btc_left_section").removeClass('double_your_btc_left_section_remove double_your_btc_left_section_to_add');
  3155. $("#double_your_btc_middle_section").addClass('double_your_btc_middle_section_to_add_small');
  3156. $("#double_your_btc_middle_section").removeClass('double_your_btc_middle_section_remove double_your_btc_middle_section_to_add');
  3157. $("#double_your_btc_right_section").addClass('double_your_btc_right_section_to_add_small');
  3158. $("#double_your_btc_right_section").removeClass('double_your_btc_right_section_remove double_your_btc_right_section_to_add');
  3159. $("#double_your_btc_auto_bet_left_section").addClass('double_your_btc_left_section_to_add_small');
  3160. $("#double_your_btc_auto_bet_left_section").removeClass('double_your_btc_left_section_remove double_your_btc_left_section_to_add');
  3161. $("#double_your_btc_auto_bet_right_section").addClass('double_your_btc_auto_bet_right_section_to_add_small');
  3162. $("#double_your_btc_auto_bet_right_section").removeClass('double_your_btc_auto_bet_right_section_remove double_your_btc_auto_bet_right_section_to_add');
  3163. $("#bet_hi_button").addClass('bet_hi_button_to_add_small');
  3164. $("#bet_hi_button").removeClass('bet_hi_button_remove bet_hi_button_to_add');
  3165. $("#bet_lo_button").addClass('bet_lo_button_to_add_small');
  3166. $("#bet_lo_button").removeClass('bet_lo_button_remove bet_lo_button_to_add'); /*$( "#main_content" ).addClass('large-8');$( "#main_content" ).removeClass('large-9 push-3');$( "#main_content_ad_left" ).addClass('large-4');$( "#main_content_ad_left" ).removeClass('large-3 pull-9');if (ad_left == 1){$( "#main_content" ).addClass('push-4');$( "#main_content_ad_left" ).addClass('pull-8');}*/
  3167. $('.change_size_css').addClass('large-12');
  3168. $('.change_size_css').removeClass('large-7 large-10');
  3169. }
  3170. }
  3171.  
  3172. function ShowNews(id) {
  3173. $("#news_content_" + id).show();
  3174. }
  3175.  
  3176. function GetNewsContent(location, id, pos) {
  3177. $.get('/?op=get_news_content&id=' + id, function(data) {
  3178. $("#news_content_" + id).remove();
  3179. $(pos).parent().after('<div class="large-11 small-12 large-centered columns ' + location + 'news_content" style="text-align:left;" id="news_content_' + id + '">' + data + '</div>');
  3180. });
  3181. }
  3182.  
  3183. function GetBetHistory(page) {
  3184. if (page >= 0) {
  3185. bet_history_page = page;
  3186. $("#newer_bet_history").attr("disabled", true);
  3187. $("#older_bet_history").attr("disabled", true);
  3188. $.get('/cgi-bin/api.pl?op=get_bet_history&page=' + page, function(data) {
  3189. $('#bet_history_table_rows').html('');
  3190. var result1 = data.split(";");
  3191. for (var i = result1.length - 2; i >= 0; i--) {
  3192. var result2 = result1[i].split(":");
  3193. result2[0] = result2[0].replace(/\./g, ":");
  3194. var time = formatDate(result2[0] + ' MST');
  3195. if (result2[10] == "m") {
  3196. result2[10] = "DICE"
  3197. } else if (result2[10] == "f") {
  3198. result2[10] = "FREE"
  3199. } else if (result2[10] == "r") {
  3200. result2[10] = "ROULETTE"
  3201. }
  3202. var outcome = "l";
  3203. if (result2[3] >= 0) {
  3204. outcome = "w";
  3205. }
  3206. result2[3] = result2[3].replace('-', '');
  3207. insertIntoBetHistory(outcome, result2[3], result2[2], result2[7], result2[8], result2[11], result2[9], result2[10], result2[4], result2[5], result2[6], result2[1], result2[12], result2[13], result2[14], result2[15], time);
  3208. }
  3209. $("#newer_bet_history").attr("disabled", false);
  3210. $("#older_bet_history").attr("disabled", false);
  3211. });
  3212. }
  3213. }
  3214.  
  3215. function formatDate(date) {
  3216. if (date) {
  3217. date = date.replace(/-/g, "/");
  3218. }
  3219. var d = new Date(date || Date.now());
  3220. var month = '' + (d.getMonth() + 1),
  3221. day = '' + d.getDate(),
  3222. year = d.getFullYear(),
  3223. hour = '' + d.getHours(),
  3224. minute = '' + d.getMinutes(),
  3225. sec = '' + d.getSeconds();
  3226. if (month.length < 2) month = '0' + month;
  3227. if (day.length < 2) day = '0' + day;
  3228. if (hour.length < 2) hour = '0' + hour;
  3229. if (minute.length < 2) minute = '0' + minute;
  3230. if (sec.length < 2) sec = '0' + sec;
  3231. var formattedDate = day + "/" + month + "/" + year + " " + hour + ":" + minute + ":" + sec;
  3232. return formattedDate;
  3233. }
  3234.  
  3235. function SwitchPageTabs(tab_name) {
  3236. $(".page_tabs").hide();
  3237. $("#" + tab_name + "_tab").show();
  3238. $("#main_content").removeClass('large-9 small-7 push-3 large-centered columns new_border_shadow');
  3239. $("#box_ad_bottom_mobile").hide();
  3240. $("#box_ad_bottom_desktop").hide();
  3241. $("#main_content_ad_left").hide();
  3242. $("#main_content").css("padding", 'auto');
  3243. $("#main_content").css("margin", 'auto');
  3244. $("html, body").animate({
  3245. scrollTop: 0
  3246. }, "fast");
  3247. $("#main_content").addClass('large-9 small-7 large-centered columns new_border_shadow');
  3248. if (tab_name == "free_play") {
  3249. $("#box_ad_bottom_mobile").show();
  3250. $("#box_ad_bottom_desktop").show();
  3251. if (show_sky == 1) {
  3252. $("#main_content").addClass('push-3');
  3253. $("#main_content").removeClass('large-centered new_border_shadow');
  3254. $("#main_content_ad_left").show();
  3255. $("#main_content").css("padding", 0);
  3256. $("#main_content").css("margin", 0);
  3257. }
  3258. }
  3259. if (tab_name == "double_your_btc") {
  3260. $("#myModal22").foundation('reveal', 'close');
  3261. GetBetHistory(0);
  3262. }
  3263. if (tab_name == "earn_btc") {
  3264. $("#myModal15").foundation('reveal', 'close');
  3265. }
  3266. }
  3267.  
  3268. function insertBitcoinMore(div_name, position) {
  3269. document.getElementById(div_name).insertAdjacentHTML(position, '<p class="faq_question bold">What is Bitcoin?</p><div class="faq_answer"><p>Bitcoin is an innovative payment network and a new kind of money.</p><p>Bitcoin uses peer-to-peer technology to operate with no central authority or banks; managing transactions and the issuing of bitcoins is carried out collectively by the network. <b>Bitcoin is open-source; its design is public, nobody owns or controls Bitcoin and everyone can take part.</b> Through many of its unique properties, Bitcoin allows exciting uses that could not be covered by any previous payment system.</p></div><p class="faq_question bold">How does Bitcoin work?</p><div class="faq_answer"><p>From a user perspective, Bitcoin is nothing more than a mobile app or computer program that provides a personal Bitcoin wallet and allows a user to send and receive bitcoins with them. This is how Bitcoin works for most users.</p><p>Behind the scenes, the Bitcoin network is sharing a public ledger called the "block chain". This ledger contains every transaction ever processed, allowing a user&rsquo;s computer to verify the validity of each transaction. The authenticity of each transaction is protected by digital signatures corresponding to the sending addresses, allowing all users to have full control over sending bitcoins from their own Bitcoin addresses. In addition, anyone can process transactions using the computing power of specialized hardware and earn a reward in bitcoins for this service. This is often called "mining". To learn more about Bitcoin, you can consult the dedicated page and the original paper.</p></div><p class="faq_question bold">Who created Bitcoin?</p><div class="faq_answer"><p>Bitcoin is the first implementation of a concept called "cryptocurrency", which was first described in 1998 by Wei Dai on the cypherpunks mailing list, suggesting the idea of a new form of money that uses cryptography to control its creation and transactions, rather than a central authority. The first Bitcoin specification and proof of concept was published in 2009 in a cryptography mailing list by Satoshi Nakamoto. Satoshi left the project in late 2010 without revealing much about himself. The community has since grown exponentially with many developers working on Bitcoin.</p><p>Satoshi&rsquo;s anonymity often raised unjustified concerns, many of which are linked to misunderstanding of the open-source nature of Bitcoin. The Bitcoin protocol and software are published openly and any developer around the world can review the code or make their own modified version of the Bitcoin software. Just like current developers, Satoshi&rsquo;s influence was limited to the changes he made being adopted by others and therefore he did not control Bitcoin. As such, the identity of Bitcoin&rsquo;s inventor is probably as relevant today as the identity of the person who invented paper.</p></div><p class="faq_question bold">Who controls the Bitcoin network?</p><div class="faq_answer"><p>Nobody owns the Bitcoin network much like no one owns the technology behind email. Bitcoin is controlled by all Bitcoin users around the world. While developers are improving the software, they can&rsquo;t force a change in the Bitcoin protocol because all users are free to choose what software and version they use. In order to stay compatible with each other, all users need to use software complying with the same rules. Bitcoin can only work correctly with a complete consensus among all users. Therefore, all users and developers have a strong incentive to protect this consensus.</p></div><p class="faq_question bold">Is Bitcoin really used by people?</p><div class="faq_answer"><p>Yes. There is a growing number of businesses and individuals using Bitcoin. This includes brick and mortar businesses like restaurants, apartments, law firms, and popular online services such as Namecheap, WordPress, and Reddit. While Bitcoin remains a relatively new phenomenon, it is growing fast. At the end of August 2013, the value of all bitcoins in circulation exceeded US$ 1.5 billion with millions of dollars worth of bitcoins exchanged daily.</p></div><p class="faq_question bold">How does one acquire bitcoins?</p><div class="faq_answer"><p><ul style="text-align:left;"><li>As payment for goods or services.</li><li>Purchase bitcoins at a Bitcoin exchange.</li><li>Exchange bitcoins with someone near you.</li><li>Earn bitcoins through competitive mining.</li></ul></p><p>While it may be possible to find individuals who wish to sell bitcoins in exchange for a credit card or PayPal payment, most exchanges do not allow funding via these payment methods. This is due to cases where someone buys bitcoins with PayPal, and then reverses their half of the transaction. This is commonly referred to as a chargeback.</p></div><p class="faq_question bold">How difficult is it to make a Bitcoin payment?</p><div class="faq_answer"><p>Bitcoin payments are easier to make than debit or credit card purchases, and can be received without a merchant account. Payments are made from a wallet application, either on your computer or smartphone, by entering the recipient&rsquo;s address, the payment amount, and pressing send. To make it easier to enter a recipient&rsquo;s address, many wallets can obtain the address by scanning a QR code or touching two phones together with NFC technology.</p></div><p class="faq_question bold">What are the advantages of Bitcoin?</p><div class="faq_answer"><p><ul style="text-align:left;"><li>Payment freedom - It is possible to send and receive any amount of money instantly anywhere in the world at any time. No bank holidays. No borders. No imposed limits. Bitcoin allows its users to be in full control of their money.</li><li>Very low fees - Bitcoin payments are currently processed with either no fees or extremely small fees. Users may include fees with transactions to receive priority processing, which results in faster confirmation of transactions by the network. Additionally, merchant processors exist to assist merchants in processing transactions, converting bitcoins to fiat currency and depositing funds directly into merchants&rsquo; bank accounts daily. As these services are based on Bitcoin, they can be offered for much lower fees than with PayPal or credit card networks.</li><li>Fewer risks for merchants - Bitcoin transactions are secure, irreversible, and do not contain customers’ sensitive or personal information. This protects merchants from losses caused by fraud or fraudulent chargebacks, and there is no need for PCI compliance. Merchants can easily expand to new markets where either credit cards are not available or fraud rates are unacceptably high. The net results are lower fees, larger markets, and fewer administrative costs.</li><li>Security and control - Bitcoin users are in full control of their transactions; it is impossible for merchants to force unwanted or unnoticed charges as can happen with other payment methods. Bitcoin payments can be made without personal information tied to the transaction. This offers strong protection against identity theft. Bitcoin users can also protect their money with backup and encryption.</li><li>Transparent and neutral - All information concerning the Bitcoin money supply itself is readily available on the block chain for anybody to verify and use in real-time. No individual or organization can control or manipulate the Bitcoin protocol because it is cryptographically secure. This allows the core of Bitcoin to be trusted for being completely neutral, transparent and predictable.</li></ul></p></div><p class="faq_question bold">What are the disadvantages of Bitcoin?</p><div class="faq_answer"><p><ul style="text-align:left;"><li>Degree of acceptance - Many people are still unaware of Bitcoin. Every day, more businesses accept bitcoins because they want the advantages of doing so, but the list remains small and still needs to grow in order to benefit from network effects.</li><li>Volatility - The total value of bitcoins in circulation and the number of businesses using Bitcoin are still very small compared to what they could be. Therefore, relatively small events, trades, or business activities can significantly affect the price. In theory, this volatility will decrease as Bitcoin markets and the technology matures. Never before has the world seen a start-up currency, so it is truly difficult (and exciting) to imagine how it will play out.</li><li>Ongoing development - Bitcoin software is still in beta with many incomplete features in active development. New tools, features, and services are being developed to make Bitcoin more secure and accessible to the masses. Some of these are still not ready for everyone. Most Bitcoin businesses are new and still offer no insurance. In general, Bitcoin is still in the process of maturing.</li></ul></p></div><p class="faq_question bold">Why do people trust Bitcoin?</p><div class="faq_answer"><p>Much of the trust in Bitcoin comes from the fact that it requires no trust at all. Bitcoin is fully open-source and decentralized. This means that anyone has access to the entire source code at any time. Any developer in the world can therefore verify exactly how Bitcoin works. All transactions and bitcoins issued into existence can be transparently consulted in real-time by anyone. All payments can be made without reliance on a third party and the whole system is protected by heavily peer-reviewed cryptographic algorithms like those used for online banking. No organization or individual can control Bitcoin, and the network remains secure even if not all of its users can be trusted.</p></div><p class="faq_question bold">Can I make money with Bitcoin?</p><div class="faq_answer"><p>You should never expect to get rich with Bitcoin or any emerging technology. It is always important to be wary of anything that sounds too good to be true or disobeys basic economic rules.</p><p>Bitcoin is a growing space of innovation and there are business opportunities that also include risks. There is no guarantee that Bitcoin will continue to grow even though it has developed at a very fast rate so far. Investing time and resources on anything related to Bitcoin requires entrepreneurship. There are various ways to make money with Bitcoin such as mining, speculation or running new businesses. All of these methods are competitive and there is no guarantee of profit. It is up to each individual to make a proper evaluation of the costs and the risks involved in any such project.</p></div><p class="faq_question bold">Is Bitcoin fully virtual and immaterial?</p><div class="faq_answer"><p>Bitcoin is as virtual as the credit cards and online banking networks people use everyday. Bitcoin can be used to pay online and in physical stores just like any other form of money. Bitcoins can also be exchanged in physical form such as the Casascius coins, but paying with a mobile phone usually remains more convenient. Bitcoin balances are stored in a large distributed network, and they cannot be fraudulently altered by anybody. In other words, Bitcoin users have exclusive control over their funds and bitcoins cannot vanish just because they are virtual.</p></div><p class="faq_question bold">Is Bitcoin anonymous?</p><div class="faq_answer"><p>Bitcoin is designed to allow its users to send and receive payments with an acceptable level of privacy as well as any other form of money. However, Bitcoin is not anonymous and cannot offer the same level of privacy as cash. The use of Bitcoin leaves extensive public records. Various mechanisms exist to protect users&rsquo; privacy, and more are in development. However, there is still work to be done before these features are used correctly by most Bitcoin users.</p><p>Some concerns have been raised that private transactions could be used for illegal purposes with Bitcoin. However, it is worth noting that Bitcoin will undoubtedly be subjected to similar regulations that are already in place inside existing financial systems. Bitcoin cannot be more anonymous than cash and it is not likely to prevent criminal investigations from being conducted. Additionally, Bitcoin is also designed to prevent a large range of financial crimes.</p></div><p class="faq_question bold">What happens when bitcoins are lost?</p><div class="faq_answer"><p>When a user loses his wallet, it has the effect of removing money out of circulation. Lost bitcoins still remain in the block chain just like any other bitcoins. However, lost bitcoins remain dormant forever because there is no way for anybody to find the private key(s) that would allow them to be spent again. Because of the law of supply and demand, when fewer bitcoins are available, the ones that are left will be in higher demand and increase in value to compensate.</p></div><p class="faq_question bold">Can Bitcoin scale to become a major payment network?</p><div class="faq_answer"><p>The Bitcoin network can already process a much higher number of transactions per second than it does today. It is, however, not entirely ready to scale to the level of major credit card networks. Work is underway to lift current limitations, and future requirements are well known. Since inception, every aspect of the Bitcoin network has been in a continuous process of maturation, optimization, and specialization, and it should be expected to remain that way for some years to come. As traffic grows, more Bitcoin users may use lightweight clients, and full network nodes may become a more specialized service. For more details, see the Scalability page on the Wiki.</p></div><p class="faq_question bold">Is Bitcoin legal?</p><div class="faq_answer"><p>To the best of our knowledge, Bitcoin has not been made illegal by legislation in most jurisdictions. However, some jurisdictions (such as Argentina and Russia) severely restrict or ban foreign currencies. Other jurisdictions (such as Thailand) may limit the licensing of certain entities such as Bitcoin exchanges.</p><p>Regulators from various jurisdictions are taking steps to provide individuals and businesses with rules on how to integrate this new technology with the formal, regulated financial system. For example, the Financial Crimes Enforcement Network (FinCEN), a bureau in the United States Treasury Department, issued non-binding guidance on how it characterizes certain activities involving virtual currencies.</p></div><p class="faq_question bold">Is Bitcoin useful for illegal activities?</p><div class="faq_answer"><p>Bitcoin is money, and money has always been used both for legal and illegal purposes. Cash, credit cards and current banking systems widely surpass Bitcoin in terms of their use to finance crime. Bitcoin can bring significant innovation in payment systems and the benefits of such innovation are often considered to be far beyond their potential drawbacks.</p><p>Bitcoin is designed to be a huge step forward in making money more secure and could also act as a significant protection against many forms of financial crime. For instance, bitcoins are completely impossible to counterfeit. Users are in full control of their payments and cannot receive unapproved charges such as with credit card fraud. Bitcoin transactions are irreversible and immune to fraudulent chargebacks. Bitcoin allows money to be secured against theft and loss using very strong and useful mechanisms such as backups, encryption, and multiple signatures.</p><p>Some concerns have been raised that Bitcoin could be more attractive to criminals because it can be used to make private and irreversible payments. However, these features already exist with cash and wire transfer, which are widely used and well-established. The use of Bitcoin will undoubtedly be subjected to similar regulations that are already in place inside existing financial systems, and Bitcoin is not likely to prevent criminal investigations from being conducted. In general, it is common for important breakthroughs to be perceived as being controversial before their benefits are well understood. The Internet is a good example among many others to illustrate this.</p></div><p class="faq_question bold">Can Bitcoin be regulated?</p><div class="faq_answer"><p>The Bitcoin protocol itself cannot be modified without the cooperation of nearly all its users, who choose what software they use. Attempting to assign special rights to a local authority in the rules of the global Bitcoin network is not a practical possibility. Any rich organization could choose to invest in mining hardware to control half of the computing power of the network and become able to block or reverse recent transactions. However, there is no guarantee that they could retain this power since this requires to invest as much than all other miners in the world.</p><p>It is however possible to regulate the use of Bitcoin in a similar way to any other instrument. Just like the dollar, Bitcoin can be used for a wide variety of purposes, some of which can be considered legitimate or not as per each jurisdiction&rsquo;s laws. In this regard, Bitcoin is no different than any other tool or resource and can be subjected to different regulations in each country. Bitcoin use could also be made difficult by restrictive regulations, in which case it is hard to determine what percentage of users would keep using the technology. A government that chooses to ban Bitcoin would prevent domestic businesses and markets from developing, shifting innovation to other countries. The challenge for regulators, as always, is to develop efficient solutions while not impairing the growth of new emerging markets and businesses.</p></div><p class="faq_question bold">What about Bitcoin and taxes?</p><div class="faq_answer"><p>Bitcoin is not a fiat currency with legal tender status in any jurisdiction, but often tax liability accrues regardless of the medium used. There is a wide variety of legislation in many different jurisdictions which could cause income, sales, payroll, capital gains, or some other form of tax liability to arise with Bitcoin.</p></div><p class="faq_question bold">What about Bitcoin and consumer protection?</p><div class="faq_answer"><p>Bitcoin is freeing people to transact on their own terms. Each user can send and receive payments in a similar way to cash but they can also take part in more complex contracts. Multiple signatures allow a transaction to be accepted by the network only if a certain number of a defined group of persons agree to sign the transaction. This allows innovative dispute mediation services to be developed in the future. Such services could allow a third party to approve or reject a transaction in case of disagreement between the other parties without having control on their money. As opposed to cash and other payment methods, Bitcoin always leaves a public proof that a transaction did take place, which can potentially be used in a recourse against businesses with fraudulent practices.</p><p>It is also worth noting that while merchants usually depend on their public reputation to remain in business and pay their employees, they don&rsquo;t have access to the same level of information when dealing with new consumers. The way Bitcoin works allows both individuals and businesses to be protected against fraudulent chargebacks while giving the choice to the consumer to ask for more protection when they are not willing to trust a particular merchant.</p></div><p class="faq_question bold">How are bitcoins created?</p><div class="faq_answer"><p>New bitcoins are generated by a competitive and decentralized process called "mining". This process involves that individuals are rewarded by the network for their services. Bitcoin miners are processing transactions and securing the network using specialized hardware and are collecting new bitcoins in exchange.</p><p>The Bitcoin protocol is designed in such a way that new bitcoins are created at a fixed rate. This makes Bitcoin mining a very competitive business. When more miners join the network, it becomes increasingly difficult to make a profit and miners must seek efficiency to cut their operating costs. No central authority or developer has any power to control or manipulate the system to increase their profits. Every Bitcoin node in the world will reject anything that does not comply with the rules it expects the system to follow.</p><p>Bitcoins are created at a decreasing and predictable rate. The number of new bitcoins created each year is automatically halved over time until bitcoin issuance halts completely with a total of 21 million bitcoins in existence. At this point, Bitcoin miners will probably be supported exclusively by numerous small transaction fees.</p></div><p class="faq_question bold">Why do bitcoins have value?</p><div class="faq_answer"><p>Bitcoins have value because they are useful as a form of money. Bitcoin has the characteristics of money (durability, portability, fungibility, scarcity, divisibility, and recognizability) based on the properties of mathematics rather than relying on physical properties (like gold and silver) or trust in central authorities (like fiat currencies). In short, Bitcoin is backed by mathematics. With these attributes, all that is required for a form of money to hold value is trust and adoption. In the case of Bitcoin, this can be measured by its growing base of users, merchants, and startups. As with all currency, bitcoin&rsquo;s value comes only and directly from people willing to accept them as payment.</p></div><p class="faq_question bold">What determines bitcoin&rsquo;s price?</p><div class="faq_answer"><p>The price of a bitcoin is determined by supply and demand. When demand for bitcoins increases, the price increases, and when demand falls, the price falls. There is only a limited number of bitcoins in circulation and new bitcoins are created at a predictable and decreasing rate, which means that demand must follow this level of inflation to keep the price stable. Because Bitcoin is still a relatively small market compared to what it could be, it doesn&rsquo;t take significant amounts of money to move the market price up or down, and thus the price of a bitcoin is still very volatile.</p></div><p class="faq_question bold">Can bitcoins become worthless?</p><div class="faq_answer"><p>Yes. History is littered with currencies that failed and are no longer used, such as the German Mark during the Weimar Republic and, more recently, the Zimbabwean dollar. Although previous currency failures were typically due to hyperinflation of a kind that Bitcoin makes impossible, there is always potential for technical failures, competing currencies, political issues and so on. As a basic rule of thumb, no currency should be considered absolutely safe from failures or hard times. Bitcoin has proven reliable for years since its inception and there is a lot of potential for Bitcoin to continue to grow. However, no one is in a position to predict what the future will be for Bitcoin.</p></div><p class="faq_question bold">Is Bitcoin a bubble?</p><div class="faq_answer"><p>A fast rise in price does not constitute a bubble. An artificial over-valuation that will lead to a sudden downward correction constitutes a bubble. Choices based on individual human action by hundreds of thousands of market participants is the cause for bitcoin&rsquo;s price to fluctuate as the market seeks price discovery. Reasons for changes in sentiment may include a loss of confidence in Bitcoin, a large difference between value and price not based on the fundamentals of the Bitcoin economy, increased press coverage stimulating speculative demand, fear of uncertainty, and old-fashioned irrational exuberance and greed.</p></div><p class="faq_question bold">Is Bitcoin a Ponzi scheme?</p><div class="faq_answer"><p>A Ponzi scheme is a fraudulent investment operation that pays returns to its investors from their own money, or the money paid by subsequent investors, instead of from profit earned by the individuals running the business. Ponzi schemes are designed to collapse at the expense of the last investors when there is not enough new participants.</p><p>Bitcoin is a free software project with no central authority. Consequently, no one is in a position to make fraudulent representations about investment returns. Like other major currencies such as gold, United States dollar, euro, yen, etc. there is no guaranteed purchasing power and the exchange rate floats freely. This leads to volatility where owners of bitcoins can unpredictably make or lose money. Beyond speculation, Bitcoin is also a payment system with useful and competitive attributes that are being used by thousands of users and businesses.</p></div><p class="faq_question bold">Doesn&rsquo;t Bitcoin unfairly benefit early adopters?</p><div class="faq_answer"><p>Some early adopters have large numbers of bitcoins because they took risks and invested time and resources in an unproven technology that was hardly used by anyone and that was much harder to secure properly. Many early adopters spent large numbers of bitcoins quite a few times before they became valuable or bought only small amounts and didn&rsquo;t make huge gains. There is no guarantee that the price of a bitcoin will increase or drop. This is very similar to investing in an early startup that can either gain value through its usefulness and popularity, or just never break through. Bitcoin is still in its infancy, and it has been designed with a very long-term view; it is hard to imagine how it could be less biased towards early adopters, and today&rsquo;s users may or may not be the early adopters of tomorrow.</p></div><p class="faq_question bold">Won&rsquo;t the finite amount of bitcoins be a limitation?</p><div class="faq_answer"><p>Bitcoin is unique in that only 21 million bitcoins will ever be created. However, this will never be a limitation because transactions can be denominated in smaller sub-units of a bitcoin, such as bits - there are 1,000,000 bits in 1 bitcoin. Bitcoins can be divided up to 8 decimal places (0.000 000 01) and potentially even smaller units if that is ever required in the future as the average transaction size decreases.</p></div><p class="faq_question bold">Won&rsquo;t Bitcoin fall in a deflationary spiral?</p><div class="faq_answer"><p>The deflationary spiral theory says that if prices are expected to fall, people will move purchases into the future in order to benefit from the lower prices. That fall in demand will in turn cause merchants to lower their prices to try and stimulate demand, making the problem worse and leading to an economic depression.</p><p>Although this theory is a popular way to justify inflation amongst central bankers, it does not appear to always hold true and is considered controversial amongst economists. Consumer electronics is one example of a market where prices constantly fall but which is not in depression. Similarly, the value of bitcoins has risen over time and yet the size of the Bitcoin economy has also grown dramatically along with it. Because both the value of the currency and the size of its economy started at zero in 2009, Bitcoin is a counterexample to the theory showing that it must sometimes be wrong.</p><p>Notwithstanding this, Bitcoin is not designed to be a deflationary currency. It is more accurate to say Bitcoin is intended to inflate in its early years, and become stable in its later years. The only time the quantity of bitcoins in circulation will drop is if people carelessly lose their wallets by failing to make backups. With a stable monetary base and a stable economy, the value of the currency should remain the same.</p></div><p class="faq_question bold">Isn&rsquo;t speculation and volatility a problem for Bitcoin?</p><div class="faq_answer"><p>This is a chicken and egg situation. For bitcoin&rsquo;s price to stabilize, a large scale economy needs to develop with more businesses and users. For a large scale economy to develop, businesses and users will seek for price stability.</p><p>Fortunately, volatility does not affect the main benefits of Bitcoin as a payment system to transfer money from point A to point B. It is possible for businesses to convert bitcoin payments to their local currency instantly, allowing them to profit from the advantages of Bitcoin without being subjected to price fluctuations. Since Bitcoin offers many useful and unique features and properties, many users choose to use Bitcoin. With such solutions and incentives, it is possible that Bitcoin will mature and develop to a degree where price volatility will become limited.</p></div><p class="faq_question bold">What if someone bought up all the existing bitcoins?</p><div class="faq_answer"><p>Only a fraction of bitcoins issued to date are found on the exchange markets for sale. Bitcoin markets are competitive, meaning the price of a bitcoin will rise or fall depending on supply and demand. Additionally, new bitcoins will continue to be issued for decades to come. Therefore even the most determined buyer could not buy all the bitcoins in existence. This situation isn&rsquo;t to suggest, however, that the markets aren&rsquo;t vulnerable to price manipulation; it still doesn&rsquo;t take significant amounts of money to move the market price up or down, and thus Bitcoin remains a volatile asset thus far.</p></div><p class="faq_question bold">What if someone creates a better digital currency?</p><div class="faq_answer"><p>That can happen. For now, Bitcoin remains by far the most popular decentralized virtual currency, but there can be no guarantee that it will retain that position. There is already a set of alternative currencies inspired by Bitcoin. It is however probably correct to assume that significant improvements would be required for a new currency to overtake Bitcoin in terms of established market, even though this remains unpredictable. Bitcoin could also conceivably adopt improvements of a competing currency so long as it doesn&rsquo;t change fundamental parts of the protocol.</p></div><p class="faq_question bold">What is Bitcoin mining?</p><div class="faq_answer"><p>Mining is the process of spending computing power to process transactions, secure the network, and keep everyone in the system synchronized together. It can be perceived like the Bitcoin data center except that it has been designed to be fully decentralized with miners operating in all countries and no individual having control over the network. This process is referred to as "mining" as an analogy to gold mining because it is also a temporary mechanism used to issue new bitcoins. Unlike gold mining, however, Bitcoin mining provides a reward in exchange for useful services required to operate a secure payment network. Mining will still be required after the last bitcoin is issued.</p></div><p class="faq_question bold">How does Bitcoin mining work?</p><div class="faq_answer"><p>Anybody can become a Bitcoin miner by running software with specialized hardware. Mining software listens for transactions broadcast through the peer-to-peer network and performs appropriate tasks to process and confirm these transactions. Bitcoin miners perform this work because they can earn transaction fees paid by users for faster transaction processing, and newly created bitcoins issued into existence according to a fixed formula.</p><p>For new transactions to be confirmed, they need to be included in a block along with a mathematical proof of work. Such proofs are very hard to generate because there is no way to create them other than by trying billions of calculations per second. This requires miners to perform these calculations before their blocks are accepted by the network and before they are rewarded. As more people start to mine, the difficulty of finding valid blocks is automatically increased by the network to ensure that the average time to find a block remains equal to 10 minutes. As a result, mining is a very competitive business where no individual miner can control what is included in the block chain.</p><p>The proof of work is also designed to depend on the previous block to force a chronological order in the block chain. This makes it exponentially difficult to reverse previous transactions because this requires the recalculation of the proofs of work of all the subsequent blocks. When two blocks are found at the same time, miners work on the first block they receive and switch to the longest chain of blocks as soon as the next block is found. This allows mining to secure and maintain a global consensus based on processing power.</p><p>Bitcoin miners are neither able to cheat by increasing their own reward nor process fraudulent transactions that could corrupt the Bitcoin network because all Bitcoin nodes would reject any block that contains invalid data as per the rules of the Bitcoin protocol. Consequently, the network remains secure even if not all Bitcoin miners can be trusted.</p></div><p class="faq_question bold">Isn&rsquo;t Bitcoin mining a waste of energy?</p><div class="faq_answer"><p>Spending energy to secure and operate a payment system is hardly a waste. Like any other payment service, the use of Bitcoin entails processing costs. Services necessary for the operation of currently widespread monetary systems, such as banks, credit cards, and armored vehicles, also use a lot of energy. Although unlike Bitcoin, their total energy consumption is not transparent and cannot be as easily measured.</p><p>Bitcoin mining has been designed to become more optimized over time with specialized hardware consuming less energy, and the operating costs of mining should continue to be proportional to demand. When Bitcoin mining becomes too competitive and less profitable, some miners choose to stop their activities. Furthermore, all energy expended mining is eventually transformed into heat, and the most profitable miners will be those who have put this heat to good use. An optimally efficient mining network is one that isn&rsquo;t actually consuming any extra energy. While this is an ideal, the economics of mining are such that miners individually strive toward it.</p></div><p class="faq_question bold">How does mining help secure Bitcoin?</p><div class="faq_answer"><p>Mining creates the equivalent of a competitive lottery that makes it very difficult for anyone to consecutively add new blocks of transactions into the block chain. This protects the neutrality of the network by preventing any individual from gaining the power to block certain transactions. This also prevents any individual from replacing parts of the block chain to roll back their own spends, which could be used to defraud other users. Mining makes it exponentially more difficult to reverse a past transaction by requiring the rewriting of all blocks following this transaction.</p></div><p class="faq_question bold">What do I need to start mining?</p><div class="faq_answer"><p>In the early days of Bitcoin, anyone could find a new block using their computer&rsquo;s CPU. As more and more people started mining, the difficulty of finding new blocks increased greatly to the point where the only cost-effective method of mining today is using specialized hardware. You can visit BitcoinMining.com for more information.</p></div><p class="faq_question bold">Is Bitcoin secure?</p><div class="faq_answer"><p>The Bitcoin technology - the protocol and the cryptography - has a strong security track record, and the Bitcoin network is probably the biggest distributed computing project in the world. Bitcoin&rsquo;s most common vulnerability is in user error. Bitcoin wallet files that store the necessary private keys can be accidentally deleted, lost or stolen. This is pretty similar to physical cash stored in a digital form. Fortunately, users can employ sound security practices to protect their money or use service providers that offer good levels of security and insurance against theft or loss.</p></div><p class="faq_question bold">Hasn&rsquo;t Bitcoin been hacked in the past?</p><div class="faq_answer"><p>The rules of the protocol and the cryptography used for Bitcoin are still working years after its inception, which is a good indication that the concept is well designed. However, security flaws have been found and fixed over time in various software implementations. Like any other form of software, the security of Bitcoin software depends on the speed with which problems are found and fixed. The more such issues are discovered, the more Bitcoin is gaining maturity.</p><p>There are often misconceptions about thefts and security breaches that happened on diverse exchanges and businesses. Although these events are unfortunate, none of them involve Bitcoin itself being hacked, nor imply inherent flaws in Bitcoin; just like a bank robbery doesn&rsquo;t mean that the dollar is compromised. However, it is accurate to say that a complete set of good practices and intuitive security solutions is needed to give users better protection of their money, and to reduce the general risk of theft and loss. Over the course of the last few years, such security features have quickly developed, such as wallet encryption, offline wallets, hardware wallets, and multi-signature transactions.</p></div><p class="faq_question bold">Could users collude against Bitcoin?</p><div class="faq_answer"><p>It is not possible to change the Bitcoin protocol that easily. Any Bitcoin client that doesn&rsquo;t comply with the same rules cannot enforce their own rules on other users. As per the current specification, double spending is not possible on the same block chain, and neither is spending bitcoins without a valid signature. Therefore, It is not possible to generate uncontrolled amounts of bitcoins out of thin air, spend other users&rsquo; funds, corrupt the network, or anything similar.</p><p>However, powerful miners could arbitrarily choose to block or reverse recent transactions. A majority of users can also put pressure for some changes to be adopted. Because Bitcoin only works correctly with a complete consensus between all users, changing the protocol can be very difficult and requires an overwhelming majority of users to adopt the changes in such a way that remaining users have nearly no choice but to follow. As a general rule, it is hard to imagine why any Bitcoin user would choose to adopt any change that could compromise their own money.</p></div><p class="faq_question bold">Is Bitcoin vulnerable to quantum computing?</p><div class="faq_answer"><p>Yes, most systems relying on cryptography in general are, including traditional banking systems. However, quantum computers don&rsquo;t yet exist and probably won&rsquo;t for a while. In the event that quantum computing could be an imminent threat to Bitcoin, the protocol could be upgraded to use post-quantum algorithms. Given the importance that this update would have, it can be safely expected that it would be highly reviewed by developers and adopted by all Bitcoin users.</p></div><p class="faq_question bold">What if I have more questions about Bitcoin?</p><div class="faq_answer"><p>Three great places where you can get your questions answered are the BitcoinTalk Forum at <a href="http://bitcointalk.org" target="_blank">BitcoinTalk.org</a>, the Bitcoin sub-reddit at <a href="http://www.reddit.com/r/bitcoin" target="_blank">Reddit.com/r/bitcoin</a> and Bitcoin Stack Exchange at <a href="http://bitcoin.stackexchange.com/" target="_blank">Bitcoin.StackExchange.com</a>.</p></div>');
  3270. }
  3271.  
  3272. function insertIntoBetHistory(outcome, win_amount, lucky_number, server_seed, client_seed, sseed_hash, nonce, game_type, bet_on, jackpot, stake, multiplier, balance_before, balance_after, bonus_balance_before, bonus_balance_after, time) {
  3273. if (outcome === "w") {
  3274. win_amount = "<font color=green>" + win_amount + "</font>";
  3275. } else if (outcome === "l") {
  3276. win_amount = "<font color=red>-" + win_amount + "</font>";
  3277. }
  3278. bet_on = bet_on.toUpperCase();
  3279. if (jackpot == "0") {
  3280. jackpot = "&#x2716";
  3281. } else if (jackpot) {
  3282. var result3 = jackpot.split(",");
  3283. var jackpot_string = "";
  3284. for (var z = 0; z < result3.length; z++) {
  3285. jackpot_string = jackpot_string + jackpot_costs[result3[z]] + " | "
  3286. }
  3287. jackpot_string = jackpot_string.slice(0, -3);
  3288. jackpot = "<span data-tooltip class='has-tip' title='" + jackpot_string + "' style='cursor:pointer;'>&#x2714</span>";
  3289. } else {
  3290. jackpot = "&nbsp;"
  3291. }
  3292. if (bet_on == "") {
  3293. bet_on = "&nbsp;"
  3294. }
  3295. if ($('div.multiply_bet_history_table_row').length == 20) {
  3296. $('div.multiply_bet_history_table_row').last().remove();
  3297. }
  3298. var date = formatDate();
  3299. if (time) {
  3300. date = time;
  3301. }
  3302. var split_date = date.split(" ");
  3303. var row_html = '<div class="multiply_bet_history_table_row"><div class="large-12 small-12 columns center lottery_winner_table_box_container effect2"><div class="large-2 small-2 columns center lottery_winner_table_box lottery_winner_table_first_last_cell"><i class="show_balance_before_after fa fa-arrows-alt" aria-hidden="true"></i>' + split_date[1] + '</div><div class="large-1 small-1 columns center lottery_winner_table_box lottery_winner_table_second_cell">' + game_type + '</div><div class="large-1 small-1 columns center lottery_winner_table_box lottery_winner_table_second_cell">' + bet_on + '</div><div class="large-1 small-1 columns center lottery_winner_table_box lottery_winner_table_second_cell">' + lucky_number + '</div><div class="large-2 small-2 columns center lottery_winner_table_box lottery_winner_table_second_cell">' + stake + '</div><div class="large-1 small-1 columns center lottery_winner_table_box lottery_winner_table_second_cell">' + multiplier + '</div><div class="large-2 small-2 columns center lottery_winner_table_box lottery_winner_table_second_cell">' + win_amount + '</div><div class="large-1 small-1 columns center lottery_winner_table_box lottery_winner_table_third_cell">' + jackpot + '</div><div class="large-1 small-1 columns center lottery_winner_table_box lottery_winner_table_first_last_cell"><a href="https://s3.amazonaws.com/roll-verifier/verify.html?server_seed=' + server_seed + '&client_seed=' + client_seed + '&server_seed_hash=' + sseed_hash + '&nonce=' + nonce + '" target=_blank>CLICK</a></div></div><div class="balance_before_after" class="large-12 small-12 columns center lottery_winner_table_box_container effect2" style="display: none;"><div class="large-1 small-1 columns center lottery_winner_table_box lottery_winner_table_first_last_cell bb_background" style="font-weight: bold;">BB&nbsp; &nbsp;<i class="fa fa-info-circle" aria-hidden="true" title="Account Balance Before Bet"></i><span class="arrow-up balance_after_bet_span_1"></span><span class="arrow-up-small balance_after_bet_span_2"></span></div><div class="large-2 small-2 columns center lottery_winner_table_box balance_after_bet_column bb_background">' + balance_before + '</div><div class="large-1 small-1 columns center lottery_winner_table_box lottery_winner_table_first_last_cell bb_background" style="font-weight: bold;">BA&nbsp; &nbsp;<i class="fa fa-info-circle" aria-hidden="true" title="Account Balance After Bet"></i><span class="arrow-up balance_after_bet_span_1"></span><span class="arrow-up-small balance_after_bet_span_2"></span></div><div class="large-2 small-2 columns center lottery_winner_table_box balance_after_bet_column bb_background">' + balance_after + '</div><div class="large-1 small-1 columns center lottery_winner_table_box lottery_winner_table_first_last_cell bb_background" style="font-weight: bold;">BAB&nbsp;<i class="fa fa-info-circle" aria-hidden="true" title="Bonus Account Balance Before Bet"></i><span class="arrow-up balance_after_bet_span_1"></span><span class="arrow-up-small balance_after_bet_span_2"></span></div><div class="large-2 small-2 columns center lottery_winner_table_box balance_after_bet_column bb_background">' + bonus_balance_before + '</div><div class="large-1 small-1 columns center lottery_winner_table_box lottery_winner_table_first_last_cell bb_background" style="font-weight: bold;">BAA&nbsp;<i class="fa fa-info-circle" aria-hidden="true" title="Bonus Account Balance After Bet"></i><span class="arrow-up balance_after_bet_span_1"></span><span class="arrow-up-small balance_after_bet_span_2"></span></div><div class="large-2 small-2 columns center lottery_winner_table_box balance_after_bet_last_column bb_background">' + bonus_balance_after + '</div></div></div>';
  3304. var bet_history_date = split_date[0];
  3305. var date_row_name = bet_history_date.replace(/\//g, '_');
  3306. if ($('#multiply_history_date_row_' + date_row_name).length == 0) {
  3307. row_html = '<div class="large-12 small-12 columns center lottery_winner_table_box" id="multiply_history_date_row_' + date_row_name + '"><div class="center" style="margin:auto; font-weight:bold;">DATE: ' + split_date[0] + '</div></div> <div class="large-12 small-12 columns center lottery_winner_table_box_container effect2 multiply_history_table_header"><div class="large-2 small-2 columns center lottery_winner_table_box lottery_winner_table_first_last_cell font_bold">TIME</div><div class="large-1 small-1 columns center lottery_winner_table_box lottery_winner_table_second_cell font_bold">GAME</div><div class="large-1 small-1 columns center lottery_winner_table_box lottery_winner_table_second_cell font_bold">BET</div><div class="large-1 small-1 columns center lottery_winner_table_box lottery_winner_table_second_cell font_bold">ROLL</div><div class="large-2 small-2 columns center lottery_winner_table_box lottery_winner_table_second_cell font_bold">STAKE</div><div class="large-1 small-1 columns center lottery_winner_table_box lottery_winner_table_second_cell font_bold"><span data-tooltip class="has-tip" title="Multiplier">MULT</span></div><div class="large-2 small-2 columns center lottery_winner_table_box lottery_winner_table_second_cell font_bold">PROFIT</div><div class="large-1 small-1 columns center lottery_winner_table_box lottery_winner_table_third_cell font_bold"><span data-tooltip class="has-tip" title="Jackpot">JPOT</span></div><div class="large-1 small-1 columns center lottery_winner_table_box lottery_winner_table_first_last_cell font_bold"><span data-tooltip class="has-tip" title="Verify">VER</span></div></div>' + row_html;
  3308. $('#bet_history_table_rows').prepend(row_html);
  3309. } else {
  3310. $('#multiply_history_date_row_' + date_row_name).next('div.multiply_history_table_header').after(row_html);
  3311. }
  3312. return false;
  3313. }
  3314.  
  3315. function GetRPPrizes() {
  3316. $.get('/cgi-bin/api.pl?op=get_rp_prizes', function(data) {
  3317. var mobile_class_one = "";
  3318. var mobile_class_two = "";
  3319. if (mobile_device == 1) {
  3320. mobile_class_one = " reward_link_redeem_button_mobile ";
  3321. mobile_class_two = " reward_link_redeem_button_mobile_last ";
  3322. }
  3323. for (var i = 0; i < data.length; i++) {
  3324. $("#" + data[i].category + "_rewards").append('<div class="effect2" style="margin: 0; border-radius: 3px; margin-top: 20px;"><div class="row reward_product_name">' + data[i].product_name + '</div><div class="row" style="margin:0; padding: 10px 0; border: 1px solid #bdbcb8; border-radius: 0 0 3px 3px; background:#fff;"><div class="large-3 small-12 columns"><div class="reward_link_redeem_button_style' + mobile_class_one + '" onclick="VisitLink(\x27' + data[i].product_link + '\x27)">LINK</div></div><div class="large-6 small-12 columns"><div class="reward_dollar_value_style' + mobile_class_one + '">' + data[i].points + ' RP</div></div><div class="large-3 small-12 columns"><button class="reward_link_redeem_button_style ' + mobile_class_two + '" onclick="RedeemRPProduct(\x27' + data[i].product_type + '\x27)">REDEEM</button></div></div></div>');
  3325. }
  3326. });
  3327. }
  3328.  
  3329. function VisitLink(url) {
  3330. if (url != "none") {
  3331. window.open(url)
  3332. }
  3333. }
  3334.  
  3335. function RedeemRPProduct(id) {
  3336. $(".reward_link_redeem_button_style").attr("disabled", true);
  3337. $(".orange_button").attr("disabled", true);
  3338. var points = $("#encash_points_number").val();
  3339. $.get('/?op=redeem_rewards&id=' + id + '&points=' + points, function(data) {
  3340. var result = data.split(":");
  3341. var msg;
  3342. if (result[0] == "s") {
  3343. $('.user_reward_points').html(result[2]);
  3344. if (result[1] == "s1") {
  3345. $('#balance').html(result[5]);
  3346. balanceChanged();
  3347. msg = "Successfully converted " + ReplaceNumberWithCommas(parseInt(result[3])) + " points to " + parseFloat(parseInt(result[4]) / 100000000).toFixed(8) + "BTC.";
  3348. } else if (result[1] == "s2") {
  3349. msg = "Your bonus has been succesfully activated!";
  3350. var inner_div_html = '<p>Active bonus <span class="free_play_bonus_box_span_large">' + result[5] + '</span> ends in <span class="free_play_bonus_box_span_large" id="bonus_span_' + result[3] + '"></span></p>';
  3351. if ($("#bonus_container_" + result[3]).length > 0) {
  3352. $("#bonus_container_" + result[3]).html(inner_div_html);
  3353. } else {
  3354. $('#reward_points_bonuses_main_div').append('<div class="bold center free_play_bonus_box_large" id="bonus_container_' + result[3] + '">' + inner_div_html + '</div>');
  3355. }
  3356. $("#bonus_container_" + result[3]).show();
  3357. BonusEndCountdown(result[3], parseInt(result[4]));
  3358. if (result[3] == "fp_bonus") {
  3359. $('#fp_min_reward').html(result[6] + " BTC");
  3360. }
  3361. } else if (result[1] == "s3") {
  3362. msg = "Your redemption request for " + result[3] + " has been sent succesfully. We shall contact you via email for your shipping details (if required). If you do not have an email address added to your account, please add it now via the PROFILE page.";
  3363. }
  3364. } else if (result[0] == "e") {
  3365. msg = result[1];
  3366. }
  3367. DisplaySEMessage(result[0], msg);
  3368. $(".reward_link_redeem_button_style").attr("disabled", false);
  3369. $(".orange_button").attr("disabled", false);
  3370. });
  3371. }
  3372.  
  3373. function BonusEndCountdown(selector, duration) {
  3374. var start = Date.now(),
  3375. diff, hours, minutes, seconds;
  3376. var timer_run = setInterval(function timer() {
  3377. diff = duration - (((Date.now() - start) / 1000) | 0);
  3378. hours = (diff / (60 * 60)) | 0;
  3379. minutes = ((diff - (hours * 60 * 60)) / 60) | 0;
  3380. seconds = (diff - (minutes * 60) - (hours * 60 * 60)) | 0;
  3381. hours = hours < 10 ? "0" + hours : hours;
  3382. minutes = minutes < 10 ? "0" + minutes : minutes;
  3383. seconds = seconds < 10 ? "0" + seconds : seconds;
  3384. $("#bonus_span_" + selector).html(hours + ':' + minutes + ':' + seconds);
  3385. if (diff <= 0) {
  3386. $("#bonus_container_" + selector).hide();
  3387. clearInterval(timer_run);
  3388. return;
  3389. }
  3390. }, 1000);
  3391. }
  3392.  
  3393. function DisplaySEMessage(result, msg, custom_timeout) {
  3394. if (result != '' && result != 0 && result != undefined && msg != '' && msg != 0 && msg != undefined) {
  3395. clearTimeout(se_msg_timeout_id);
  3396. $('.reward_point_redeem_result_box').removeClass('reward_point_redeem_result_error');
  3397. $('.reward_point_redeem_result_box').removeClass('reward_point_redeem_result_success');
  3398. $('#reward_point_redeem_result_container_div').show();
  3399. if (result == "s") {
  3400. $('.reward_point_redeem_result_box').addClass('reward_point_redeem_result_success');
  3401. } else if (result == "e") {
  3402. $('.reward_point_redeem_result_box').addClass('reward_point_redeem_result_error');
  3403. }
  3404. $('.reward_point_redeem_result').html(msg);
  3405. var timeout = 15000;
  3406. if (custom_timeout > 0) {
  3407. timeout = custom_timeout;
  3408. }
  3409. se_msg_timeout_id = setTimeout(function() {
  3410. $('#reward_point_redeem_result_container_div').hide();
  3411. }, timeout);
  3412. }
  3413. }
  3414.  
  3415. function balanceChanged() {
  3416. if (max_deposit_bonus > parseFloat(min_bonus_amount)) {
  3417. $('.dep_bonus_max').html(max_deposit_bonus + " BTC");
  3418. }
  3419. $('#balance2').html($('#balance').html());
  3420. balance_last_changed = Math.floor(Date.now() / 1000);
  3421. }
  3422.  
  3423. function GenerateHashes(string) {
  3424. var rand = Math.random();
  3425. var hash = CryptoJS.SHA1(rand.toString() + rand.toString()).toString(CryptoJS.enc.Hex);
  3426. while (hash.indexOf(string) == -1) {
  3427. rand = Math.random();
  3428. hash = CryptoJS.SHA1(rand.toString() + rand.toString()).toString(CryptoJS.enc.Hex);
  3429. if (hash.indexOf(string) !== -1) {
  3430. return rand;
  3431. }
  3432. }
  3433. }
  3434.  
  3435. function Reset2FAQuestions(response) {
  3436. if (response == "secret_key_yes") {
  3437. $('#reset_2fa_form_full').show();
  3438. $('#reset_2fa_subtype').val('secret_key');
  3439. $('#forgot_2fa_secret_key_container_div').show();
  3440. $('#forgot_2fa_extra_input').val('');
  3441. $('#forgot_2fa_extra_field').html('SECRET KEY');
  3442. } else if (response == "secret_key_no") {
  3443. $('#forgot_2fa_secret_key_container_div').hide();
  3444. $('#reset_2fa_form_full').hide();
  3445. $('#forgot_2fa_question_text').html('Did you provide a backup phone number for resetting your 2FA?');
  3446. $('#forgot_2fa_yes').attr("onclick", "Reset2FAQuestions('mobile_ver_yes')");
  3447. $('#forgot_2fa_no').attr("onclick", "Reset2FAQuestions('mobile_ver_no')");
  3448. } else if (response == "mobile_ver_yes") {
  3449. $('#forgot_2fa_secret_key_container_div').hide();
  3450. $('#reset_2fa_form_full').show();
  3451. $('#reset_2fa_subtype').val('mobile_ver');
  3452. $('#forgot_2fa_extra_input').val('');
  3453. $('#reset_2fa_warning').show();
  3454. $('#reset_2fa_warning').html('There is a small charge of $0.15 for this process that will be applied to your account after your 2FA has been reset. This charge is to cover our costs for sending the verification code to your phone.');
  3455. } else if (response == "mobile_ver_no") {
  3456. $('#reset_2fa_form_full').show();
  3457. $('#reset_2fa_subtype').val('email_ver');
  3458. $('#forgot_2fa_secret_key_container_div').hide();
  3459. $('#forgot_2fa_extra_input').val('');
  3460. $('#reset_2fa_warning').show();
  3461. $('#reset_2fa_warning').html('This procedure will take approximately 8 days to reset your 2FA. If you are able to use another way to reset your 2FA, please use that first.');
  3462. } else if (response == "start_over") {
  3463. $('#reset_2fa_form_full').hide();
  3464. $('#reset_2fa_subtype').val('');
  3465. $('#forgot_2fa_extra_input').val('');
  3466. $('#reset_2fa_warning').hide();
  3467. $('#forgot_2fa_yes').attr("onclick", "Reset2FAQuestions('secret_key_yes')");
  3468. $('#forgot_2fa_no').attr("onclick", "Reset2FAQuestions('secret_key_no')");
  3469. $('#forgot_2fa_question_text').html('DO YOU HAVE THE 2FA SECRET KEY?');
  3470. $('#forgot_2fa_secret_key_container_div').hide();
  3471. }
  3472. }
  3473.  
  3474. function GenerateCaptchasNetCaptcha(parent_div, type, rand) {
  3475. if (typeof rand !== "undefined" && rand.length > 5 && rand.length < 100) {
  3476. GenCaptchasNetCaptcha(parent_div, type, rand);
  3477. } else {
  3478. var fingerprint = $.fingerprint();
  3479. $.get('/cgi-bin/api.pl?op=generate_captchasnet&f=' + fingerprint, function(data) {
  3480. if (data.length < 100) {
  3481. GenCaptchasNetCaptcha(parent_div, type, data);
  3482. }
  3483. });
  3484. }
  3485. }
  3486.  
  3487. function GenCaptchasNetCaptcha(parent_div, type, random_string) {
  3488. parent_div = parent_div.replace(/\s/g, '');
  3489. var image_url = "//captchas.freebitco.in/cgi-bin/captcha_generator?client=freebitcoin&random=" + random_string;
  3490. if (type == 2) {
  3491. image_url = "//captchas.freebitco.in/securimage/securimage/securimage_show.php?random=" + random_string;
  3492. } else if (type == 3) {
  3493. image_url = "//captchas.freebitco.in/botdetect/e/live/index.php?random=" + random_string;
  3494. }
  3495. $('#' + parent_div + ' .captchasnet_captcha_content').html('<img src="' + image_url + '" onerror="GenerateCaptchasNetCaptcha(\'' + parent_div + '\', ' + type + ', \'' + random_string + '\');">');
  3496. $('#' + parent_div + ' .captchasnet_captcha_random').val(random_string);
  3497. $('#' + parent_div + ' .captchasnet_captcha_refresh').attr("onclick", "GenerateCaptchasNetCaptcha('" + parent_div + "', " + type + ")");
  3498. $('#' + parent_div + ' .captchasnet_captcha_audio').attr("onclick", "PlayCaptchasNetAudioCaptcha('" + random_string + "')");
  3499. $('#' + parent_div + ' .captchasnet_captcha_input_box').val('');
  3500. }
  3501.  
  3502. function PlayCaptchasNetAudioCaptcha(captcha_random) {
  3503. var audioElement = document.createElement('audio');
  3504. audioElement.setAttribute('src', '//captchas.freebitco.in/cgi-bin/mp3/index.cgi?client=freebitcoin&random=' + captcha_random);
  3505. audioElement.setAttribute('autoplay', 'autoplay');
  3506. audioElement.addEventListener("load", function() {
  3507. audioElement.play();
  3508. }, true);
  3509. }
  3510.  
  3511. function SwitchCaptchas(type) {
  3512. var other_type = "recaptcha";
  3513. if (type == "recaptcha") {
  3514. other_type = "double_captchas";
  3515. }
  3516. $("#free_play_" + other_type).hide();
  3517. $("#free_play_" + type).show();
  3518. $("#signup_" + other_type).hide();
  3519. $("#signup_" + type).show();
  3520. $('#switch_captchas_button').attr("onclick", "SwitchCaptchas('" + other_type + "')");
  3521. $.cookie.raw = true;
  3522. $.cookie('default_captcha', type, {
  3523. expires: 3650,
  3524. secure: true
  3525. });
  3526. }
  3527. $.urlParam = function(name) {
  3528. var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href);
  3529. if (results == null) {
  3530. return '';
  3531. } else {
  3532. return results[1] || 0;
  3533. }
  3534. };
Add Comment
Please, Sign In to add comment