	// ========== EXPANDABLE/COLLAPSIBLE TITLES
	// See the related function in the Functions section below.

	setTimeout(function() {
		makeClickableTitles();
    }, 1500);
    

    // "Clicks" the element with the wh_expand_btn class
$(document).on('click', '.clickableTitle', function () {
	var clickedItem = $(this).attr('id');
	// console.log('you clicked ' + clickedItem);
	$(this).find('.wh_expand_btn:first').click();
	// console.log('title clicked');
});

// Creates a new class (clickableTitle) for the parent of each .wh_expand_btn found.
function makeClickableTitles() {
	$('span.wh_expand_btn').each(function() {
		// console.log("found expand button");
		var grabTitleText = $(this).parent().text();
		var newId = grabTitleText.replace(/\s+/g, '');
		// console.log(newId);
	
		$(this).parent()
			.css('color','#337ab7')
			.css('cursor','pointer')
			.addClass('clickableTitle')
			// add an ID of the title text minus spaces
			.attr('id',newId)
			;
	});	
}
