var first = 1;								// Number of first photo
var last = 11;								// Number of last photo

if( QueryString.value('photo') == null || QueryString.value('photo') > last || QueryString.value('photo') < first )	// Default to 1
var photo = 1;
else
	var photo = QueryString.value('photo');
	
if( photo == first )
{
	var previous = last;					// If first photo, previous should go to last
}
else
{
	var previous = photo;					// Determine previous photo
	previous--;
}
if( photo == last )
{
	var next = first;						// if last photo, next should go to first
}
else
{
	var next = photo;						// Determine next photo
	next++;
}

function writePhoto()
{
	document.write('<a href="javascript: pop(\'largeview\', \'' + photo + '\');"><img src="assets/images/gallery/' + photo + '.jpg" width="894" height="347" alt="" border="0" /></a>');
}

function writeLargePhoto()
{
	document.write('<img src="assets/images/gallery/largeview_' + photo + '.jpg" width="1476" height="570" alt="" border="0" />');
}

function writeNav()
{
	document.write('<a href="gallery.html?photo=' + previous + '"><img src="assets/images/gallery/previous.gif" hsrc="assets/images/gallery/previous-over.gif" width="17" height="28" alt="Previous" border="0" /></a><a href="gallery.html?photo=' + next + '"><img src="assets/images/gallery/next.gif" hsrc="assets/images/gallery/next-over.gif" width="17" height="28" alt="Next" border="0" /></a>');
}