window.onload = initAll;

var myPics = new Array("images/slide12.jpg", 
					   "images/slide11.jpg",
					   "images/slide14.jpg",
					   "images/slide18.jpg",
					   "images/slide16.jpg",
					   "images/slide10.jpg", 
					   "images/slide04.jpg",
					   "images/slide01.jpg", 
					   "images/slide03.jpg", 
					   "images/slide05.jpg", 
					   "images/slide06.jpg", 
					   "images/slide13.jpg", 
					   "images/slide08.jpg",  
					   "images/slide17.jpg", 
					   "images/slide02.jpg", 
					   "images/slide09.jpg",
					   "images/slide15.jpg",
					   "images/slide19.jpg");

var myCaption = new Array("View from Story Winery in Amador County.", 
						  "View from Stones Throw Vineyards in Camino, CA.", 
						  "Vineyards at Stevenot Winery in Murphys, CA.",
						  "Perry Creek Vineyards in Fairplay, CA.<br />(photo courtesy of El Dorado Winery Assn.)",
						  "Vineyards at Bella Piazza Winery in Amador County.",
						  "View from Wofford Acres Vineyards in Camino, CA.", 
						  "Old wagon in Amador County.", 
						  "Boeger Winery in Camino, CA.", 
						  "Pond at Deaver Vineyards in Plymouth, CA.", 
						  "Vineyards at Lava Cap Winery in Placerville, CA.", 
						  "Rusty old barn in Amador County.", 
						  "View from Mount Aukum Winery in El Dorado County.", 
						  "Old building in Plymouth, CA.", 
						  "Gold Hill Winery in Placerville, CA.<br />(photo courtesy of El Dorado Winery Assn.)", 
						  "Original tasting room at Boeger Winery built in 1872.", 
						  "The tasting room at Story Winery in Amador County.", 
						  "Ironstone Winery in Murphys, CA.",
						  "Fitzpatrick Winery in Fairplay, CA.");

var thisPic = 0;
var thisCaption = 0;

function initAll()
{
document.getElementById('prevlink').onclick = processPrevious;
document.getElementById('nextlink').onclick = processNext;
}

function processPrevious()
{
	if(thisPic == 0)
	{
	thisPic = myPics.length;
	thisCaption = myCaption.length;
	}
thisPic--;
thisCaption--;

document.getElementById('mypicture').src = myPics[thisPic];
document.getElementById('myCaption').innerHTML = myCaption[thisCaption];
return false;
}


function processNext()
{
thisPic++;
thisCaption++;
	if(thisPic == myPics.length)
	{
	thisPic = 0;
	thisCaption = 0;
	}

document.getElementById('mypicture').src = myPics[thisPic];
document.getElementById('myCaption').innerHTML = myCaption[thisCaption];
return false;
}