/* changes the banner image on the NWNL home page */


var d = new Date();

/* x selects one of 12 images for static viewing. */
var s = d.getSeconds();
var x = Math.round((s-2)/5); // (s %12) // for 12 static images

/* n selects images 1-10, 6-15, 11-20, or (16-20 & 1-5) for the crossfade slide show. */
var h = d.getHours();
var n = 5 * (h %4);

var f = '"images1\/2-09\/';
var wh = ' WIDTH="600" HEIGHT="261"';

var images1 = [
f + 'Jones_070630_WA_5460.jpg"' + wh + ' ALT="" TITLE="Washington: Columbia River Basin, Trout Lake and Mount Adams"',
f + 'Jones_070913_ET_8302_M.jpg"' + wh + ' ALT="" TITLE="Ethiopia: Omo River Basin, shepherd with goats above the Omo River"',
f + 'Jones_070621_WA_4072.jpg"' + wh + ' ALT="" TITLE="Washington: Columbia River Basin, irrigation of cherry trees"',
f + 'Jones_070622_WA_1327.jpg"' + wh + ' ALT="" TITLE="US: Washington: Columbia River Basin, aerial view of Chief Joseph Dam"',
'"images1\/NJ-CAL-310.jpg"' + wh + ' ALT="" TITLE="New Jersey: Raritan River Basin"'];

var images2 = [
f + 'Jones_080527_MT_1175.jpg"' + wh + ' ALT="" TITLE="Montanta: Mississippi River Basin, flock of American white pelican"',
f + 'Jones_080131_ET_6115_M.jpg"' + wh + ' ALT="" TITLE="Ethiopia: Lower Omo River Basin, Omo Delta, women collecting water from the river"',
f + 'Jones_080204_ET_8165.jpg"' + wh + ' ALT="" TITLE="Ethiopia: Lower Omo River Basin, Lebuk farm village"',
f + 'Jones_070708_OR_6779_M.jpg"' + wh + ' ALT="" TITLE="Oregon: Columbia River Basin, pulp plant"',
f + 'Jones_080418_NJ_4324.jpg"' + wh + ' ALT="" TITLE="New Jersey: Raritan River Basin, Budd Lake at sunset"'];

var images3 = [
f + 'Jones_080817_BC_8628.jpg"' + wh + ' ALT="" TITLE="British Columbia: Kootenay Rockies, Columbia River Basin"',
f + 'Jones_070701_OR_5564.jpg"' + wh + ' ALT="" TITLE="Oregon: Columbia River Basin, spit at confluence of Hood River and Columbia River"',
f + 'Jones_080510_NJ_0500.jpg"' + wh + ' ALT="" TITLE="New Jersey: Lower Raritan River Basin, storm runoff remediation infrastructure"',
f + 'Jones_070624_WA_4380.jpg"' + wh + ' ALT="" TITLE="Washington: Columbia River Basin, irrigation of corn"',
f + 'Jones_070702_OR_5043.jpg"' + wh + ' ALT="" TITLE="Oregon: Columbia River Basin, Bonneville Dam on the Columbia River"'];

var images4 = [
f + 'Jones_080602_WY_2774.jpg"' + wh + ' ALT="" TITLE="Wyoming: Mississippi River Basin, Yellowstone National Park, grasses growing in seasonal pond"',
f + 'Jones_080202_ET_7057.jpg"' + wh + ' ALT="" TITLE="Ethiopia: Lower Omo River Basin, Omo Delta at low water stage"',
f + 'Jones_070926_ET_2664.jpg"' + wh + ' ALT="" TITLE="Ethiopia: Blue Nile River Basin, girl carrying buckets of water"',
f + 'MO-STJ-108.jpg"' + wh + ' ALT="" TITLE="Mississippi: Mississippi River Basin, Fishing in Meramec Springs, St. James"',
f + 'Jones_070627_WA_4431.jpg"' + wh + ' ALT="" TITLE="Washington: Columbia River Basin, nuclear power plant"'];

var captions1 = ['Columbia River Basin','Omo River Basin','Columbia River Basin','Columbia River Basin','Raritan River Basin'];

var captions2 = ['Mississippi River Basin','Lower Omo River Basin','Lower Omo River Basin','Columbia River Basin','Raritan River Basin'];

var captions3 = ['Columbia River Basin','Columbia River Basin','Lower Raritan River Basin','Columbia River Basin','Columbia River Basin'];

