//===========================================================// Initialize//===========================================================function Initialize( ) {	try {		$( "select[name='MembershipLevel']" ).change( SetCategoriesAllowed );		SetCategoriesAllowed();		// HACK!!! HACK!!!! HACK!!!! This is needed to set the HTML Text Field		// because DBPage action is being used with teh form and doesnt' load teh data until		// AFTER the Add Form Field action has already generated the fields		$( "#editDescription" ).html( $("input[name='Description']").val() );		}	catch (error) {		alert( "Initialize: " + error.description  );		}	}//===========================================================// SetCategoriesAllowed//===========================================================function SetCategoriesAllowed( ) {	try {		var membershipLevel = $("select[name='MembershipLevel']");		if (!membershipLevel.length) return; 		var level = membershipLevel[0].value;		var categoriesAllowed = (gMembershipLevels[level] ? gMembershipLevels[level].Categories : 0)		$( "#Categories_scroller").each( function() { this.disabled = (categoriesAllowed == 0); } );		$("#CategoriesAllowed").text( categoriesAllowed );		if (categoriesAllowed == 0) $("input[name='Categories']:checked").each( function() { this.checked = false; } );		}	catch (error) {		alert( "SetCategoriesAllowed: " + error.description  );		}	}$( Initialize );