// JavaScript Document

function artBox(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=1,menubar=0,resizable=1,width=600,height=450,left = 100,top = 100');");
}

function artPhoto(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=420,height=375,left = 100,top = 100');");
}

function PrevPic(PhotoNumber) {
PhotoNumber-- ;
if (PhotoNumber < 10) {
strPhotoNumber = "0" + PhotoNumber;
}
else {
strPhotoNumber = PhotoNumber;
}
PrevButton = "<a href='" + strPhotoNumber + ".html' class='previous'>Previous Photo</a>";
return (PrevButton);
}

function NextPic(PhotoNumber) {
PhotoNumber++ ;
if (PhotoNumber < 10) {
strPhotoNumber = "0" + PhotoNumber;
}
else {
strPhotoNumber = PhotoNumber;
}
NextButton = "<a href='" + strPhotoNumber + ".html' class='next'>Next photo</a>";
return (NextButton);
}

function ShowMePhoto(PhotoNumber) {
if (PhotoNumber < 10) {
strPhotoNumber = "0" + PhotoNumber;
}
else {
strPhotoNumber = PhotoNumber;
}
PhotoName = "<img src='" + strPhotoNumber + ".jpg'>";
return (PhotoName);
}

function CurrentPhoto() {
	var photoFileNumber;
	var fileName = location.pathname.substring(location.pathname.lastIndexOf('.')-3);
	if (fileName.substr(0,1) == '/'){
		photoFileNumber = fileName.substr(1, 2); //second and third characters- should be 01...99
	}
	else{
		photoFileNumber = fileName.substr(0, 3); //first-third characters- 100-999
	}

	if (photoFileNumber.substr(0, 1) == 0) {
		photoFileNumber = photoFileNumber.substr(1, 1);
	}
	//alert(photoFileNumber);
return (photoFileNumber);
}