/*jslint browser: true, nomen: true,  white: true */ /*global  $, jQuery*/

jQuery(function($) {
	"use strict";
	
	$.entwine('ss', function($) {
		
		
		/**
		 * Class: .cms-edit-form #ContentReviewType
		 * 
		 * Toggle display of group dropdown in "access" tab,
		 * based on selection of radiobuttons.
		 */
		$('.cms-edit-form #ContentReviewType').entwine({
			// Constructor: onmatch
			onmatch: function() {
				var self = this;
				this.find('.optionset :input').bind('change', function(e) {
					self.show_option(e.target.value);
				});
		
				// initial state
				var currentVal = this.find('input[name=' + this.attr('id') + ']:checked').val();
				this.show_option(currentVal);
				this._super();
			},
			onunmatch: function() {
				return this._super();
			},
			
			show_option: function(value) {
				if(value === 'Custom') {
					this._custom();
				} else if(value === 'Inherit') {
					this._inherited();
				} else {
					this._disabled();
				}
			},
			
			_custom: function() {
				$('.custom-settings')['show']();
				$('#ROContentOwners')['hide']();	
				$('#RONextReviewDate')['hide']();	
			}, 
			_inherited: function() {
				$('.custom-settings')['hide']();
				$('#ROContentOwners')['show']();	
				$('#RONextReviewDate')['show']();	
			},
			_disabled: function() {
				$('.custom-settings')['hide']();
				$('#ROContentOwners')['hide']();	
				$('#RONextReviewDate')['hide']();	
			}
		});	
		
	});
});
@@ -1017,24 +1017,21 @@
 ttings')
-%5B'
+.
 show
-'%5D
 ();%0A%09%09%09%09
@@ -1037,73 +1037,34 @@
 %09$('
-#ROContentOwners')%5B'hide'%5D();%09%0A%09%09%09%09$('#RONextReviewDate')%5B'
+.inherited-settings').
 hide
-'%5D
 ();%09
@@ -1111,70 +1111,33 @@
 $('.
-custom-settings')%5B'hide'%5D();%0A%09%09%09%09$('#ROContentOwners')%5B'
+inherited-settings').
 show
-'%5D
 ();%09
@@ -1148,39 +1148,34 @@
 %09$('
-#RONextReviewDate')%5B'show'%5D
+.custom-settings').hide
 ();
-%09
 %0A%09%09%09
@@ -1204,38 +1204,41 @@
 ion() %7B%0A%09%09%09%09$('.
-custom
+inherited
 -settings')%5B'hid
@@ -1236,27 +1236,25 @@
 gs')
-%5B'
+.
 hide
-'%5D
 ();
+%09
 %0A%09%09%09%09$('
 #ROC
@@ -1253,77 +1253,34 @@
 %09$('
-#ROContentOwners')%5B'hide'%5D();%09%0A%09%09%09%09$('#RONextReviewDate')%5B'
+.custom-settings').
 hide
-'%5D
 ();
-%09
 %0A%09%09%09

use . syntax instead of [] syntax when calling show / hide