var imageDirSS;
var ext;
var activePhoto;
var totalPhoto;

// Arrow Functions

function nextPhoto()
{
	if (document.images)
	{
		if (activePhoto == totalPhoto)
		{
			activePhoto = 1;
		}
		else
		{
			activePhoto = activePhoto + 1;
		}
		document.getElementById('gallery').src = imageDirSS + activePhoto + ext;
	}
}

function prevPhoto()
{
	if (document.images)
	{
		if (activePhoto == 1)
		{
			activePhoto = totalPhoto;
		}
		else
		{
			activePhoto = activePhoto - 1;
		}
		document.getElementById('gallery').src = imageDirSS + activePhoto + ext;
	}
}

/* */

        var ext = '.jpg';
	var activePhoto = 1;
	var totalPhoto = 10;     

function newImage(arg) {
        if (document.images) {
                rslt = new Image();
                rslt.src = arg;
                return rslt;
        }
}

var preloadFlag = false;
function preloadImages() {
        if (document.images) {
                img1 = newImage(imageDirSS+"1.jpg");
                img2 = newImage(imageDirSS+"2.jpg");
                img3 = newImage(imageDirSS+"3.jpg");
                img4 = newImage(imageDirSS+"4.jpg");
                img5 = newImage(imageDirSS+"5.jpg");
                img6 = newImage(imageDirSS+"6.jpg");
                img7 = newImage(imageDirSS+"7.jpg");
                img8 = newImage(imageDirSS+"8.jpg");
                img9 = newImage(imageDirSS+"9.jpg");
                img10 = newImage(imageDirSS+"10.jpg");
		preloadFlag = true;
        }
}
preloadImages();       





