/*
	Description: 	Adds a drop down show/hide effect to any block element structure on a page where the element's class attributes are arranged,
						droptext_container
							droptext_trigger
							droptext_target
					Where the container is the parent for the trigger and target, the trigger is the element that takes the click event,
					and the target is the element that gets hidden and shown.
							
	Author: 		Nathan Aschbacher
	Date: 			7/30/2009
*/


function attachDropTextListeners() {
	var containers = $(".droptext_container");
	for(var i = containers.length - 1; i >= 0; i--) {
		$($(containers[i]).children(".droptext_trigger")[0]).click(toggleDropText);
		$($(containers[i]).children(".droptext_trigger")[0]).css('cursor', 'pointer');
	}
}

function toggleDropText() {
	var parent = $(this).parent()[0];
	var target = $(parent).children(".droptext_target")[0];
	if(target.style.display == 'none') {
		$(target).show('fast');
	}
	else {
		$(target).hide('fast');
	}
}

$(document).ready(attachDropTextListeners);
