function ListPhotos(PHOTO_GROUP,TITLE) {
        listOfPhotos = "'" + PHOTO_GROUP.toString().replace(/,/g,"','") + "'";
        for ( i=0; i<PHOTO_GROUP.length; i++ ) {
                document.write("<a href=\"javascript:NewPhotoPage('" + PHOTO_GROUP[i].replace('_s.jpg','.jpg') + "',[" + listOfPhotos + "],'" + TITLE.replace('\'','\\\'') + "');\">");
                document.writeln("<img src=\"" + PHOTO_GROUP[i] + "\" />");
                document.writeln("</a>");
        }
}

function NewPhotoPage(SHOWN_PHOTO,PHOTO_GROUP,TITLE){
        document.open();
        document.writeln("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//UTF-8\">");
        document.writeln("<html xmlns=\"http://www.w3.org/1999/xhtml\">");
        document.writeln("<head>");
        document.writeln("    <title>" + TITLE + "</title>");
        document.writeln("</head>");
        document.writeln("<script language=\"javascript\" type=\"text/javascript\">");
        document.writeln("    window.onload = rolloverInit;");
        document.writeln("    function rolloverInit() {");
        document.writeln("        for ( var i=0; i<document.images.length; i++ ) {");
        document.writeln("            var imgObj = document.images[i];");
        document.writeln("            if ( imgObj.id == \"dispImg\" ) {var dispImgObj = imgObj;}");
        document.writeln("            else {");
        document.writeln("                if ( imgObj.id ) {");
        document.writeln("                    imgObj.icon      = imgObj.src;");
        document.writeln("                    imgObj.fullPic   = imgObj.src.replace(\"_s.jpg\",\".jpg\");");
        document.writeln("                    preloadedImg     = new Image();");
        document.writeln("                    preloadedImg.src = imgObj.fullPic");
        document.writeln("                    setupRollover(imgObj,dispImgObj);");
        document.writeln("                }");
        document.writeln("            }");
        document.writeln("        }");
        document.writeln("    }");
        document.writeln("    function setupRollover(thisImage,dispImg) {");
        document.writeln("        thisImage.onmouseover = function() {dispImg.src = thisImage.fullPic;}");
        document.writeln("    }");
        document.writeln("</script>");
        document.writeln("<body background=\"http://www.dilatonsworld.net/models/background.jpg\">");
        document.writeln("    <center>");
        document.writeln("        <table>");
        document.writeln("            <tr valign=\"bottom\" >");
        document.writeln("                <td align=\"center\" height=\"720\">");
        document.writeln("                    <a href=\"javascript:history.go(-1);\">");
        document.writeln("                        <img src=\"" + SHOWN_PHOTO + "\" id=\"dispImg\" alt=\"Return to the previous page\" border=\"0\" />");
        document.writeln("                    </a>");
        document.writeln("                </td>");
        document.writeln("            </tr>");
        document.writeln("        </table>");
        document.writeln("        <p>");
        for ( i=0; i<PHOTO_GROUP.length; i++ ) {
                document.writeln("            <img src=\"" + PHOTO_GROUP[i] + "\" id=\"pic" + i + "\" height=\"100\" />");
        }
        document.writeln("        </p>");
        document.writeln("    </center>");
        document.writeln("    <table width=\"100%\">");
        document.writeln("        <tr>");
        document.writeln("            <td align=\"left\" width=\"80\">");
        document.writeln("                <a href=\"javascript:history.go(-1);\">");
        document.writeln("                    <img src=\"http://www.dilatonsworld.net/models/back.gif\" alt=\"Return to the previous page\" border=\"0\" />");
        document.writeln("                </a>");
        document.writeln("            </td>");
        document.writeln("            <td align=\"right\">");
        document.writeln("                <address>&copy 2009 dilatonsworld.net<br>All rights reserved</address>");
        document.writeln("            </td>");
        document.writeln("    </table>");
        document.writeln("</body>");
        document.writeln("</html>");
        document.close();
}
