
jQuery(document).ready(function() {
	jQuery("input[class*=js-dependent]").each(function() {
		jQuery(this).parent().parent().hide();
		if( jQuery(this).attr("class").match(/id=([^ ]+)/) ) {
			var ID = RegExp.$1;
			var Value = jQuery(this).attr("class").match(/value=([^ ]+)/)[1];
			var parentField = this;
			jQuery( "#" + ID ).change(function() {
				if ( jQuery(this).val() == Value ) {
					jQuery(parentField).parent().parent().show();
				} else {
					jQuery(parentField).parent().parent().hide();
				}
			});
		} 
	} );
});
