	var viewPhotoGalleryDiv = '';
	var currentPhoto=0;
	
	function setDisplayPhoto(i)
	{
		document.getElementById("img_preview").src=arrPhotos[i];
		currentPhoto = i;
		if(currentPhoto>=arrPhotos.length-1)
		{
			document.getElementById("next_btn").style.visibility='hidden';
		}
		if(currentPhoto<1)
		{
			document.getElementById("previous_btn").style.visibility='hidden';
		}
	}
	function next_photo()
	{
		document.getElementById("previous_btn").style.visibility='visible';
		document.getElementById("img_preview").src=arrPhotos[currentPhoto+1];
		currentPhoto = currentPhoto + 1;
		if(currentPhoto>=arrPhotos.length-1)
		{
			document.getElementById("next_btn").style.visibility='hidden';
		}
	}
	function previous_photo()
	{
		document.getElementById("next_btn").style.visibility='visible';
		document.getElementById("img_preview").src=arrPhotos[currentPhoto-1];
		currentPhoto = currentPhoto - 1;
		if(currentPhoto<1)
		{
			document.getElementById("previous_btn").style.visibility='hidden';
		}
	}
	onload = function() 
	{
      var preload_image_object = new Image();
      var j = 0;
      if (arrPhotos)
      {
       for(j=0; j<=arrPhotos.length; j++) 
         preload_image_object.src = arrPhotos[j];
      }
    };
    
    
var arrPhotos=[];