function removeClass() {
    $$('.pc_small_radiobutton')                      // select all elements having a .pc_small_radiobutton class
        .invoke('removeClassName', 'error_result')   // remove the .error_result class
        .invoke('removeClassName', 'pc_radio_error') // remove the .pc_radio_error class
        .invoke('addClassName', 'pc_radio');         // add the .pc_radio class
}

$(function() {
    //input box select state
    $('.SignUpFormTxtBoxContainer input').focus(function() {
        $(this).addClass('select');
    }).blur(function() {
        $(this).removeClass('select');
    });

    var signup2 = $('#SignUpFormColumn2');
    var radiogroup = $('#OfferingType');

    //overlay on set up your profile
    var sign_overlay = $('#signup_overlay').css({
        height: signup2.height() + 10,
        marginTop: (-1) * (signup2.height() + 10)
    });

    //overlay on accomodation list
    var radio_overlay = $('#radio_overlay').css({
        height: radiogroup.height(),
        marginTop: (-1) * radiogroup.height()
    });

    //Looking for accomodation check box click even
    $('#signup1_chkboxLookingForAccomodation').click(function() {
        //check whether if it selected or not
        if ($(this).is(':checked')) {
            sign_overlay.hide();
            $('#signup1_chkboxListingAccomodation').attr('checked', false);
            radio_overlay.show();
            $('#SignupWhiteCurveWrapper').slideUp();
            $('input[name="signup1rbtnOfferingType"]').each(function() {
                $(this).attr('checked', false);
            });
        } else {
            $('input[name="signup1rbtnOfferingType"]').each(function() {
                if ($(this).is('checked')) return;

            });
            sign_overlay.show();
        }

    });

    if ($('#signup1_chkboxLookingForAccomodation').is(':checked')) {
        sign_overlay.hide();
        $('#signup1_chkboxListingAccomodation').attr('checked', false);
        radio_overlay.show();
        $('#SignupWhiteCurveWrapper').slideUp();
        $('input[name="signup1rbtnOfferingType"]').each(function() {
            $(this).attr('checked', false);
        });
    }


    //on listing accomodation check box click event
    $('#signup1_chkboxListingAccomodation').click(function() {
        $('input[name="data[Profile][service_type_id]"]').each(function() {
            $(this).attr('checked', false);
        });
        //check whether if it selected or not
        if ($(this).is(':checked')) {
            radio_overlay.hide();
            sign_overlay.show();
            $('#signup1_chkboxLookingForAccomodation').attr('checked', false);
            $('#SignupWhiteCurveWrapper').slideDown();
        } else {
            radio_overlay.show();
            sign_overlay.show();
            $('#SignupWhiteCurveWrapper').slideUp();

        }

    });

    if ($('#signup1_chkboxListingAccomodation').is(':checked')) {
        radio_overlay.hide();
        sign_overlay.show();
        $('#signup1_chkboxLookingForAccomodation').attr('checked', false);
        $('#SignupWhiteCurveWrapper').slideDown();
    }

    //on click on accomodation item
    $('input[name="data[Profile][service_type_id]"]').click(function() {
        $('input[name="data[Profile][service_type_id]"]').each(function() {
            if ($(this).is(':checked')) {
                sign_overlay.hide();
                return;
            }
        });
    });

    $('input[name="data[Profile][service_type_id]"]').each(function() {
        if ($(this).is(':checked')) {
            sign_overlay.hide();
            return;
        }
    });

    $('#MemberRegisterForm').submit(function(){
        if ($('#signup1_FirstName').val() == 'First name *')
        {
            $('#signup1_FirstName').val('');
        }

        if ($('#signup1_LastName').val() == 'Last name *')
        {
            $('#signup1_LastName').val('');
        }

        if ($('#signup1_Email').val() == 'Email address for log-in *')
        {
            $('#signup1_Email').val('');
        }

        if ($('#signup1_Mobile').val() == 'Mobile number')
        {
            $('#signup1_Mobile').val('');
        }

        if ($('#signup1_Password').val() == 'Password *')
        {
            $('#signup1_Password').val('');
        }

        if ($('#signup1_ConfirmPassword').val() == 'Confirm password *')
        {
            $('#signup1_ConfirmPassword').val('');
        }

    });

    $('#signup_overlay').live('click', function(){
        //check whether the overlay is hidden or not
        if($(this).css('display') == 'block') {
            alert("Please select a profile type in the left-hand column!");
        }
    })
})

