
// scripts to open bigger version of thumbnail in pop-up

function openFromThumbnail(oImg, w, h){
	// oImg: either image id or HTMLObject representing an image
	if(typeof oImg == "string")
		oImg = getImageObject("oImg");
	
	if(oImg==null)
		return;
	
	/*
		filenames convention for (gallery)-thumbnails:
		small version:
		basename_small.type (eg: elbe_small.jpg)
		large version:
		basename.type (eg: elbe.jpg)
		NOTE:
		both files must be of equal filetype
	*/
	var currFile = getFileNameFromSource(oImg.src);
	var fileLocation = getFilePathFromSource(oImg.src);
	var fileType = getFileExtensionFromSource(oImg.src);
	var fileBaseName = getFileBaseNameFromSource(oImg.src);
	_Index = fileBaseName.lastIndexOf("_");

	var newFile = fileLocation + fileBaseName.substr(0, _Index) + fileType;
			
	var popje = window.open("thumbnailpopper.html?file=" + newFile, "pics", "width="+w+",height="+h);
			
}

function getImageObject(strImgId){
	return document.getElementById(strImgId);
}



