// Takes in an array and returns HTML code to generate the image table for the SMC enews
function generateImageTable(img_array, caption_array) {
	
	max_cols = 5;  // number of images per row
	max_images = img_array.length;
	document.write("<table id=\"images\" border=\"0\" cellspacing=\"15\"><tbody>\n");

	for (index in img_array) {
		filename = img_array[index];
		caption = caption_array[index];
		if (index % max_cols == 0)
			document.write("<tr>");

		document.write("<td align=\"center\" height=\"75\" valign=\"center\" width=\"75\"><a href=\"#bottom\" class=\"images\"><img src=\"images/75px/" + filename + "\" alt=\"\" onClick=\"javascript: o=getElementById('viewer'); o.style.display = 'block'; i=getElementById('full'); i.src='images/450px/" + filename + "'; c=getElementById('caption'); c.innerHTML='" + caption + "'; \" border=\"0\" /></a></td>\n");
		
		if (((index + 1) % max_cols == 0) || (index == max_images))
			document.write("</tr>\n");
	}

	document.write("</tbody></table>\n");
}

// creates an annoying popup window
function showLink(url) {
	window.open(url, "enews", "location=no,menubar=no,resizable=yes,scrollbars=yes,status=no,titlebar=yes,toolbar=yes");
}

/* jQuery code to create zebra strips on tables */
function zebraStripes ( table_class ) {
	$("." + table_class + " tr:odd").addClass("oddrow");
	$("." + table_class + " tr:even").addClass("evenrow");
}

/* jQuery code to create a mouse over highlight for table rows */
function mouseOverStripe ( table_class ) {
	$("." + table_class + " tr").mouseover( function() {
		$(this).addClass("overrow");
	});
	$("." + table_class + " tr").mouseout( function() {
		$(this).removeClass("overrow");
	});
}

$(document).ready(function() {
	// zebra stripe tables
	zebraStripes("stripeMe");  // applies zebra striping to tables with class stripeMe
	//mouseOverStripe("stripeMe");  // gives the table a mouse over highlight
});