window.addEvent('domready', function() {
							   
	var faq_dt_els = $$('dt');
	if(faq_dt_els.length > 0) {
		
		swapFaqPageElements(faq_dt_els);
		
		//var hr_el = $('#body_copy hr').hide(); // kill all HR elements//
		//var dt_el = faq_dt_els.getParent('dl').hide(); // kill the DL element.
		var dt_el = faq_dt_els.getParent('dl').set({'style':'display:none'}); // kill the DL element.
		
		// add UL css
		$($$('#the_stuff .entry ul')[0]).addClass('enh');
		// add restore link
		//var h3_el = $('#body_copy > h3');
		var el = new Element('a');
		$(el).set({'href':'#', 'html': 'Show Full Expanded View'});
		$(el).addEvent('click', function(){
				$('#the_stuff ul').removeClass('enh');
				hr_el.show();
				dt_el.show();
				
			});
/*			*/
	}
});
function swapFaqPageElements(dt_els){
		dt_els.each(function(el, z){
			// grab the DT element, a/k/a/ "this" (because i'm too lazy to figure out how to reference self)
			//var el = this;
			
			// grab the text from the associated DD item
			var the_text = el.getNext('dd').get('html');
			var el_id = el.id;
			// grab the faq item that LINKS to here. this is the ul>li>a that links to #faq-1, #faq-2, etc...
			var faq_qs = $$('li a[name='+ el.id +']');
			var faq_q = $(faq_qs[0]);
			var new_el = new Element('div') // make the div
				.addClass('collapsible')
				.set({'html': the_text, style: 'display:none','id':'content-' + el.id}); // set html
		
			// drop the new item into the LI which is a parent of the faq_q el
			new_el.inject(faq_q.getParent('li'), 'after');
			
			faq_q.set({
					'href':'javascript:void(0)', // swap out & kill the href action
					'onclick':'return false'
				});
			faq_q.addEvent('click',function(){
					// attach the jquery slideToggle doodad to the faq_q el
					//elSlide.toggle();
					
					//alert('hi!');
				});
			faq_q.addClass('collapsible_toggle') // give it collapsible_toggle class
			/*
			faq_q.toggle( // set up our toggle function to either add or remove the "active" class
						function(){faq_q.addClass('active');},
						function(){faq_q.removeClass('active');}//.css({'margin-bottom':'10px'});}
				);			
			// we out.
			*/
		});	
}
			

