// this script displays 8 (default) images in a row, from a predefined array 
// of image data stored in the photostrip array.
// By David Watts, with help from Sitepoint, http://www.sitepoint.com/forums/showthread.php?t=448505

var totalphotos = photostrip.length;  // the total number of photos we have
var displayphotos = 8; // number of photos to display
 
function randOrd(){
	return (Math.round(Math.random())-0.5); 
	}
	
// populate the DATA array with a random sequence of totalphotos numbers, all unique
var data = [];
for (var i = totalphotos-1; i >= 0; i--) data.push(i);
data.sort(randOrd);

// create img tags from the entries in the photostrip array
// only want displayphotos number of images
// 0=name; 1=src; 2=href

for (var i = 0; i <= displayphotos-1; i++) 
	document.write("<a href='"+photostrip[data[i]][2]+"'><img border=0 alt='"+photostrip[data[i]][0]+"' title='"+photostrip[data[i]][0]+"' style='margin:0;' src='"+photostrip[data[i]][1]+"' width='100' height='66'></a>");


