var currentImage = 0;

var homeCaptions = new Array();
homeCaptions[0] = 'HP Tech@Work 06<br /><span class="productionCompany">Jack Morton Worldwide</span>';
homeCaptions[1] = 'WELLA';
homeCaptions[2] = 'VMWORLD09';
homeCaptions[3] = 'The Renault Dealership Conference 05.<br /><span class="productionCompany">Crown Business Communications</span>';

var conferencesCaptions = new Array();
conferencesCaptions[0] = 'Renault Dealer Conference 06<br /><span class="productionCompany">Crown Business Communications</span>';
conferencesCaptions[1] = 'Renault Dealer Conference 05<br /><span class="productionCompany">Crown Business Communications</span>';
conferencesCaptions[2] = 'Zurich Zig 07<br /><span class="productionCompany">Pumphouse</span';
conferencesCaptions[3] = 'BarCap Senior Managers Conference 06<br /><span class="productionCompany">Crown Business Communications</span>';
conferencesCaptions[4] = 'Travelodge Staff Conference 08<br /><span class="productionCompany">Brandfuel</span>';
conferencesCaptions[5] = 'M&S IT Conference 03<br /><span class="productionCompany">Crown Business Communications</span>';
conferencesCaptions[6] = 'SAB Global Leadership Conference 06<br /><span class="productionCompany">Crown Business Communications</span>';
conferencesCaptions[7] = 'Camelot 08 Get Set<br /><span class="productionCompany">Aspect</span>';
conferencesCaptions[8] = 'JCP 007 Conference<br /><span class="productionCompany">Crown Business Communications</span>';
conferencesCaptions[9] = 'Artsonline Launch<br /><span class="productionCompany">Crown Business Communications</span>';

var eventsCaptions = new Array();
eventsCaptions[0] = 'ITVA 08 Wella<br /><span class="productionCompany">Jack Morton Worldwide</span>';
eventsCaptions[1] = 'ITVA 08 Wella<br /><span class="productionCompany">Jack Morton Worldwide</span>';
eventsCaptions[2] = 'ITVA 08 Wella<br /><span class="productionCompany">Jack Morton Worldwide</span>';
eventsCaptions[3] = 'HP Tech@Work 09<br /><span class="productionCompany">Jack Morton Worldwide</span>';
eventsCaptions[4] = 'HP Tech@Work 09<br /><span class="productionCompany">Jack Morton Worldwide</span>';
eventsCaptions[5] = 'HP Tech@Work 08<br /><span class="productionCompany">Jack Morton Worldwide</span>';
eventsCaptions[6] = 'HP Tech@Work 07<br /><span class="productionCompany">Jack Morton Worldwide</span>';
eventsCaptions[7] = 'HP Tech@Work 06<br /><span class="productionCompany">Jack Morton Worldwide</span>';
eventsCaptions[8] = 'vmworld 09<br /><span class="productionCompany">Jack Morton Worldwide</span>';

var exhibitionsCaptions = new Array();
exhibitionsCaptions[0] = 'vmworld 09<br /><span class="productionCompany">Jack Morton Worldwide</span>';
exhibitionsCaptions[1] = 'vmworld 09<br /><span class="productionCompany">Jack Morton Worldwide</span>';
exhibitionsCaptions[2] = 'vmworld 09<br /><span class="productionCompany">Jack Morton Worldwide</span>';
exhibitionsCaptions[3] = 'HP Tech@Work 09<br /><span class="productionCompany">Jack Morton Worldwide</span>';
exhibitionsCaptions[4] = 'HP Tech@Work 09<br /><span class="productionCompany">Jack Morton Worldwide</span>';
exhibitionsCaptions[5] = 'HP Tech@Work 09<br /><span class="productionCompany">Jack Morton Worldwide</span>';
exhibitionsCaptions[6] = 'HP Tech@Work 07<br /><span class="productionCompany">Jack Morton Worldwide</span>';
exhibitionsCaptions[7] = 'HP Tech@Work 06<br /><span class="productionCompany">Jack Morton Worldwide</span>';
exhibitionsCaptions[8] = 'Nintendo stand<br /><span class="productionCompany">Cake Media</span>';
exhibitionsCaptions[9] = 'Bscc Showcase Exhibition 02, M&S stand<br /><span class="productionCompany">Crown Business Communications</span>';
exhibitionsCaptions[10] = 'Crown football day<br /><span class="productionCompany">Crown Business Communications</span>';
exhibitionsCaptions[11] = 'Openreach Market Place 08<br /><span class="productionCompany">Pumphouse</span>';

