$(function(){
    $(".answerAndResponse").each(function(){
        var parentF = $(this);
        $(this).find(".answers :radio").change(function(){
            parentF.find(".responses > li:visible").hide();
            parentF.find(".responses > li").eq(
                $(this).closest("ul").find("li").index($(this).closest("li"))
            ).show();
        });
    });
    
    $(".textarea-input").each(function(){
        $(this).data("initContent",$(this).val());
        $(this).focus(function(){
            if($(this).val()==$(this).data("initContent")){
                $(this).val("");
            }
        });
    });
    
    $(':input.date').datepicker({
        changeMonth: true,
        changeYear: true,
        yearRange: '-99:+00'
    });

    $("#membership .moreInfo > a").click(function(){
        $(this).closest(".moreInfo").find(".content").clone().dialog({resizable:false,draggable:false});
        return false;
    });

    $("#membershipTypeChoices input.membershipType").change(function(){
        if($(this).val().toString().toLowerCase() == "family" && $(this).attr("checked")){
            $("#membershipTypeFamily").show();
        }
        else{
            $("#membershipTypeFamily").hide();
        }
        
    });
    $("#membershipTypeChoices input.membershipType").change();

});
