// Variables
var peopleIndex = 0;
var peopleArray = new Array(6);

// Steve MacInnis
peopleArray[0] = new Array(4);
peopleArray[0][0] = "steve_macinnis";
peopleArray[0][1] = "Steve MacInnis<br />P.Eng.";
peopleArray[0][2] = "Vehicle, Mechanical, Civil";
peopleArray[0][3] = "steve_macinnis.jpg";
peopleArray[0][4] = "Steve has 35+ years of mechanical and civil engineering experience. A Civil Engineering graduate from Carleton University In Ottawa, he worked for 2 years as a civil design and construction engineer in Calgary.";

// Gilles Amirault
peopleArray[1] = new Array(4);
peopleArray[1][0] = "gilles_amirault";
peopleArray[1][1] = "Gilles Amirault<br />P.Eng.";
peopleArray[1][2] = "Mechanical, Vehicle";
peopleArray[1][3] = "gilles_amirault.jpg";
peopleArray[1][4] = "Gilles graduated from Dalhousie University's co-op mechanical engineering program in 2004. With SAMAC since graduation, he is now our lead accident reconstruction engineer, having oversite responsibility for both high speed and low speed collision investigations.";

// Dave Hines
peopleArray[2] = new Array(4);
peopleArray[2][0] = "dave_hines";
peopleArray[2][1] = "Dave Hines<br />P.Eng.";
peopleArray[2][2] = "Electrical Engineer";
peopleArray[2][3] = "dave_hines.jpg";
peopleArray[2][4] = "Dave joined SAMAC in 2010 as an electrical engineer specializing in failure analysis and product liability investigations of electrical equipment and components; electrically related fire investigations; vehicle fires; residential, commercial & industrial equipment failures; and code reviews.";

// Vladimir Panlilio
peopleArray[3] = new Array(4);
peopleArray[3][0] = "vladimir_panlilio";
peopleArray[3][1] = "Vladimir Panlilio<br />M.Eng, M.Sc, P.Eng.";
peopleArray[3][2] = "Mechanical, Vehicle";
peopleArray[3][3] = "vladimir_panlilio.jpg";
peopleArray[3][4] = "Vladimir has over 25 years of mechanical engineering and forensic experience in accident reconstruction, injury causation, and defect investigations (he analyzed his first car crash in 1983!).";

// T. M. (Ted) Semeniuk
peopleArray[4] = new Array(4);
peopleArray[4][0] = "ted_semeniuk";
peopleArray[4][1] = "T. M. (Ted) Semeniuk";
peopleArray[4][2] = "Mechanical and Safety Specialist";
peopleArray[4][3] = "ted_semeniuk.jpg";
peopleArray[4][4] = "Ted is a highly qualified vehicle defects investigator, OH&S specialist, and a heavy duty mechanic certified Canada wide.";

// Tyler Dyck
peopleArray[5] = new Array(4);
peopleArray[5][0] = "tyler_dyck";
peopleArray[5][1] = "Tyler Dyck<br />B.Eng";
peopleArray[5][2] = "Mechanical Engineering";
peopleArray[5][3] = "tyler_dyck.jpg";
peopleArray[5][4] = "Tyler Dyck joined SAMAC in 2009 and focuses on both high and low speed collision investigations (speeds, vehicle motions, event data recorder analysis, occupant dynamics, seatbelts, etc.).";


// Functions
function initPeople()
{
	peopleIndex = Math.floor( Math.random() * 6 );

	loadPeople();
}

function loadPeople()
{
	var peopleString = "<div id='people_img'><img src='assets/templates/default/images/sidebar/people/" + peopleArray[peopleIndex][3] + "' width='70' height='70' alt='" + peopleArray[peopleIndex][0] + "' /></div>" + 
			"<div id='people_txt'>" + 
			"<h2>" + peopleArray[peopleIndex][1] + "</h2>" + 
			"<h3>(" + peopleArray[peopleIndex][2] + ")</h3>" +
			"</div>" + 
			"<div class='cleaner'></div>" + 
			"<p>" + peopleArray[peopleIndex][4] + "</p>" + 
			"<div id='people_more'><p class='read_more'>+ <a href='forensic-engineers.html#" + peopleArray[peopleIndex][0] + "' title='Read More'>Read More</a></p></div>" + 
			"<div id='people_controls'><a href='#' onclick='previous(); return false;'><img src='assets/templates/default/images/buttons/previous.gif' width='7' height='12' border='0' /></a><a href='#' onclick='next(); return false;'><img src='assets/templates/default/images/buttons/next.gif' width='7' height='12' border='0' /></a></div>" + 
			"<div class='cleaner'></div>";
			
	$("div#people_content").html( peopleString );
}
	
function next()
{
	peopleIndex++;
	
	if( peopleIndex == peopleArray.length )
		peopleIndex = 0;
		
	loadPeople();
}

function previous()
{
	if( peopleIndex == 0)
		peopleIndex = peopleArray.length - 1;
	else
		peopleIndex--;
		
	loadPeople();
}

$(document).ready(function() {
	initPeople();
});
