function showPic (whichpic) { 
	if (document.getElementById) {
		image = whichpic.childNodes[0];
		document.getElementById('placeholder').src = whichpic.href;
		document.getElementById('placeholder').alt = image.alt;
		document.getElementById('desc').childNodes[0].nodeValue = image.alt; 
		 
		return false; 
	} else { 
		return true; 
	} 
}

function showLargePic()
{
	if ( document.getElementById )
	{
		med_image = document.getElementById( 'placeholder' );
		src = med_image.src;
		title = med_image.alt;
		suffix_pos = src.indexOf( '-med' );
		file_suffix = src.indexOf( '.', suffix_pos );
		
		image_src = src.substring( 0, suffix_pos );
		image_src = image_src + '-lge' + src.substring( file_suffix );	
					
		
		newWindow = window.open('/viewimage.php?title=' + title + '&image=' + image_src,'_blank','toolbar=no,width=300,height=300');
		//newWindow.document.write('<html><head><script src="/f/gallery.js" type="text/javascript"></script><title>'+title+'</title></head><body onload="loadPic(\''+image_src+'\', document.body);">Loading...</body></html>');
		newWindow.focus();   				 

		return false;
	}
	return true;
}

function loadPic( src, element )
{
	image = new Image();
 	image.onload = function() {
 		window.resizeBy(image.width-document.body.clientWidth,image.height-document.body.clientHeight)
 		element.innerHTML = '';
 		element.style.background = 'url(' + src + ')';
 	}
 	image.onerror = function() {
 		element.innerHTML = 'Image load failed.';
 	}
 	image.onabort = function() {
 		element.innerHTML = 'Image load aborted.';
 	}
 	image.src = src;
}