/*
Script posted and featured on JavaScript Kit
http://javascriptkit.com
modified by R Doherty
*/

function display_image(image) {
newsource = "large/" + image.src.substring(image.src.lastIndexOf("/") + 1, image.src.lastIndexOf(".")) + ".jpg";
PreView = window.open("", "Preview", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0,top=0,left=0,width=500,height=524");
//PreView.resizeTo((image.width+50),(image.height + 120));
PreView.document.open();
PreView.document.write("<HTML><HEAD>");
PreView.document.write("<TITLE>Preview</TITLE>");
PreView.document.write("</HEAD><BODY BGCOLOR=FFFFFF TEXT=000000>");
PreView.document.write("<FORM><CENTER><B><FONT SIZE=+1>" + 
image.alt + "</FONT></B><HR>");
PreView.document.write("<IMG HSPACE=0 VSPACE=0 " +
"SRC='" + newsource + "'>");
PreView.document.write("<HR><FORM><INPUT TYPE='button' VALUE='Close' " +
"onClick='window.close()'></FORM>");
PreView.document.write("</CENTER>");
PreView.document.write("</BODY></HTML>");
PreView.document.close();
PreView.focus();
    }

function destroy_preview() {
PreView = window.open("", "Preview", "");
PreView.close();
}

