rem: collapse_link.setAttribute('href', 'javascript:CollapsedFieldsets.display(' + i + ');'); collapse_link.appendChild(document.createTextNode('Show ' + verbose_name)); div.appendChild(collapse_link); fs.appendChild(div); 
add: collapse_link.className = 'collapse-toggle'; collapse_link.id = 'fieldsetcollapser' + i; collapse_link.onclick = new Function('CollapsedFieldsets.show('+i+'); return false;'); collapse_link.href = '#'; collapse_link.innerHTML = 'Show'; var h2 = fs.getElementsByTagName('h2')[0]; h2.appendChild(document.createTextNode(' (')); h2.appendChild(collapse_link); h2.appendChild(document.createTextNode(')')); 
context: 	init: function() {		var fieldsets = document.getElementsByTagName('fieldset');		var collapsed_seen = false;		for (var i=0; i<fieldsets.length; i++) {			var fs = fieldsets[i];			// Collapse this fieldset if it has the correct class, and if it			// doesn't have any errors. (Collapsing shouldn't apply in the case			// of error messages.)			if (fs.className.match(CollapsedFieldsets.collapse_re) && !CollapsedFieldsets.fieldset_has_errors(fs)) {				collapsed_seen = true;				// Give it an additional class, used by CSS to hide it.				fs.className += ' ' + CollapsedFieldsets.collapsed_class;				// Get plural verbose name of object.				var verbose_name = fs.getElementsByTagName('h2')[0].innerHTML;				// <div class="form-row collapse-toggle" id="fieldsetcollapser1">				// <a href="javascript:toggleDisplay;">Show section priorities&hellip;</a>				// </div>				var div = document.createElement('div');				// Give it a hook so we can remove it later.				div.id = 'fieldsetcollapser' + i;				div.className = 'form-row collapse-toggle'; // CSS hook				var collapse_link = document.createElement('a');				collapse_link.setAttribute('href', 'javascript:CollapsedFieldsets.display(' + i + ');');				collapse_link.appendChild(document.createTextNode('Show ' + verbose_name));				div.appendChild(collapse_link);				fs.appendChild(div);			}		}		if (collapsed_seen) {			// Expand all collapsed fieldsets when form is submitted.			addEvent(findForm(document.getElementsByTagName('fieldset')[0]), 'submit', function() { CollapsedFieldsets.uncollapse_all(); });		}	},
meta: 4610	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4610/623863d0a4e0c850196a863c646a2fe3ef178791/CollapsedFieldsets.js/buggy/django/conf/admin_media/js/admin/CollapsedFieldsets.js