/**
	randomly select a picture from the array and display with caption
**/

var pic = new Array();
var caption = new Array();
var used = new Array();
var npics = 30;
var i;

pic[0] = "images/Meeting 100829/DSC_0320 Chet - 2 Guitars 215x143.jpg";
caption[0] = "Chet's Walnut and Zebrawood Bodies and Necks";
pic[1] = "images/Meeting 100314/DSC04640 Woody Guitar 215x287.jpg";
caption[1] = "Woody's redwood top L-00";
pic[2] = "images/Meeting 090712/IMG_4130 215x.jpg";
caption[2] = "Woody ponders the banjo";
pic[3] = "images/Meeting 100314/imga0830 Howard OM 215x269.jpg";
caption[3] = "Howard's OM in final stages of buffing";
pic[4] = "images/Meeting 090712/IMG_4116 215x.jpg";
caption[4] = "Dennis plays Woody's Cittern";

pic[5] = "images/Meeting 090712/IMG_4117 215x.jpg";
caption[5] = "Chet plays Larry's Nylon String";
pic[6] = "images/Meeting 090712/IMG_4125 215x.jpg";
caption[6] = "Dan, Chet, and Jack discussing banjo possibilities";
pic[7] = "images/Meeting 090712/IMG_4121 215x.jpg";
caption[7] = "Chet's 000 mold with cutaway";
pic[8] = "images/Meeting 091011/Jack w-banjo 215x.jpg";
caption[8] = "Jack Plays One of His Banjos";
pic[9] = "images/Meeting 091011/Chet Examines Jacks Fretless, Open-back Banjo.jpg";
caption[9] = "Chet Examines Jacks Fretless, Open-back Banjo";

pic[10] = "images/Meeting 100314/IMG_5091 Neck Scarf Jig 215x143.jpg";
caption[10] = "Scarf cutting jig for scarfed neck construction";
pic[11] = "images/Meeting 100829/IMG_5760 Woody and Bodhran 215x323.jpg";
caption[11] = "Woody and Bodhran w/staved rim";
pic[12] = "images/Meeting 091011/Larry w-Chets redwood 215x.jpg";
caption[12] = "Larry with Chet's Redwood Top OM";
pic[13] = "images/Meeting 091011/Bob w-Larrys dulcimer 215x.jpg";
caption[13] = "Bob Looks over Larry's Cedar Strip Top Dulcimer";
pic[14] = "images/Meeting 091011/Dennis w-Sepele Back OM 215x.jpg";
caption[14] = "Dennis Shows his Sepele Back OM";

pic[15] = "images/Meeting 100829/Larry Binding Routing Jig 215x143.jpg";
caption[15] = "Binding Routing Jig";
pic[16] = "images/Meeting 100314/IMGA0429 Jack Examines Bolt on Neck 215x143.jpg";
caption[16] = "Jack examines bolt-on neck";
pic[17] = "images/Meeting 100314/IMG_5300 Stacked Heel 215x143.jpg";
caption[17] = "Stacked heel on Larry's Dreadnought";
pic[18] = "images/Meeting 091114/IMG_4542 Dan Woody Jack 215x.jpg";
caption[18] = "Dan, Woody, and Jack";
pic[19] = "images/Meeting 100314/DSC04658 Contour Drilling 215x161.jpg";
caption[19] = "Woody's violin back in progress";

pic[20] = "images/Meeting 100425/Dan, Woody, BB, Art Conner 215x143.jpg";
caption[20] = "Dan, Woody, BB, Art Conner";
pic[21] = "images/Meeting 100425/Art Conner Spool Clamps 215x143.jpg";
caption[21] = "Art Conner's Spool Clamps";
pic[22] = "images/Meeting 100425/Art Conner Workbench 215x323.jpg";
caption[22] = "Art Conner's Workbench";
pic[23] = "images/Meeting 100425/Art Conner Tools 01 215x143.jpg";
caption[23] = "Art Conner's Tools";
pic[24] = "images/Meeting 100425/Art Conner Fiddle Neck 215x143.jpg";
caption[24] = "Art Conner's Fiddle Neck in Progress";

pic[25] = "images/Meeting 100829/Larry Binding Routing Jig 215x143.jpg";
caption[25] = "Binding Routing Jig";
pic[26] = "images/Meeting 100829/IMG_5749 BB and Elec Guit 215x311.jpg";
caption[26] = "B.B. Rierson and Electric Guitar";
pic[27] = "images/Gig 101119 Third Street/Chet Dennis 215x146.jpg";
caption[27] = "Chet and Dennis at Third Street";
pic[28] = "images/Gig 101119 Third Street/BB Jack 215x131.jpg";
caption[28] = "B.B. and Jack at Third Street";
pic[29] = "images/Gig 101119 Third Street/Andy 215x333.jpg";
caption[29] = "Andy at Third Street";

function ShowLeftColImage(){
	i = Math.floor(Math.random() * (npics));
	while (used[i]){  // cycle until you get an unused index
		 i = Math.floor(Math.random() * (npics));
	}

	document.write('<img src="' + pic[i] + '" width=215>');
	document.write('<p>' + caption[i] + '</p>');
	used[i]=1;  // mark this index as used
	document.write('<hr/>');
	return ("");
}

function ShowDoubleImage(){
	i = Math.floor(Math.random() * (npics));
	while (used[i]){
		 i = Math.floor(Math.random() * (npics));
	}
	
	used[i]=1;  // mark this index as used
	var j=i;  // save the index and get a second index
	i = Math.floor(Math.random() * (npics));
	while (used[i]){
		 i = Math.floor(Math.random() * (npics));
	}
	

	document.write("<center><table>")
	document.write("<tr>")  //first table row is the pics
	document.write("<td>")
	document.write('<img src="' + pic[i] + '" width=215>');
	document.write("</td>")
	document.write("<td>")
	document.write('<img src="' + pic[j] + '" width=215>');
	document.write("</td>")
	document.write("</tr>")
	
	document.write("<tr>")  //second table row is the captions
	document.write("<td>")
	document.write('<p><center>' + caption[i] + '</center></p>');
	document.write("</td>")	
	document.write("<td>")
	document.write('<p><center>' + caption[j] + '</center></p>');
	document.write("</td>")	
	document.write("</tr>")
	document.write("</table></center>")
		
	used[i]=1;
	document.write('<hr/>');
	return ("");
}

function resetRandomPics() {
	for (i=0; npics; i++) {
		used[i]=0;
	}
	return("");
}
