 var allHTMLTags = new Array();

 function ResetPhotoItems() {

  // Create Array of All HTML Tags
  var allHTMLTags=document.getElementsByTagName("*");

  // Loop through all tags using a for loop
  for (i=0; i<allHTMLTags.length; i++) {

   // Get all tags with the specified class name.
   if (allHTMLTags[i].className=='Active') {

    // allHTMLTags[i].style.display = 'none';
    allHTMLTags[i].className = 'active';
  
   }

  }

 };

 function LargePhoto(filename, object, photos){

  ResetPhotoItems();
  var LargePhoto       = document.getElementById("LargePhoto");
  LargePhoto.src       = "./upload/pages/left/" + filename;
	
  var PhotoItem        = document.getElementById("PhotoItem" + object);
  PhotoItem.className  = "Active";

  //var PhotoTitle       = document.getElementById("PhotoTitle");
  // PhotoTitle.innerHTML = PhotoItem.title;
  
  document.getElementById('current').value = object;  
 
 };
 
 function NextPhoto(photos){
	
	var current = document.getElementById('current').value;
	
	if(current == photos){
		
		var current=1;
		var next = current;	
		var next_file_name = document.getElementById('item'+next).value;	
		LargePhoto(next_file_name, next, photos);
	
	} else {
			
		current++;
		var next = current;	
		var next_file_name = document.getElementById('item'+next).value;	
		LargePhoto(next_file_name, next, photos);
	
	}
	
	//alert(current);
	
 }
