$(document).ready(function() {
    var inputs = $('.boxes input');
    
    inputs.focus(function() {
        $(this).addClass('focus');
        if( true || !this.scar ) this.scar = $(this).val();
        $(this).val('');
    });

    inputs.blur(function() {
        $(this).removeClass('focus');
        if( !$(this).val() && !$(this).hasClass('nodefault') )
            $(this).val(this.scar);
    });

    $("input[name='sure']").click(function() {
        if( $("input[name='sure']").val() )
            //$("#confirmation a.continue").addClass('enabled');
            $(".supersubmit").removeClass('ghost');
        else
            //$("#confirmation a.continue").removeClass('enabled');
            $(".supersubmit").addClass('ghost');
        $(this).blur();
    });

    $("input#sure-yes").click(function() {

        //$('.supersubmit').removeClass('ghost');
    });
    
    $("a#fancybox").fancybox({
        hideOnContentClick: false,
        hideOnOverlayClick: false,
        callbackOnShow: create_captcha
        
    });
});

function create_captcha() {
    
    //Recaptcha.create('6LeLVgoAAAAAAL9PO96XbKF8dsXkmm5Iul_vXpwv', 'recaptcha', { theme: 'red', callback: Recaptcha.focus_response_field})
}

function unicorns() {
    if( false && !$("#confirmation a.continue").hasClass('enabled') ) 
        return alert('Please check the "Yes" box to continue');
        
    //$.fn.fancybox.close();
    //$(".supersubmit").addClass('ghost');
    //$('.fakesubmit').removeClass('ghost');

    setTimeout(function(){ $('.fieldparty').addClass('error-prone') },1000)

    //$(".fieldparty").addClass('error-prone');
    //$('.boxes .error').show("slow");
    //$("hax-error").html('<div class="error">Sorry, we encountered an error processing your submission, please see below</div>');
    //$("#hax-submit a").click();
    //eval($("#hax-submit a")[0].href.replace(/%20/g,''));
}