";
stringHTML += "";
if (picarglist[1] != "") {
dimensions = picarglist[1].split("x");
height = dimensions[0];
width = dimensions[1];
depth = dimensions[2];
stringHTML += " ";
if (dimensions.length > 0) {
stringHTML += height + ""h";
cmheight = Math.round(height * IN2CM);
cmdimensions = cmheight + "cm h";
} // end if
if (dimensions.length > 1) {
stringHTML += " x " + width + ""w";
cmwidth = Math.round(width * IN2CM);
cmdimensions += " x " + cmwidth + "cm w";
} // end if
if (depth != null) {
stringHTML += " x " + depth + ""d";
cmdepth = Math.round(depth * IN2CM);
cmdimensions += " x " + cmdepth + "cm d";
} // end if
if (cmdimensions != "") {
stringHTML += " " + cmdimensions;
} // end if
} // end if
if (picarglist.length == 3) {
comments = picarglist[2];
comments = comments.replace(/ /g, " ");
comments = comments.replace(/</g, "<");
comments = comments.replace(/>/g, ">");
stringHTML += " " + comments;
} // end if
stringHTML += "";
stringHTML += "
";
stringHTML += "";
stringHTML += "";
newwin = window.open("", "ImagePage", "height=610,width=660,resizable,scrollbars");
newwin.document.open();
newwin.document.write(stringHTML);
newwin.document.close();
newwin.focus();
} // end ShowImageLarge()
//---------------------------------------
function CreateCell(file, dimension, comment) {
number = file.substring(0, 3) - 0;
if (number >= 0 && number <=99) {
dir = "001-099";
} else if (number >= 100 && number <=199) {
dir = "100-199";
} else if (number >= 200 && number <=299) {
dir = "200-299";
} else if (number >= 300 && number <=399) {
dir = "300-399";
} else if (number >= 400 && number <=499) {
dir = "2004";
} else if (number >= 500 && number <=599) {
dir = "2005";
} // end if
path = "../vga/" + dir + "/vga_" + file;
thumbnail = "../th/" + dir + "/th_" + file;
// picheight = 100
comment = comment.replace(/ /g, " ");
comment = comment.replace(//g, ">");
pathdimcomment = path + "|" + dimension + "|" + comment;
stringHTML = "
";
stringHTML += "";
// This prints out just the number of the piece of pottery: 501 instead of 501-a.jpg
if (file != "000-blank.jpg") {
stringHTML += " # " + (file.split('-'))[0] + "";
} // end if
stringHTML += "
";
return stringHTML;
} // end CreateCell()
//---------------------------------------
function CreateRow() {
// creates a table row of pictures
stringHTML = "
";
for (i=0; i < piclist.length; i++) {
stringHTML += CreateCell(piclist[i].file, piclist[i].dimension, piclist[i].comment);
} // end for loop
stringHTML += "
";
document.write(stringHTML);
} // end CreateRow()
//---------------------------------------
function CreateGallery() {
// determine how many cells in a row
// base it on the square root of the number of items, but between 3 and 6
maxrowlength = 6;
minrowlength = 3;
picrowlength = Math.sqrt(piclist.length);
if (Math.floor(picrowlength) != picrowlength) {
picrowlength = Math.floor(picrowlength);
picrowlength++; // you need an extra row for the last several pictures
} else {
picrowlength = Math.floor(picrowlength);
} // end if
if (picrowlength > maxrowlength) {
picrowlength = maxrowlength;
} else if (picrowlength < minrowlength) {
picrowlength = minrowlength;
} // end if
// determine how many rows
no_of_rows = Math.ceil((piclist.length + 0.0) / picrowlength);
// --------------------------------------------
// create the table
stringHTML = "
";
for (i=0; i < no_of_rows; i++) {
stringHTML += "
";
for (j=1; j <= picrowlength; j++) {
currentitem = j + i * picrowlength; // current picture being processed
if (currentitem > piclist.length) {
break;
} else {
stringHTML += CreateCell(piclist[currentitem-1].file, piclist[currentitem-1].dimension, piclist[currentitem-1].comment);
} // end if
} // end inner for loop
stringHTML += "
";
} // end outer for loop
stringHTML += "
";
document.write(stringHTML);
ClearArray(piclist);
} // end CreateGallery()
//---------------------------------------
function CreateGalleryListRow(dlink) {
// creates a table row of pictures
gallery = piclist[0];
gallerypage = piclist[1];
stringHTML = "
";
if (dlink != null) {
displaylink = dlink.substring(0,1);
displaylink = displaylink.toLowerCase();
} // end if
if (displaylink != "n") {
stringHTML += "
";
} // end if
for (i=2; i < piclist.length; i++) {
stringHTML += CreateCell(piclist[i].file, piclist[i].dimension, piclist[i].comment);
} // end for loop
stringHTML += "
";
document.write(stringHTML);
ClearArray(piclist);
} // end CreateGalleryListRow()
function ClearArray(arraylist) {
for (i=0; i < arraylist.length; i++) {
arraylist[i] = null;
} // end for loop
} // end ClearArray()