/****************************************
    Kingsway Design Portfolio System
	Copyright© 2008 Kingsway Design
	Developed by Apollo Internet Media
	Developer: Justin Kercher
	Version: 1.0a
	Date: 13/03/2008
****************************************/	

//Connstructor for the Client 'Class'.
//Instantiate with Client1 = new Client(name, imagePath,description,industry);
function Client(name,imagePath,description,industry) {
	this.name = name;
	this.imagePath = imagePath;
	this.description = description;
	this.industry = industry;
}

//Ensure that you have an array called clientsList defined in
//the page including this file.  This array should consist of
//Client objects.
var clientsList = [];
//Global Variables for the portfolio browser system
var currentClient = 0;  //indicates current client in the external client array.

//Function to move to next client in list
function nextClient() {
 	if(currentClient < clientsList.length-1) 
		currentClient++;
	else
		currentClient=0;
	
	displayClient(currentClient);
}

//Function to move to previous client in list
function previousClient() {
 	if(currentClient > 0) 
		currentClient--; 
	else 
		currentClient=clientsList.length-1;
	
	displayClient(currentClient);
}

//function to display client to page
function displayClient(clientID) {
	document.getElementById("imgClientImage").src = clientsList[clientID].imagePath;
	document.getElementById("clientInfo").innerHTML="<b>Client</b><br>"+clientsList[clientID].name+"<br><br><b>Sector:</b><br>"+clientsList[clientID].industry+"<br><br><b>Brief:</b><br>"+clientsList[clientID].description;
}

	//Preload images
	function preload()
	{ 
	  document.imageArray = new Array(clientsList.length);
	  for(var i=0; i<clientsList.length-1; i++)
	  {
    	document.imageArray[i] = new Image;
	    document.imageArray[i].src = clientsList[i].imagePath;
	  }
	}