var captions4 = ['Mississippi River Basin','Lower Omo River Basin','Blue Nile River Basin','Mississippi River Basin','Columbia River Basin'];


var images = new Array(images1[0],images1[1],images1[2],images1[3],images1[4],images2[0],images2[1],images2[2],images2[3],images2[4],images3[0],images3[1],images3[2],images3[3],images3[4],images4[0],images4[1],images4[2],images4[3],images4[4],images1[0],images1[1],images1[2],images1[3],images1[4],images2[0],images2[1],images2[2],images2[3],images2[4],images3[0],images3[1],images3[2],images3[3],images3[4],images4[0],images4[1],images4[2],images4[3],images4[4]);

var captions = new Array(captions1[0],captions1[1],captions1[2],captions1[3],captions1[4],captions2[0],captions2[1],captions2[2],captions2[3],captions2[4],captions3[0],captions3[1],captions3[2],captions3[3],captions3[4],captions4[0],captions4[1],captions4[2],captions4[3],captions4[4],captions1[0],captions1[1],captions1[2],captions1[3],captions1[4],captions2[0],captions2[1],captions2[2],captions2[3],captions2[4],captions3[0],captions3[1],captions3[2],captions3[3],captions3[4],captions4[0],captions4[1],captions4[2],captions4[3],captions4[4]);

var array2 = ['cf1','cf2','cf3','cf4','cf5','cf6','cf7','cf8','cf9','cf10'];

var html1 = '<div class="cf_element" id="'; // + cf1
var html2a = '<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="600"><TR><TD COLSPAN="2"><IMG SRC=';
var html2 = '"><TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" WIDTH="600"><TR><TD COLSPAN="2"><IMG SRC='; // image file path, dimensions, ALT
var html3 = '><BR><IMG SRC="/spacer.gif" WIDTH="1" HEIGHT="4" ALT=""><\/TD><\/TR><TR><TD ALIGN="left" VALIGN="top"><P CLASS="caption">'; // Nyangatom villagers on the Lower Omo River, Ethiopia
var html4a = '<\/P><\/TD><TD ALIGN="right" VALIGN="top"><P CLASS="caption">Photos &copy; Alison M. Jones<\/P><\/TD><\/TR><\/TABLE>';
var html4 = '<\/P><\/TD><TD ALIGN="right" VALIGN="top"><P CLASS="caption">Photos &copy; Alison M. Jones<\/P><\/TD><\/TR><\/TABLE><\/div>';


if (cf_okay) { // crossfade slide show

	document.writeln('<TABLE BORDER="0" STYLE="margin:0px; padding:0px; " CELLSPACING="0" CELLPADDING="0" WIDTH="600"><TR><TD COLSPAN="2" VALIGN="top" HEIGHT="292">');
	
	document.write(html1 + 'cf1' + html2 + images[0+n] + html3 + captions[0+n] + html4);
	document.write(html1 + 'cf2' + html2 + images[1+n] + html3 + captions[1+n] + html4);
	document.write(html1 + 'cf3' + html2 + images[2+n] + html3 + captions[2+n] + html4);
	document.write(html1 + 'cf4' + html2 + images[3+n] + html3 + captions[3+n] + html4);
	document.write(html1 + 'cf5' + html2 + images[4+n] + html3 + captions[4+n] + html4);
	document.write(html1 + 'cf6' + html2 + images[5+n] + html3 + captions[5+n] + html4);
	document.write(html1 + 'cf7' + html2 + images[6+n] + html3 + captions[6+n] + html4);
	document.write(html1 + 'cf8' + html2 + images[7+n] + html3 + captions[7+n] + html4);
	document.write(html1 + 'cf9' + html2 + images[8+n] + html3 + captions[8+n] + html4);
	document.write(html1 + 'cf10' + html2 + images[9+n] + html3 + captions[9+n] + html4);
	
	document.writeln('<\/TD><\/TR><\/TABLE>');
	
	var cf = new Crossfader( array2, 2000, 2000 ); // (array, cross-fade time, wait time)



} else { // static images

	var sImage = new Array(images1[0],images1[1],images1[2],images1[3],images2[0],images2[2],images2[4],images3[0],images3[1],images3[4],images4[0],images4[2]);
	var sCaption = new Array(captions1[0],captions1[1],captions1[2],captions1[3],captions2[0],captions2[2],captions2[4],captions3[0],captions3[1],captions3[4],captions4[0],captions4[2]);

	document.write(html2a + sImage[x] + html3 + sCaption[x] + html4a);
}

