﻿/*	People: Used on executive-team and board-of-directors.	*/

People = function(roles) {
	this.roles = roles;
	this.current = 0;
};

People.prototype.fallback = function(){
	var self = this;
	var nav = '#'+self.roles+'_nav';
	$(nav +'>li').each(function(index) {
		var el = $(this);

		// Apply enabled class to allow css visual feedback of JS functionality
		el.addClass('enabled');
		
		el.click(function() {
			$(nav +'>li').removeClass('selected');
			el.addClass('selected');
			self.show(index+1);	
		});
	});
};

People.prototype.show = function(i){
	var last = this.current;
	var next = i;
	this.current = next;
	
	$('#boardCopy' + last).fadeOut(200, function() {
		$('.boardCopyDiv').hide(); // This is here to clobber any divs still showing due to fast clicking
		$('#boardCopy' + next).fadeIn(400);
	});
};
