var ExploreSignupStep2={};ExploreSignupStep2.styleComponents=function(){var b=$("input.signup_gender_male","div.signup_step2");var a=$("input.signup_gender_female","div.signup_step2");b.styledCheckbox({styleClass:"styledRadio",checkedStyleClass:"styledRadioChecked",groupName:"signup_gender"});a.styledCheckbox({styleClass:"styledRadio",checkedStyleClass:"styledRadioChecked",groupName:"signup_gender"});$("input.signup_gender_male, input.signup_gender_female","div.signup_step2").change(function(){$(".signup_gender_male, .signup_gender_female","div.signup_step2").parent().removeClass("active");if($(this).is(":checked")){$(this).parent().addClass("active")}});$("#month").dropdown({className:"dropdown month",defaultText:"Month",callBack:function(){$("#month").addClass("valueSet");ExploreSignupStep2.updateDays($("#month")[0].selectedIndex)}});$("#day").dropdown({className:"dropdown day",defaultText:"Day",callBack:function(){$("#day").addClass("valueSet")}});$("#year").dropdown({className:"dropdown year",defaultText:"Year",callBack:function(){$("#year").addClass("valueSet")}})};ExploreSignupStep2.setupForms=function(){jQuery.validator.addMethod("currentYear",function(b,a){var c=new Date();return(b!==c.getFullYear())});jQuery.validator.addMethod("valueSet",function(b,a){return $(a).hasClass("valueSet")});$(".signup_step2 form").validate({submitHandler:function(a){return false},errorElement:"span",errorPlacement:function(a,b){a.appendTo(b.parents("form").find("fieldset.submit"))},highlight:function(b,a){$(b).parents("fieldset").addClass(a)},unhighlight:function(b,a){$(b).parents("fieldset").removeClass(a)},rules:{signup_gender:{required:true},ExploreSignupMonthListChoice:{required:true,valueSet:true},ExploreSignupDayListChoice:{required:true,valueSet:true},ExploreSignupYearListChoice:{required:true,valueSet:true}},messages:{signup_gender:{required:"Please enter your gender."},dob_year:{currentYear:"Please select your date of birth."}},groups:{dateofbirth:"ExploreSignupMonthListChoice ExploreSignupDayListChoice ExploreSignupYearListChoice"},showErrors:function(a,b){this.defaultShowErrors();if(b.length>1){$(".signup_step2 fieldset.submit span.error").eq(0).html("Please enter your gender and date of birth");$(".signup_step2 fieldset.submit span.error").filter(function(c){return c>0}).remove()}}})};ExploreSignupStep2.updateDays=function(a){var b=31;switch(a){case 1:b=29;break;case 3:b=30;break;case 5:b=30;break;case 8:b=30;break;case 10:b=30;break;default:b=31}$(".dropdown.day li li").show();$(".dropdown.day li li:gt("+(b-1)+")").hide()};ExploreSignupStep2.formValid=function(){var a=$(".signup_step2 form").valid();if(a===true){$.showThrobber("fieldset.submit")}return a};$(document).ready(function(){ExploreSignupStep2.styleComponents();ExploreSignupStep2.setupForms()});