//  PhotoNavigate html, javascript and images copywrited by HyperSpider, LLC 2001

var SelectedPhotoFile = "";
var SelectedPhotoIndex = 0;
var SelectedPhotoFullyQualified = "";
var ThumbSize = "XS";
var PhotoSize = "M";
var ShowDescription = "Yes";
var ShowAlbumDir = "Yes";
var ShowConfig = "No";
var ShowThumbs = "Yes";
var SlideShowInterval=2;
var SlideShowIntervalCounter = 0;
var CurrentAlbumIndex = 0;
var SlideShowRunning = false;
var SlideShowPaused = false;
var PhotoFrameLoaded = false;
var PhotoLoaded = false;

	var cookieValue;
	function cookieVal(cookieName) {
  
		thisCookie = document.cookie.split("; ");
		for (i=0; i<thisCookie.length; i++) {
		  	if (cookieName == thisCookie[i].split("=")[0]) {
			   return thisCookie[i].split("=")[1];
			}
		 }
		return ""
	}

	function GetCookies() {
	if (document.cookie != "") {	
		cookieValue = cookieVal("ThumbSize");
		if ((cookieValue != "") & (cookieValue != "undefined")) {ThumbSize = cookieValue;}
		//  Version 0.8.2 removed the concept of a ThumbSize being "N" (or None)
		//  if it is "N" change it to XS
		if (ThumbSize == "N") {ThumbSize = "XS";}
		
		
		cookieValue = cookieVal("PhotoSize");
		if ((cookieValue != "") & (cookieValue != "undefined")) {PhotoSize = cookieValue;}
		
		cookieValue = cookieVal("CurrentAlbumIndex");
		if ((cookieValue != "") & (cookieValue != "undefined")) {CurrentAlbumIndex = cookieValue;}

		cookieValue = cookieVal("ShowDescription");
		if ((cookieValue != "") & (cookieValue != "undefined")) {ShowDescription = cookieValue;}

		cookieValue = cookieVal("ShowAlbumDir");
		if ((cookieValue != "") & (cookieValue != "undefined")) {ShowAlbumDir = cookieValue;}
		
		cookieValue = cookieVal("ShowConfig");
		if ((cookieValue != "") & (cookieValue != "undefined")) {ShowConfig = cookieValue;}

		cookieValue = cookieVal("ShowThumbs");
		if ((cookieValue != "") & (cookieValue != "undefined")) {ShowThumbs = cookieValue;}
		
		cookieValue = cookieVal("SlideShowInterval");
		if ((cookieValue != "") & (cookieValue != "undefined")) {SlideShowInterval = cookieValue;}
	}
	}
	
	var expireDate = new Date;

	function setCookie() {
		expireDate.setTime(expireDate.getTime() + 3E11);
		document.cookie = "ThumbSize="+ThumbSize+"; expires="+expireDate.toGMTString() + "; path=/";
		document.cookie = "PhotoSize="+PhotoSize+"; expires="+expireDate.toGMTString() + ";path=/";
		document.cookie = "CurrentAlbumIndex="+CurrentAlbumIndex+"; expires="+expireDate.toGMTString() + ";path=/";
		document.cookie = "ShowDescription="+ShowDescription+"; expires="+expireDate.toGMTString() + ";path=/";
		document.cookie = "ShowAlbumDir="+ShowAlbumDir+"; expires="+expireDate.toGMTString() + ";path=/";
		document.cookie = "ShowConfig="+ShowConfig+"; expires="+expireDate.toGMTString() + ";path=/";
		document.cookie = "ShowThumbs="+ShowThumbs+"; expires="+expireDate.toGMTString() + ";path=/";
		document.cookie = "SlideShowInterval="+SlideShowInterval+"; expires="+expireDate.toGMTString() + ";path=/";
	}


function SetCurrentAlbumIndex() {
	for (i in top.AlbumDirArray) {
		if (top.AlbumName == top.AlbumNameArray[i]) {
			top.CurrentAlbumIndex = i;
		}
	}
}
	
	
function framesLoaded() {
	GetCookies();
	SetCurrentAlbumIndex();
	top.ViewFrame.location = PNDir + "PNExplore.html";
	
}


