               // JavaScript Document


function drawDivs() {
	// data should be an array of stuff 
	
	if (picturesData) {
		for (var i=0; i<picturesData.length; i++) {	// loop through each element in the data array
			var url = picturesData[i].url || "";
			
			var height = "";
			var width = "";
			if (picturesData[i].h) {
				height = "height='" + picturesData[i].h + "'";
			} else if (picturesData[i].w) {
				width = "width='" + picturesData[i].w + "'";
			} else {
				width = "width='600'";
			}
			

			document.write(
				"<div id=\"big" + i + "\" class=\"bigPic\">" + 
					"<a href=\"javascript:toggleLayer('big" + i + "');\" title=\"Click to close picture\">" +
					"<img src=\"" + url + "\" " + width + " " + height + " border=\"none\"></a>" +
				"</div>");
		}
	}
}

//<a href="javascript:;" onClick="wimpy_loadAndPlay('../audio/awyatt01.mp3', '', 'awyatt speaks', '', '');">Load and Play: track 1 </a>


function drawThumbs(data) {
	// data should be an array of stuff 
	if (picturesData) {
		for (var i=0; i<picturesData.length; i++) {	// loop through each element in the data array
			var caption = picturesData[i].caption || "";
			var smallImage = picturesData[i].smallUrl || "";
			
			
			var mp3links = "";
			
			if (picturesData[i].mp3 && picturesData[i].mp3.length) {
				var links = [];
				
				for (var mp3Index=0; mp3Index<picturesData[i].mp3.length; mp3Index++) {
					var mp3LinkText = picturesData[i].mp3[mp3Index].caption || "play audio";
					var mp3Url = picturesData[i].mp3[mp3Index].url || "";
					links.push(
						"<div style=\"float: left; padding-right: 10px;\"><object type=\"application/x-shockwave-flash\" data=\"../player/player_mp3_maxi.swf\" width=\"150\" height=\"20\"><param name=\"wmode\" value=\"transparent\" /><param name=\"movie\" value=\"../player/player_mp3_maxi.swf\" /><param name=\"FlashVars\" value=\"mp3=" + mp3Url + "&amp;showvolume=1&amp;bgcolor1=99CC00\" /></object><br /><span style=\"150px;\">" + mp3LinkText + "</span></div>"
					)
				}
				
				mp3links = links.join(" ");
			}
			
			
			var tr=	"<tr>" +
						"<td rowspan='2' width='100' valign='top'>" +
							"<div class='smallPic'>" +
								"<a href=\"javascript:toggleLayer('big" + i + "');\" title=\"Click to enlarge\">" +
									"<img src=\"" + smallImage + "\" border=\"none\" />" +
								"</a>" +
							"</div>" +
						"<td valign='top' align='left'>" +
							caption +
						"</td>" + 
						"</td>" +
						
					"</tr>" +
					"<tr>" +
						"<td valign='bottom' align=\"left\"><div style=\"float: left;\">" +
						mp3links +	
						"</div></td>" +
					"</tr>"+
					"<tr>" +
						"<td colspan=\"2\" align=\"left\">" +
						"<hr>" +	
						"</td>" +
					"</tr>"
					;
	
			document.write(tr);
			
		}
	}
}

