
var numPictures = 20;

var pictureArray = new Array(numPictures);
for (i = 0; i < numPictures; i++) {
	pictureArray[i] = new Array(5);
}

pictureArray[19] = ["images/images/a-band1.jpg", 500, 375, "Sandra Lima", ];
pictureArray[18] = ["images/images/b-phlpkyleboris1.jpg", 500, 375, "Sandra Lima", ];
pictureArray[17] = ["images/images/e-boriskurt2.jpg", 500, 375, "Sandra Lima", ];
pictureArray[16] = ["images/images/f-kurt3.jpg", 375, 500, "Sandra Lima", ];
pictureArray[15] = ["images/images/g-kurt1.jpg", 375, 500, "Sandra Lima", ];
pictureArray[14] = ["images/images/h-kurt2.jpg", 375, 500, "Sandra Lima", ];
pictureArray[13] = ["images/images/i-feet1.jpg", 500, 375, "Sandra Lima", ];
pictureArray[12] = ["images/images/j-phlp3.jpg", 375, 500, "Sandra Lima", ];
pictureArray[11] = ["images/images/k-phlp1.jpg", 500, 333, "<a href='http://www.tobymorris.com' style='color: #666666' target='_new'>Toby Morris</a>", ];
pictureArray[10] = ["images/images/l-phlp2.jpg", 500, 333, "<a href='http://www.tobymorris.com' style='color: #666666' target='_new'>Toby Morris</a>", ];
pictureArray[9] = ["images/images/m-mark3.jpg", 375, 500, "Sandra Lima", ];
pictureArray[8] = ["images/images/n-mark1.jpg", 500, 333, "<a href='http://www.tobymorris.com' style='color: #666666' target='_new'>Toby Morris</a>", ];
pictureArray[7] = ["images/images/o-mark2.jpg", 500, 333, "<a href='http://www.tobymorris.com' style='color: #666666' target='_new'>Toby Morris</a>", ];
pictureArray[6] = ["images/images/p-kyle5.jpg", 375, 500, "Sandra Lima", ];
pictureArray[5] = ["images/images/q-kyle4.jpg", 500, 375, "Sandra Lima", ];
pictureArray[4] = ["images/images/r-kyle3.jpg", 500, 333, "<a href='http://www.tobymorris.com' style='color: #666666' target='_new'>Toby Morris</a>", ];
pictureArray[3] = ["images/images/s-kyle2.jpg", 333, 500, "<a href='http://www.tobymorris.com' style='color: #666666' target='_new'>Toby Morris</a>", ];
pictureArray[2] = ["images/images/t-kurtkyle1.jpg", 500, 333, "<a href='http://www.tobymorris.com' style='color: #666666' target='_new'>Toby Morris</a>", ];
pictureArray[1] = ["images/images/u-kyle1.jpg", 500, 333, "<a href='http://www.tobymorris.com' style='color: #666666' target='_new'>Toby Morris</a>", ];
pictureArray[0] = ["images/images/v-kyle6.jpg", 500, 375, "Sandra Lima", ];

var photoWindow = null;
var photoPage = "photo.html";

var currentPicture = 19;


function showPhoto(photoIndex) {
	currentPicture = photoIndex;	
	if (! photoWindow || photoWindow.closed) {
		photoWindow = window.open(photoPage,"LOZENGE","top=10,left=200,toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=600,height=600");
	}	
	else {
		photoWindow.focus();
		photoWindow.showParentPhoto();
	}
}

function showParentPhoto() {
	currentPicture = opener.currentPicture;
	newImage = new Image(pictureArray[currentPicture][1], pictureArray[currentPicture][2]);
	newImage.src = pictureArray[currentPicture][0];
	//document.thePhoto.width = pictureArray[currentPicture][1];
	//document.thePhoto.height = pictureArray[currentPicture][2];
	document.thePhoto.src = newImage.src;
}

function nextPhoto() {
	currentPicture--;
	if (currentPicture < 0) {
		currentPicture = pictureArray.length - 1;
	}
	
	document.thePhoto.width = pictureArray[currentPicture][1];
	document.thePhoto.height = pictureArray[currentPicture][2];
	document.thePhoto.src = pictureArray[currentPicture][0];
}

function previousPhoto() {
	currentPicture++;
	if (currentPicture > pictureArray.length - 1) {
		currentPicture = 0
	}
	
	document.thePhoto.width = pictureArray[currentPicture][1];
	document.thePhoto.height = pictureArray[currentPicture][2];
	document.thePhoto.src = pictureArray[currentPicture][0];
}
