/* :::::::::::::::::::::  CODE UNIQUE TO INDEX.HTML  :::::::::::::::::::::: */

// Function to strip name of file from path name given in the metaArray and substitute 'thumbnails' for images before returning the altered path address.
function thumbnailPathFinder(fileAddress) {
	//alert(fileAddress + '\r\n' + (fileAddress.length-1) + '\r\n' + fileAddress.charAt(fileAddress.length-1));// for dev purposes.
	for (j=0; j<fileAddress.length; j++){
		if (fileAddress.charAt(j)=="/") {
		var lastSlashPos=j;
		}// end of 'if' statement (deduces pos of last slash in the fileAddress string)
	}// end of 1st for loop
	
	for (j=0; j<lastSlashPos; j++) {
		if (fileAddress.charAt(j)=="/") {
		var penultimateSlashPos=j+1;
		}// end of 'if' statement (deduces pos of penultimate slash in the fileAddress string)
	}// end of 2nd for loop
	
	var fileAddressSubString1=fileAddress.substring(0, penultimateSlashPos);
	var fileAddressSubString2=fileAddress.substring(lastSlashPos, fileAddress.length);
	var fullpath=fileAddressSubString1 + 'thumbnails' + fileAddressSubString2;
	return fullpath;
}// end of thumbnailPathFinder function

// NOTE: search has already been devined (if called for) in metaArray.js

// *** THIS MAY HAVE BEEN COCKED UP!, CHECK WITH ORIGINAL CODE BEFORE OVERWRITING!!!
	// Depth-dependant code (different for index.html and page.html, could be combined later):
	if (depth==1) {
		for (i=1; i<metaArray.length; i++) {
			if (metaArray[i].keywords.indexOf(thisAlbum)!=-1 && (metaArray[i].seeMoreLink)) {
				fill_myArray_from_metaArray_data();
				arrayCounter++;
			}
		}
	} else if (depth==3) {
		for (i=1; i<metaArray.length; i++) {
			if (metaArray[i].keywords.indexOf(thisAlbum)!=-1) {
				fill_myArray_from_metaArray_data();
				arrayCounter++;
			}
		}
	}

// END OF FOLIO'S INDEX.HTML SCRIPT

