$(document).ready(function(){

    /* Restyle Checkboxes */
    $('.checkZones :checkbox').click(function(){
        var checked = $(this).is(':checked'),
            pclass  = $(this).parent().attr('class').split(' '),
            nclass  = pclass[0] + ' ';
        if (checked) {
            nclass += 'checked';
        } else {
            nclass += 'unchecked';
        }
        $(this).parent().attr('class', nclass);
    });

    /* Exchange Rates */
    $('#tariffs h3.prices a').click(function(){
        var id   = $(this).attr('id');
        $('#tariffs .number').hide();
        $('#tariffs .currency').hide();

        $('#tariffs .' + id).show();
        $('#tariffs h3.prices a').attr('class', null);
        $(this).attr('class', 'current');
        return false;
    });

    $('#authform :text, #authform :password, #whoisForm #domain').focus(function(){
        var val = $(this).val();
        $(this).attr('defVal', val);
        $(this).val('');
    });
    $('#authform :text, #authform :password, #whoisForm #domain').blur(function(){
        var curVal = $(this).val(),
            defVal = $(this).attr('defVal');
        if (curVal.length < 1 && defVal.length > 0 && curVal != defVal) {
            $(this).val(defVal);
        }
    });


});