// JavaScript Document
function displayPhoto(i)
{
	if (!document.getElementById) return true;
	
    showPic(photos[i][0], photos[1][1], photos[i][2], photos[i][3], photos[i][4], photos[i][5]);
	if (i > 0)
	{
	    var prevLink = document.getElementById("prevlink");
		var prev = i-1;
	    prevLink.onclick= function() { return displayPhoto(prev); };
	}
    if (i < maxPhotos -1)
	{
	    var nextLink = document.getElementById("nextlink");
		var next = i+1;
	    nextLink.onclick= function() { return displayPhoto(next); };
	}
	
	return false;
}
	
	
function showPic(photo, photoAlt, locationImg, photoCreditImg, locationAlt, creditAlt)
{
    if (!document.getElementById) return true;
    
	document.getElementById('large').src = photo;
	if ((photoAlt != null) && (photoAlt.length > 0))
	{
        document.getElementById('large').alt = photoAlt;
		document.getElementById('large').name = photoAlt;
		document.getElementById('large').title = photoAlt;
	}
	else 
	{
		document.getElementById('large').alt = "";
		document.getElementById('large').name = "";
	    document.getElementById('large').title = "";
	}
		
	if ((locationImg != null) && (locationImg.length > 0))
	{
		document.getElementById('locationCredit').src = "images/credits/" + locationImg;
	}
	else
	{
		document.getElementById('locationCredit').src = "images/spacer.gif";
    }
				
	if ((photoCreditImg != null) && (photoCreditImg.length > 0))
	{
		document.getElementById('photoCredit').src = "images/credits/" + photoCreditImg;
	}
	else
    {
		document.getElementById('photoCredit').src = "images/spacer.gif";
	}
				
    if ((locationAlt != null) && (locationAlt.length > 0))
	{
		document.getElementById('locationCredit').alt = locationAlt;
	}
	else 
	{
		document.getElementById('locationCredit').alt = "";
    }
				
	if ((creditAlt != null) && (creditAlt.length > 0))
	{
		document.getElementById('photoCredit').alt = creditAlt;
	}
	else 
	{
		document.getElementById('photoCredit').alt = "";
	}
	window.scrollTo(0,140);
        return false;
}