var irCaptions = new Array();
irCaptions[0] = 'M&S AGM 08<br /><span class="productionCompany">Jack Morton Worldwide</span>';
irCaptions[1] = 'M&S AGM 07<br /><span class="productionCompany">Jack Morton Worldwide</span>';
irCaptions[2] = 'Equitable Life AGM 03<br /><span class="productionCompany">Crown Business Communications</span>';
irCaptions[3] = 'Equitable Life AGM 04<br /><span class="productionCompany">Crown Business Communications</span>';
irCaptions[4] = 'Standard Life';
irCaptions[5] = 'Railtrack AGM 2002<br /><span class="productionCompany">Crown Business Communications</span>';

var partiesCaptions = new Array();
partiesCaptions[0] = 'ITVA 08 Wella<br /><span class="productionCompany">Jack Morton Worldwide</span>';
partiesCaptions[1] = 'ITVA 08 Wella<br /><span class="productionCompany">Jack Morton Worldwide</span>';
partiesCaptions[2] = 'vmworld 09<br /><span class="productionCompany">Jack Morton Worldwide</span>';
partiesCaptions[3] = 'HP Tech@Work 07 - p1';
partiesCaptions[4] = 'HP Tech@Work 07 - p2';

var visualsCaptions = new Array();
visualsCaptions[0] = '';
visualsCaptions[1] = '';
visualsCaptions[2] = '';
visualsCaptions[3] = '';
visualsCaptions[4] = '';
visualsCaptions[5] = '';
/*
visualsCaptions[0] = 'Standard Life';
visualsCaptions[1] = 'Standard Life';
visualsCaptions[2] = 'Standard Life';
visualsCaptions[3] = 'HP Technology 07';
visualsCaptions[4] = 'Visual<br /><span class="productionCompany">No name</span>';
visualsCaptions[5] = 'QATAR';
*/

function showPrevImage(captionArray, path)
	{
	currentImage--;
	
	if(currentImage < 0)
		{
		currentImage = captionArray.length -1;
		}
	
	showImage(currentImage, captionArray, path);
	adjustBlips(captionArray);
	}

function showNextImage(captionArray, path)
	{
	currentImage++;
	
	if(currentImage == captionArray.length)
		{
		currentImage = 0;
		}

	showImage(currentImage, captionArray, path);	
	}

function showImage(image, captionArray, path)
	{
	currentImage = image;
	document.getElementById('theimage').src = path + currentImage + '.jpg';
	setCaption(captionArray, currentImage);
	adjustBlips(captionArray);
	}

function setCaption(captionArray, index)
	{
	document.getElementById('thecaption').innerHTML = captionArray[index];
	}

function adjustBlips(captionArray)
	{
	for(var i = 0; i < captionArray.length; i++)
		{
		document.getElementById('blip' + i).src = '/img/blip-open.gif';
		}
	
	document.getElementById('blip' + currentImage).src = '/img/blip-closed.gif';
	}

function highlightBox(captionArray)
	{
	for(var i = 0; i < captionArray.length; i++)
		{
		document.getElementById('image' + i).style.backgroundImage = 'url(/img/bg-smallimage.gif)';
		}
	
	document.getElementById('image' + currentImage).style.backgroundImage = 'url(/img/bg-smallimage-selected.gif)';
	}

function jumpy()
	{
	window.location = document.getElementById('jumpmenu').value;
	}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}