

$(document).ready( function() {
	
	initMeetOurPeople();
	
	});

function initMeetOurPeople() {
	
	staff = $("#meet_our_people");
	
	if (! staff.size()) return;
	menu = $("<ul>");
	
	menu.insertAfter(staff);

	staff.cycle ({ 
		fx: "fade",
		speed: 500,
		timeout: 0,
		pager: menu, 
		pagerEvent: "click",
		pagerAnchorBuilder: buildMeetOurPeople
		});

	}
	
function buildMeetOurPeople(index, DOMElement) {
	var profiles = $("#meet_our_people").find("div");
	var person = $(profiles.get(index));
	var text = person.find("h2").text();
	return $("<li><a href=\"#\" title=\"" + text + "\" class=\"thumb_" + (index + 1) + " replace\">" + text + "</a></li>");
	}
	
function initToggle() {
	
	var els = $(".toggle_detail");
	var divs = els.find("div").hide();
	
	els.click( function() {
		var div = $(this).find("div");
		divs.each( function() {
			if ($(this) != div) $(this).slideUp();
			});
		div.stop().slideDown();
		});

	}
