Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- $("#free_play_captcha_image").click(function() {
- $('#free_play_captcha_image').attr("src", "");
- $.get('/?op=change_captcha', function(data) {
- var result = data.split(":");
- $('#free_play_captcha_image').attr("src", "/captchas/" + result[0] + ".jpg");
- $('#free_play_captcha_time').val(result[1]);
- $('#free_play_captcha_hash').val(result[2]);
- });
- });
- $("#signup_captcha_image").click(function() {
- $('#signup_captcha_image').attr("src", "");
- $.get('/?op=change_captcha', function(data) {
- var result = data.split(":");
- $('#signup_captcha_image').attr("src", "/captchas/" + result[0] + ".jpg");
- $('#signup_captcha_time').val(result[1]);
- $('#signup_captcha_hash').val(result[2]);
- });
- });
- $("#login_captcha_image").click(function() {
- $('#login_captcha_image').attr("src", "");
- $.get('/?op=change_captcha', function(data) {
- var result = data.split(":");
- $('#login_captcha_image').attr("src", "/captchas/" + result[0] + ".jpg");
- $('#login_captcha_time').val(result[1]);
- $('#login_captcha_hash').val(result[2]);
- });
- });
- $('.tabs a').click(function() {
- $('.tabs li').removeClass('active');
- $(this).parent().addClass('active');
- });
- $('#free_play_link').addClass('active');
- $('.answer').hide();
- $('.question').click(function() {
- $('.answer').hide();
- $(this).next('.answer').show();
- $("html, body").animate({scrollTop: 0}, "fast");
- });
- $('#provably_fair_link').click(function() {
- $("html, body").animate({scrollTop: $("#provably_fair").offset().top - 45}, "fast");
- });
- $('#auto_withdraw').change(function() {
- var $input = $(this);
- var val = 0;
- if ($input.is(":checked")) {
- val = 1;
- $('#edaw').html('<span class="green">ENABLED</span>');
- } else {
- $('#edaw').html('<span class="red">DISABLED</span>');
- }
- $.get('/?op=toggle_auto_withdraw&val=' + val);
- });
- $(function() {
- $("#payout_multiplier_div").slider({range: "min",value: 2,min: 2,max: 100,slide: function(event, ui) {
- $("#payout_multiplier").html(ui.value + "x");
- var win_amount = $("#double_your_btc_stake").val() * (ui.value - 1);
- $("#win_amount").html(parseFloat(Math.round(win_amount * 100000000) / 100000000).toFixed(8) + " BTC");
- $(".gt").html(parseInt(Math.round(10000 - (9500 / ui.value))));
- $(".lt").html(parseInt(Math.round(9500 / ui.value)));
- }});
- var win_amount2 = $("#double_your_btc_stake").val() * ($("#payout_multiplier_div").slider("value") - 1);
- $("#payout_multiplier").html($("#payout_multiplier_div").slider("value") + "x");
- $("#win_amount").html(parseFloat(Math.round(win_amount2 * 100000000) / 100000000).toFixed(8) + " BTC");
- $(".gt").html(parseInt(Math.round(10000 - (9500 / $("#payout_multiplier_div").slider("value")))));
- $(".lt").html(parseInt(Math.round(9500 / $("#payout_multiplier_div").slider("value"))));
- });
- $("#logout_link").click(function(event) {
- $.cookie.raw = true;
- $.removeCookie('btc_address');
- $.removeCookie('password');
- window.location.replace("http://freebitco.in/?op=home");
- });
- $("#signup_form").submit(function(event) {
- event.preventDefault();
- $("#signup_button").attr("disabled", true);
- var fingerprint = $.fingerprint();
- var $form = $(this), op = $form.find('input[name="op"]').val(), btc_address = $form.find('input[name="btc_address"]').val(), password = $form.find('input[name="password"]').val(), repeat_password = $form.find('input[name="repeat_password"]').val(), email = $form.find('input[name="email"]').val(), captcha_time = $form.find('input[name="captcha_time"]').val(), captcha_hash = $form.find('input[name="captcha_hash"]').val(), captcha_answer = $form.find('input[name="captcha_answer"]').val(), url = $form.attr('action');
- var posting = $.post(url, {op: op,btc_address: btc_address,password: password,repeat_password: repeat_password,email: email,captcha_time: captcha_time,captcha_hash: captcha_hash,captcha_answer: captcha_answer,fingerprint: fingerprint});
- posting.done(function(data) {
- var result = data.split(":");
- $('#signup_error').hide();
- $('#signup_error').html("");
- $('#signup_form_btc_address').removeClass('input-error');
- $('#signup_form_password').removeClass('input-error');
- $('#signup_form_repeat_password').removeClass('input-error');
- if (result[0] == "e1") {
- $('#signup_error').show();
- $('#signup_error').html("Incorrect bitcoin address entered");
- $('#signup_form_btc_address').addClass('input-error');
- }
- if (result[0] == "e2") {
- $('#signup_error').show();
- $('#signup_error').html("Please enter a password");
- $('#signup_form_password').addClass('input-error');
- }
- if (result[0] == "e3") {
- $('#signup_error').show();
- $('#signup_error').html("Password and repeat password do not match");
- $('#signup_form_password').addClass('input-error');
- $('#signup_form_repeat_password').addClass('input-error');
- }
- if (result[0] == "e4") {
- $('#signup_error').show();
- $('#signup_error').html("An account with this Bitcoin address already exists");
- $('#signup_form_btc_address').addClass('input-error');
- }
- if (result[0] == "e5") {
- $('#signup_error').show();
- $('#signup_error').html("Invalid email address");
- $('#signup_form_btc_address').addClass('input-error');
- }
- if (result[0] == "e6") {
- $('#signup_captcha_image').attr("src", "");
- $('#signup_error').show();
- $('#signup_error').html("Number expired. Please enter the number within 5 minutes");
- $('#signup_captcha_image').attr("src", "/captchas/" + result[1] + ".jpg");
- $('#signup_captcha_time').val(result[2]);
- $('#signup_captcha_hash').val(result[3]);
- $('#signup_captcha_answer').val('');
- }
- if (result[0] == "e7") {
- $('#signup_captcha_image').attr("src", "");
- $('#signup_error').show();
- $('#signup_error').html("Incorrect number entered");
- $('#signup_captcha_image').attr("src", "/captchas/" + result[1] + ".jpg");
- $('#signup_captcha_time').val(result[2]);
- $('#signup_captcha_hash').val(result[3]);
- $('#signup_captcha_answer').val('');
- }
- if (result[0] == "e8") {
- $('#signup_error').show();
- $('#signup_error').html("Your IP address has been blocked");
- }
- if (result[0] == "s1") {
- $.cookie.raw = true;
- $.cookie('btc_address', result[1], {expires: 3650});
- $.cookie('password', result[2], {expires: 3650});
- window.location.replace("http://freebitco.in/?op=home");
- }
- $("#signup_button").attr("disabled", false);
- });
- });
- $("#login_form").submit(function(event) {
- event.preventDefault();
- $("#login_button").attr("disabled", true);
- var $form = $(this), op = $form.find('input[name="op"]').val(), btc_address = $form.find('input[name="btc_address"]').val(), password = $form.find('input[name="password"]').val(), captcha_time = $form.find('input[name="captcha_time"]').val(), captcha_hash = $form.find('input[name="captcha_hash"]').val(), captcha_answer = $form.find('input[name="captcha_answer"]').val(), url = $form.attr('action');
- var posting = $.post(url, {op: op,btc_address: btc_address,password: password,captcha_time: captcha_time,captcha_hash: captcha_hash,captcha_answer: captcha_answer});
- posting.done(function(data) {
- var result = data.split(":");
- $('#login_error').html("");
- $('#login_error').hide();
- $('#login_form_btc_address').removeClass('input-error');
- $('#login_form_password').removeClass('input-error');
- if (result[0] == "e1") {
- $('#login_error').show();
- $('#login_error').html("Please enter a bitcoin address");
- $('#login_form_btc_address').addClass('input-error');
- }
- if (result[0] == "e2") {
- $('#login_error').show();
- $('#login_error').html("Please enter a password");
- $('#login_form_password').addClass('input-error');
- }
- if (result[0] == "e3") {
- $('#login_error').show();
- $('#login_error').html("Incorrect login details");
- $('#login_form_btc_address').addClass('input-error');
- $('#login_form_password').addClass('input-error');
- }
- if (result[0] == "e4") {
- $('#login_captcha_image').attr("src", "");
- $('#login_error').show();
- $('#login_error').html("Number expired. Please enter the number within 5 minutes");
- $('#login_captcha_image').attr("src", "/captchas/" + result[1] + ".jpg");
- $('#login_captcha_time').val(result[2]);
- $('#login_captcha_hash').val(result[3]);
- $('#login_captcha_answer').val('');
- }
- if (result[0] == "e5") {
- $('#login_captcha_image').attr("src", "");
- $('#login_error').show();
- $('#login_error').html("Incorrect number entered");
- $('#login_captcha_image').attr("src", "/captchas/" + result[1] + ".jpg");
- $('#login_captcha_time').val(result[2]);
- $('#login_captcha_hash').val(result[3]);
- $('#login_captcha_answer').val('');
- }
- if (result[0] == "s1") {
- $.cookie.raw = true;
- $.cookie('btc_address', result[1], {expires: 3650});
- $.cookie('password', result[2], {expires: 3650});
- window.location.replace("http://freebitco.in/?op=home");
- }
- $("#login_button").attr("disabled", false);
- });
- });
- $("#free_play_form").submit(function(event) {
- event.preventDefault();
- var adblock = false;
- if ($('#test_ad').height() == 0) {
- adblock = true;
- }
- if (adblock) {
- $('#free_play_error').show();
- $('#free_play_error').html("Please disable your ad-blocking software and then refresh the page to collect your free bitcoins");
- return;
- } else {
- $('#free_play_digits').show();
- $('#free_play').hide();
- var fingerprint = $.fingerprint();
- var intervalID = setInterval(function() {
- $('#free_play_digits').html(Math.floor(Math.random() * 90000) + 10000);
- }, 1);
- $("#free_play_form_button").attr("disabled", true);
- var $form = $(this), op = $form.find('input[name="op"]').val(), recaptcha_challenge_field = $form.find('input[name="recaptcha_challenge_field"]').val(), recaptcha_response_field = $form.find('input[name="recaptcha_response_field"]').val(), url = $form.attr('action');
- var posting = $.post(url, {op: op,recaptcha_challenge_field: recaptcha_challenge_field,recaptcha_response_field: recaptcha_response_field,fingerprint: fingerprint});
- posting.done(function(data) {
- var result = data.split(":");
- $('#free_play_error').html("");
- $('#free_play_error').hide();
- $('#captcha_answer').removeClass('input-error');
- if (result[0] == "e2") {
- $('#free_play').show();
- $('#free_play_error').show();
- $('#free_play_error').html("Incorrect words entered");
- $('#free_play_digits').hide();
- $('#recaptcha_image').hide();
- Recaptcha.reload();
- $('#recaptcha_image').show();
- clearInterval(intervalID);
- }
- if (result[0] == "e3") {
- $('#free_play').hide();
- $('#wait').show();
- $('#time_remaining').countdown({until: +result[1],format: 'MS',expiryUrl: 'http://freebitco.in/?op=home'});
- $('#free_play_digits').hide();
- clearInterval(intervalID);
- }
- if (result[0] == "e4") {
- $('#free_play').show();
- $('#free_play_error').show();
- $('#free_play_error').html("Unexpected error. Please <a href='http://freebitco.in/?op=home'>click here</a> to refresh the page");
- $('#free_play_digits').hide();
- clearInterval(intervalID);
- }
- if (result[0] == "e8") {
- $('#free_play').show();
- $('#free_play_error').show();
- $('#free_play_error').html("Your IP address has been blocked");
- clearInterval(intervalID);
- }
- if (result[0] == "s1") {
- $.cookie.raw = true;
- $.cookie('last_play', result[4], {expires: 3650});
- $('#free_play').hide();
- $('#wait').show();
- $('#free_play_result').show();
- var number = result[1];
- var single_digit = number.split("");
- if (number.toString().length < 5) {
- var remaining = 5 - number.toString().length;
- for (var i = 0; i < remaining; i++) {
- single_digit.unshift('0');
- }
- }
- clearInterval(intervalID);
- $('#free_play_digits').html(single_digit[0] + single_digit[1] + single_digit[2] + single_digit[3] + single_digit[4]);
- $('#balance').html(result[2]);
- $('#winnings').html(result[3]);
- $('#balance_usd').html(result[5]);
- $('#time_remaining').countdown({until: +3600,format: 'MS',expiryUrl: 'http://freebitco.in/?op=home'});
- }
- $("#free_play_form_button").attr("disabled", false);
- });
- }
- });
- $(".withdraw_link").click(function(event) {
- alert("Payments are automatically sent every Monday to all accounts with a balance greater than 0.00005460 BTC.");
- });
- $("#free_play_link").click(function(event) {
- $("#free_play_tab").show();
- $("#ab_detect").show();
- $("#double_your_btc_tab").hide();
- $("#faq_tab").hide();
- $("#btc_for_offers_tab").hide();
- $("#refer_tab").hide();
- $("#edit_tab").hide();
- });
- $("#double_your_btc_link").click(function(event) {
- $("#free_play_tab").hide();
- $("#ab_detect").hide();
- $("#double_your_btc_tab").show();
- $("#faq_tab").hide();
- $("#btc_for_offers_tab").hide();
- $("#refer_tab").hide();
- $("#edit_tab").hide();
- });
- $("#faq_link").click(function(event) {
- $("#free_play_tab").hide();
- $("#ab_detect").hide();
- $("#double_your_btc_tab").hide();
- $("#faq_tab").show();
- $("#btc_for_offers_tab").hide();
- $("#refer_tab").hide();
- $("#edit_tab").hide();
- });
- $("#refer_link").click(function(event) {
- $("#free_play_tab").hide();
- $("#ab_detect").hide();
- $("#double_your_btc_tab").hide();
- $("#faq_tab").hide();
- $("#btc_for_offers_tab").hide();
- $("#refer_tab").show();
- $("#edit_tab").hide();
- });
- $("#edit_link").click(function(event) {
- $("#free_play_tab").hide();
- $("#ab_detect").hide();
- $("#double_your_btc_tab").hide();
- $("#faq_tab").hide();
- $("#btc_for_offers_tab").hide();
- $("#refer_tab").hide();
- $("#edit_tab").show();
- });
- $("#double_your_btc_link2").click(function(event) {
- $("#double_your_btc_link").click();
- });
- $("#stats_link").click(function(event) {
- window.location.replace("http://freebitco.in/?op=stats");
- });
- $("#free_play_link_stats").click(function(event) {
- window.location.replace("http://freebitco.in/?op=home&tab=free_play");
- });
- $("#double_your_btc_link_stats").click(function(event) {
- window.location.replace("http://freebitco.in/?op=home&tab=double_your_btc");
- });
- $("#faq_link_stats").click(function(event) {
- window.location.replace("http://freebitco.in/?op=home&tab=faq");
- });
- $("#refer_link_stats").click(function(event) {
- window.location.replace("http://freebitco.in/?op=home&tab=refer");
- });
- $("#edit_link_stats").click(function(event) {
- window.location.replace("http://freebitco.in/?op=home&tab=edit");
- });
- $("#double_your_btc_2x").click(function(event) {
- var bet = $("#double_your_btc_stake").val();
- var balance = $("#balance").html();
- if (bet * 2 <= balance) {
- if (bet * 2 <= 1) {
- $("#double_your_btc_stake").val(parseFloat(Math.round(bet * 2 * 100000000) / 100000000).toFixed(8));
- } else {
- $("#double_your_btc_stake").val('1');
- }
- } else {
- $("#double_your_btc_stake").val(balance);
- }
- var win_amount = $("#double_your_btc_stake").val() * ($("#payout_multiplier_div").slider("value") - 1);
- $("#win_amount").html(parseFloat(Math.round(win_amount * 100000000) / 100000000).toFixed(8) + " BTC");
- });
- $("#double_your_btc_half").click(function(event) {
- var bet = $("#double_your_btc_stake").val();
- var balance = $("#balance").html();
- if (bet * 0.5 <= balance) {
- if (bet * 0.5 <= 1) {
- $("#double_your_btc_stake").val(parseFloat(Math.round(bet * 0.5 * 100000000) / 100000000).toFixed(8));
- } else {
- $("#double_your_btc_stake").val('1');
- }
- } else {
- $("#double_your_btc_stake").val(balance);
- }
- var win_amount = $("#double_your_btc_stake").val() * ($("#payout_multiplier_div").slider("value") - 1);
- $("#win_amount").html(parseFloat(Math.round(win_amount * 100000000) / 100000000).toFixed(8) + " BTC");
- });
- $("#double_your_btc_max").click(function(event) {
- var bet = $("#double_your_btc_stake").val();
- var balance = $("#balance").html();
- if (balance <= 1) {
- $("#double_your_btc_stake").val(balance);
- } else {
- $("#double_your_btc_stake").val('1');
- }
- var win_amount = $("#double_your_btc_stake").val() * ($("#payout_multiplier_div").slider("value") - 1);
- $("#win_amount").html(parseFloat(Math.round(win_amount * 100000000) / 100000000).toFixed(8) + " BTC");
- });
- $("#double_your_btc_min").click(function(event) {
- var balance = $("#balance").html();
- if (balance >= 0.00000001) {
- $("#double_your_btc_stake").val('0.00000001');
- } else {
- $("#double_your_btc_stake").val('0.00000000');
- }
- var win_amount = $("#double_your_btc_stake").val() * ($("#payout_multiplier_div").slider("value") - 1);
- $("#win_amount").html(parseFloat(Math.round(win_amount * 100000000) / 100000000).toFixed(8) + " BTC");
- });
- $("#double_your_btc_stake").keyup(function(event) {
- var win_amount = $(this).val() * ($("#payout_multiplier_div").slider("value") - 1);
- $("#win_amount").html(parseFloat(Math.round(win_amount * 100000000) / 100000000).toFixed(8) + " BTC");
- });
- $("#double_your_btc_stake").keydown(function(event) {
- $("#double_your_btc_stake").keyup();
- });
- $("#double_your_btc_stake").keypress(function(event) {
- $("#double_your_btc_stake").keyup();
- });
- $("#double_your_btc_stake").focusout(function(event) {
- $("#double_your_btc_stake").keyup();
- });
- $("#double_your_btc_bet_hi_button").click(function(event) {
- DoubleYourBTC('hi');
- });
- $("#double_your_btc_bet_lo_button").click(function(event) {
- DoubleYourBTC('lo');
- });
- $("#create_wallet_form").submit(function(event) {
- event.preventDefault();
- $("#create_wallet_button").attr("disabled", true);
- var $form = $(this), op = $form.find('input[name="op"]').val(), email = $form.find('input[name="email"]').val(), password = $form.find('input[name="password"]').val(), repeat_password = $form.find('input[name="repeat_password"]').val(), url = $form.attr('action');
- var posting = $.post(url, {op: op,email: email,password: password,repeat_password: repeat_password});
- posting.done(function(data) {
- var result = data.split(":");
- $('#create_wallet_error').html("");
- $('#create_wallet_error').hide();
- $('#create_wallet_success').html("");
- $('#create_wallet_form_email').removeClass('input-error');
- $('#create_wallet_form_password').removeClass('input-error');
- $('#create_wallet_form_repeat_password').removeClass('input-error');
- if (result[0] == "e1") {
- $('#create_wallet_error').show();
- $('#create_wallet_error').html("Invalid email address");
- $('#create_wallet_form_email').addClass('input-error');
- }
- if (result[0] == "e2") {
- $('#create_wallet_error').show();
- $('#create_wallet_error').html("Password cannot be blank");
- $('#create_wallet_form_password').addClass('input-error');
- }
- if (result[0] == "e3") {
- $('#create_wallet_error').show();
- $('#create_wallet_error').html("Password and repeat password do not match");
- $('#create_wallet_form_password').addClass('input-error');
- $('#create_wallet_form_repeat_password').addClass('input-error');
- }
- if (result[0] == "e4") {
- $('#create_wallet_error').show();
- $('#create_wallet_error').html('Sorry, your wallet could not be created. Please try visiting <a href="https://blockchain.info/wallet/new" target="_blank">https://blockchain.info/wallet/new</a> and creating your wallet directly.');
- }
- if (result[0] == "e5") {
- $('#create_wallet_error').show();
- $('#create_wallet_error').html("Wallet password must be atleast 10 characters");
- $('#create_wallet_form_password').addClass('input-error');
- }
- if (result[0] == "s1") {
- $('#create_wallet_success').show();
- $('#create_wallet_success').html('Wallet created succesfully!');
- $("#create_wallet_form_div").hide();
- $("#wallet_details").show();
- $("#wallet_address").html(result[2]);
- $("#signup_form_btc_address").val(result[2]);
- $("#signup_form_email").val($("#create_wallet_form_email").val());
- $("#wallet_link").html('<a href="https://blockchain.info/wallet/' + result[1] + '" target="_blank">https://blockchain.info/wallet/' + result[1] + '</a>');
- } else {
- }
- $("#create_wallet_button").attr("disabled", false);
- });
- });
- $("#contact_form").submit(function(event) {
- event.preventDefault();
- $("#contact_form_button").attr("disabled", true);
- var $form = $(this), op = $form.find('input[name="op"]').val(), name = $form.find('input[name="name"]').val(), email = $form.find('input[name="email"]').val(), message = $form.find('textarea[name="message"]').val(), url = $form.attr('action');
- var posting = $.post(url, {op: op,name: name,email: email,message: message});
- posting.done(function(data) {
- var result = data.split(":");
- $('#contact_form_error').html("");
- $('#contact_form_error').hide();
- $('#contact_form_success').html("");
- $('#contact_form_success').hide();
- $('#contact_form_name').removeClass('input-error');
- $('#contact_form_email').removeClass('input-error');
- $('#contact_form_message').removeClass('input-error');
- if (result[0] == "e1") {
- $('#contact_form_error').show();
- $('#contact_form_error').html("Please enter your name");
- $('#contact_form_name').addClass('input-error');
- }
- if (result[0] == "e2") {
- $('#contact_form_error').show();
- $('#contact_form_error').html("Invalid email address entered");
- $('#contact_form_email').addClass('input-error');
- }
- if (result[0] == "e3") {
- $('#contact_form_error').show();
- $('#contact_form_error').html("Message must be atleast 10 characters");
- $('#contact_form_message').addClass('input-error');
- }
- if (result[0] == "s1") {
- $('#contact_form_success').show();
- $('#contact_form_success').html("Message sent succesfully!");
- }
- $("#contact_form_button").attr("disabled", false);
- });
- });
- $("#reset_on_win").click(function(event) {
- $("#increase_on_win").attr("checked", false);
- });
- $("#increase_on_win").click(function(event) {
- $("#reset_on_win").attr("checked", false);
- });
- $("#reset_on_lose").click(function(event) {
- $("#increase_on_lose").attr("checked", false);
- });
- $("#increase_on_lose").click(function(event) {
- $("#reset_on_lose").attr("checked", false);
- });
- $("#cancel_pending_payout").click(function(event) {
- $("#pending_payout_table").hide();
- $.get('/?op=cancel_pending_payout', function(data) {
- var result = data.split(":");
- if (result[0] == "s1") {
- $('#balance').html(result[1]);
- }
- });
- });
- $("#forgot_password_button").click(function(event) {
- var email = $("#forgot_password_email").val();
- $.get('/?op=forgot_password&email=' + email, function(data) {
- $('#forgot_password_message').html("");
- $('#forgot_password_message').hide();
- $('#forgot_password_message').removeClass('red');
- $('#forgot_password_message').removeClass('green');
- if (data == "e1") {
- $('#forgot_password_message').show();
- $('#forgot_password_message').addClass('red');
- $('#forgot_password_message').html("Invalid email address");
- }
- if (data == "e2") {
- $('#forgot_password_message').show();
- $('#forgot_password_message').addClass('red');
- $('#forgot_password_message').html("No account associated with this email address");
- }
- if (data == "s1") {
- $('#forgot_password_message').show();
- $('#forgot_password_message').addClass('green');
- $('#forgot_password_message').html("The password reset link has been sent to your email");
- }
- });
- });
- $("#password_reset_form").submit(function(event) {
- event.preventDefault();
- $("#password_reset_form_button").attr("disabled", true);
- var a = $("#password_reset_form_btc_address").val();
- var s = $("#password_reset_form_signature").val();
- var m = $("#password_reset_form_message").val();
- var verified = verify_message(s, m);
- if (verified == a) {
- var $form = $(this), op = $form.find('input[name="op"]').val(), btc_address = $form.find('input[name="btc_address"]').val(), message = $form.find('input[name="message"]').val(), signature = $form.find('input[name="signature"]').val(), url = $form.attr('action');
- var posting = $.post(url, {op: op,btc_address: btc_address,message: message,signature: signature});
- posting.done(function(data) {
- $('#password_reset_message').hide();
- $('#password_reset_message').html("");
- $('#password_reset_message').removeClass('green');
- $('#password_reset_message').removeClass('red');
- if (data == "e1") {
- $('#password_reset_message').show();
- $('#password_reset_message').html("Invalid Bitcoin Address entered");
- $('#password_reset_message').addClass('red');
- }
- if (data == "e2") {
- $('#password_reset_message').show();
- $('#password_reset_message').html("Invalid Email Address");
- $('#password_reset_message').addClass('red');
- }
- if (data == "e3") {
- $('#password_reset_message').show();
- $('#password_reset_message').html("Signature cannot be blank");
- $('#password_reset_message').addClass('red');
- }
- if (data == "e4") {
- $('#password_reset_message').show();
- $('#password_reset_message').html("No account associated with this Bitcoin Address exists in our database");
- $('#password_reset_message').addClass('red');
- }
- if (data == "s1") {
- $('#password_reset_message').show();
- $('#password_reset_message').html("Password reset request sent. You should get the password reset link in the email address you provided within 24 hours.");
- $('#password_reset_message').addClass('green');
- }
- });
- } else {
- $('#password_reset_message').show();
- $('#password_reset_message').html("Incorrect signature. Please follow the instructions for signing messages above and then try again.");
- $('#password_reset_message').addClass('red');
- }
- $("#password_reset_form_button").attr("disabled", false);
- });
- $("#edit_profile_form").submit(function(event) {
- event.preventDefault();
- $("#edit_profile_button").attr("disabled", true);
- var $form = $(this), op = $form.find('input[name="op"]').val(), btc_address = $form.find('input[name="btc_address"]').val(), email = $form.find('input[name="email"]').val(), url = $form.attr('action');
- var posting = $.post(url, {op: op,btc_address: btc_address,email: email});
- posting.done(function(data) {
- var result = data.split(":");
- $('#edit_profile_error').hide();
- $('#edit_profile_error').html("");
- $('#edit_profile_error').removeClass('green');
- $('#edit_profile_error').removeClass('red');
- if (result[0] == "e1") {
- $('#edit_profile_error').show();
- $('#edit_profile_error').html("Invalid Bitcoin Address entered");
- $('#edit_profile_error').addClass('red');
- }
- if (result[0] == "e2") {
- $('#edit_profile_error').show();
- $('#edit_profile_error').html("Invalid Email entered or user with this email address already exists");
- $('#edit_profile_error').addClass('red');
- }
- if (result[0] == "e3") {
- $('#edit_profile_error').show();
- $('#edit_profile_error').html("An account with this Bitcoin Address already exists");
- $('#edit_profile_error').addClass('red');
- }
- if (result[0] == "s1") {
- $('#edit_profile_error').show();
- $('#edit_profile_error').html("Details edited succesfully");
- $('#edit_profile_error').addClass('green');
- $.cookie.raw = true;
- $.cookie('btc_address', result[1], {expires: 3650});
- window.location.replace("http://freebitco.in/?op=home");
- }
- if (result[0] == "s2") {
- $('#edit_profile_error').show();
- $('#edit_profile_error').html("Details edited succesfully");
- $('#edit_profile_error').addClass('green');
- }
- $("#edit_profile_button").attr("disabled", false);
- });
- });
- $("#change_password_form").submit(function(event) {
- event.preventDefault();
- $("#change_password_button").attr("disabled", true);
- var $form = $(this), op = $form.find('input[name="op"]').val(), old_password = $form.find('input[name="old_password"]').val(), new_password = $form.find('input[name="new_password"]').val(), repeat_new_password = $form.find('input[name="repeat_new_password"]').val(), url = $form.attr('action');
- var posting = $.post(url, {op: op,old_password: old_password,new_password: new_password,repeat_new_password: repeat_new_password});
- posting.done(function(data) {
- var result = data.split(":");
- $('#change_password_error').hide();
- $('#change_password_error').html("");
- $('#change_password_error').removeClass('green');
- $('#change_password_error').removeClass('red');
- if (result[0] == "e1") {
- $('#change_password_error').show();
- $('#change_password_error').html("Incorrect Current Password");
- $('#change_password_error').addClass('red');
- }
- if (result[0] == "e2") {
- $('#change_password_error').show();
- $('#change_password_error').html("New Password cannot be empty");
- $('#change_password_error').addClass('red');
- }
- if (result[0] == "e3") {
- $('#change_password_error').show();
- $('#change_password_error').html("New Password and Repeat New Password do not match");
- $('#change_password_error').addClass('red');
- }
- if (result[0] == "s1") {
- $('#change_password_error').show();
- $('#change_password_error').html("Password changed succesfully");
- $('#change_password_error').addClass('green');
- $.cookie.raw = true;
- $.cookie('password', result[1], {expires: 3650});
- }
- $("#change_password_button").attr("disabled", false);
- });
- });
- $("#equal_share").click(function(event) {
- $("#weighted_share").attr("checked", false);
- });
- $("#weighted_share").click(function(event) {
- $("#equal_share").attr("checked", false);
- });
- $("#share_button").click(function(event) {
- var amount = $('#share_amount').val();
- var conf = confirm("If you click on 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 on CANCEL");
- if (conf == true) {
- $("#share_button").attr("disabled", true);
- var method;
- if ($("#equal_share").is(":checked")) {
- method = 1;
- }
- if ($("#weighted_share").is(":checked")) {
- method = 2;
- }
- $.get('/?op=share_coins&method=' + method + '&amount=' + amount, function(data) {
- var result = data.split(":");
- $('#share_error').hide();
- $('#share_success').hide();
- if (result[0] == "e1") {
- $('#share_error').show();
- $('#share_error').html("Unexpected error. Please log out and then log back in");
- }
- if (result[0] == "e2") {
- $('#share_error').show();
- $('#share_error').html("Amount to be shared is greater than your balance");
- }
- if (result[0] == "e3") {
- $('#share_error').show();
- $('#share_error').html("Invalid share method");
- }
- if (result[0] == "e4") {
- $('#share_error').show();
- var min_share = parseFloat(parseInt(result[1]) / 100000000).toFixed(8);
- $('#share_error').html("Minimum amount that you can share is " + min_share + " BTC");
- }
- if (result[0] == "e5") {
- $('#share_error').show();
- $('#share_error').html("You have no referrals to share with");
- }
- if (result[0] == "s1") {
- $('#share_success').show();
- var share_amount = parseFloat(parseInt(result[2]) / 100000000).toFixed(8);
- $('#balance').html(parseFloat(parseInt(result[1]) / 100000000).toFixed(8));
- $('#share_success').html(share_amount + " BTC shared with " + result[3] + " referrals");
- }
- });
- $("#share_button").attr("disabled", false);
- }
- });
- });
- function BetErrors(code) {
- if (code == "e1") {
- $('#double_your_btc_error').html("Bet amount cannot be more than your balance");
- $('#double_your_btc_stake').addClass('input-error');
- }
- if (code == "e2") {
- $('#double_your_btc_error').html("Bet amount cannot be less than 0.00000001 BTC");
- $('#double_your_btc_stake').addClass('input-error');
- }
- if (code == "e3") {
- $('#double_your_btc_error').html("Bet amount cannot be empty");
- $('#double_your_btc_stake').addClass('input-error');
- }
- if (code == "e4") {
- $('#double_your_btc_error').html("Invalid bet method");
- }
- if (code == "e5") {
- $('#double_your_btc_error').html("Bet amount cannot be more than 1 BTC");
- $('#double_your_btc_stake').addClass('input-error');
- }
- if (code == "e6") {
- $('#double_your_btc_error').html("Unexpected error. Please log out and then log back in");
- }
- if (code == "e7") {
- $('#double_your_btc_error').html("Payout multiplier has to be between 2x and 100x");
- }
- if (code == "e8") {
- $('#double_your_btc_error').html("Win amount cannot be more than 1 BTC");
- }
- if (code == "e9") {
- $('#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");
- }
- if (code == "e10") {
- $('#double_your_btc_error').html("Unexpected error. Please <a href='http://freebitco.in/?op=home'>click here</a> to refresh the page");
- }
- }
- function DoubleYourBTC(mode) {
- $('#double_your_btc_digits').show();
- var intervalID = setInterval(function() {
- $('#double_your_btc_digits').html(Math.floor(Math.random() * 90000) + 10000);
- }, 1);
- $("#double_your_btc_bet_hi_button").attr("disabled", true);
- $("#double_your_btc_bet_lo_button").attr("disabled", true);
- var bet = $("#double_your_btc_stake").val();
- var jackpot = 0;
- if ($("#play_jackpot").is(":checked")) {
- jackpot = 1;
- }
- $.get('/?op=double_your_btc&m=' + mode + '&jackpot=' + jackpot + '&stake=' + bet + '&multiplier=' + $("#payout_multiplier_div").slider("value"), function(data) {
- var result = data.split(":");
- $('#double_your_btc_error').html("");
- $('#double_your_btc_error').hide();
- $('#double_your_btc_stake').removeClass('input-error');
- $('#double_your_btc_bet_win').html("");
- $('#double_your_btc_bet_lose').html("");
- $('#jackpot_message').removeClass('green');
- $('#jackpot_message').removeClass('red');
- $('#jackpot_message').html('');
- $('#jackpot_message').hide();
- if (result[0] == "s1") {
- $('#double_your_btc_result').show();
- var number = result[2];
- var single_digit = number.split("");
- if (number.toString().length < 5) {
- var remaining = 5 - number.toString().length;
- for (var i = 0; i < remaining; i++) {
- single_digit.unshift('0');
- }
- }
- clearInterval(intervalID);
- $('#double_your_btc_digits').html(single_digit[0] + single_digit[1] + single_digit[2] + single_digit[3] + single_digit[4]);
- $('#balance').html(result[3]);
- $('#balance_usd').html(result[5]);
- $('#next_server_seed_hash').html(result[6]);
- $('#next_client_seed').html(result[7]);
- $('#next_nonce').html(result[8]);
- $('.previous_server_seed').html(result[9]);
- $('#previous_server_seed_hash').html(result[10]);
- $('.previous_client_seed').html(result[11]);
- $('.previous_nonce').html(result[12]);
- $('#previous_roll').html(result[2]);
- $('#no_previous_rolls_msg').hide();
- $('#previous_rolls_table').show();
- $('#previous_roll_strings').show();
- if (result[1] == "w") {
- $('#double_your_btc_bet_win').html("You win " + result[4] + " BTC!");
- }
- if (result[1] == "l") {
- $('#double_your_btc_bet_lose').html("You lose " + result[4] + " BTC");
- }
- if (jackpot == 1) {
- $('#jackpot_message').show();
- if (result[13] == "1") {
- $('#jackpot_message').addClass('green');
- $('#jackpot_message').html("Congratulations! You have won the jackpot of " + result[14] + " BTC");
- $('.jackpot_amount').html('0.0001');
- } else {
- $('#jackpot_message').addClass('red');
- $('#jackpot_message').html("Sorry, you did not win the jackpot.");
- $('.jackpot_amount').html(result[14]);
- }
- }
- $("#double_your_btc_bet_hi_button").attr("disabled", false);
- $("#double_your_btc_bet_lo_button").attr("disabled", false);
- } else {
- $('#double_your_btc_error').show();
- $('#double_your_btc_digits').hide();
- BetErrors(result[0]);
- clearInterval(intervalID);
- if (result[0] == "e6" || result[0] == "e10") {
- $("#double_your_btc_bet_hi_button").attr("disabled", true);
- $("#double_your_btc_bet_lo_button").attr("disabled", true);
- } else {
- $("#double_your_btc_bet_hi_button").attr("disabled", false);
- $("#double_your_btc_bet_lo_button").attr("disabled", false);
- }
- }
- });
- }
- function CheckAB() {
- if ($("iframe").length == 0) {
- document.write('<div style="padding:10px 10px 10px 10px;border-width:3px;border-style:solid;border-color:#000;background-color:white;-webkit-border-radius: 25px;-moz-border-radius: 25px;border-radius: 25px;"><p><b class="red">The advertisements on this page seem to be blocked by your browser.</b></p>Advertising is the only source of revenue for this project and the money that comes from it is used to offset part of the cost of distributing free Bitcoins.<BR><BR>To collect your free Bitcoins please whitelist this website in your Ad Blocker program and then refresh the page.<BR><BR>I gurantee that the ad\'s shown on this website will be unobtrusive and of the highest quality standards.<p class="bold">Thank you for your support!</p></div>');
- document.getElementById('free_play').style.display = 'none';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement