nextID = 0;
prevID = 0;

function setImg (img, path) {
	if (img!=null) {
		if (img.src!=path)
			img.src=path;
	}
}

function changeDesc(id) {
  if (document.getElementById(id).style.display=='block')
    document.getElementById(id).style.display='none';
  else 
    document.getElementById(id).style.display='block';
}

function showPhoto(id, maxID) {
  for (i=1; i<=maxID; i++) {
   linkID = '0'+i;
   document.getElementById(i).style.display='none';
//   document.getElementById(linkID).style.fontWeight='normal';
  }
  document.getElementById(id).style.display='block';
  document.getElementById(id).style.width='600px';
  document.getElementById(id).style.height='415px';

  linkID = '0'+id;
//  document.getElementById(linkID).style.fontWeight='bold';

  if (id == maxID) nextID = 1;
  else nextID = id+1;

  if (id == 1) prevID = maxID;
  else prevID = id-1;
}

function showNext(maxID) {
  showPhoto(nextID, maxID);
}

function showPrev(maxID) {
  showPhoto(prevID, maxID);
}

function close_flash() {
  document.getElementById("flash_index").style.display = "none";
}


