/*
	A SIMPLE PHOTO GALLERY VIEWER
*/


// Loads the photo and associated information
function Load(i) {

	// load the photo
	document.images.fotoMain.src=photos[i];
        // set the counter info
	pic1 = document.getElementById("picNo") ;
        pic1.innerHTML = i + 1 ;
	pic2 = document.getElementById("picTotal") ;
        pic2.innerHTML = photos.length ;
        // set the description info
	desc = document.getElementById("description") ;
        desc.innerHTML = descpt[i];
        // set the author info
	auth = document.getElementById("author") ;
        auth.innerHTML = author[i];
}

// Handler for moving to next photo
function Next() {

        i = index + 1 ;
        if (i < photos.length) {
        	// set index to next photo
        	index = i ;
        } else {
        	// if on last photo then
                // set index to beginning
        	index = 0 ;
       	}
        Load(index);
}

// Handler for moving to previous photo
function Back() {

        i = index - 1 ;
        if (i >= 0) {
        	// set index to previous photo
        	index = i ;
        } else {
        	// if on first photo then
                // set index to last photo
        	index = photos.length - 1;
        }
        Load(index);
}

function OpenGalleryWin(url) {

	window.open(url, "", "top=20,left=20,width=700,height=500");
}

