function displayImage( image ) {

	var width, height, title, src, qual, winw, winh, view, winbody;
	
	width = image.width * 4;
	height = image.height * 4;
	title = image.alt;

	src = image.src.replace(/_th\./, ".");

	if ( hasClassName( image, "rachel" ) ) {
		qual = ' by <a href="http://rachelbaine.com">Rachel Baine</a>';
	}
	else if ( hasClassName( image, "lindsey" ) ) {
		qual = ' by <a href="http://www.colorinblackandwhite.com">Lindsey White</a>';
	}

	winw = width + 25;
	winh = height + 70;

	view = newWin( winw, winh );

	view.document.open();

	winbody = "<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01//EN'\n";
	winbody += " 'http://www.w3.org/TR/html4/strict.dtd'>\n";
	winbody += "<html>\n<head>";
	winbody += "<title>" + title + "</title>\n";
	winbody += "<style>\n";
	winbody += "body {\n text-align: center;\n";
	winbody += " color: white;\n";
	winbody += " background-color: black;\n";
	winbody += " font-family: verdana, arial, sans-serif;\n";
	winbody += " font-weight: bold;}\n";
	winbody += "button {\n margin-left: 10px;\n";
	winbody += " margin-right: 10px;}\n";
	winbody += "</style>\n";
	winbody += "</head>\n<body>\n";
	winbody += title + qual;
	winbody += "<button type='button' onClick='window.close()'>\n";
	winbody += "Close</button>\n<p>\n";
	winbody += "<img src='" + src + "' width=" + width + " height=" + height + ">\n";
	winbody += "</body>\n</html>";

	view.document.write(winbody);
	view.document.close();

}


function newWin ( width, height ) {

//	Open a new window 20px in from the current one

	if ( navigator.appName == "Microsoft Internet Explorer" ) {
		scrLeft = window.screenLeft + 20;
		scrTop = window.screenTop + 20;
	}
	else {
		scrLeft = window.screenX + 20;
		scrTop = window.screenY + 20;
	}

	winpars = "width=" + width + ", height=" + height + ", top=" + scrTop + ", left=" + scrLeft;
	winpars += ", location=no, scrollbars=yes";

	var nwin = window.open("", "", winpars);

	return nwin;

}


function hasClassName(objElement, strClass) {

//	if there is a class, check if it contains what we're looking for as one
//	of the classes

	if ( objElement.className ) {

//		the classes are just a space separated list, so first get the list

		var arrList = objElement.className.split(' ');

//		get uppercase class for comparison purposes

		var strClassUpper = strClass.toUpperCase();

//		now look for the required class

		for ( var i = 0; i < arrList.length; i++ ) {
			if ( arrList[i].toUpperCase() == strClassUpper ) {
				return true;
			}
		}

	}

//	if we got here then the class name is not there

	return false;

}

