/////////////////////////////////////////////////////////////////////////////////
//  zoomImage
/////////////////////////////////////////////////////////////////////////////////

function zoomImage(imageName, zoomPercent, imageWidth, imageHeight, target, imageTitle, imageMap, mapVariable)
{
    imageWidth = Math.floor(imageWidth * zoomPercent);
    imageHeight = Math.floor(imageHeight * zoomPercent);

    msg = window.open("", target, "toolbar=no,directories=no,scrollbars=yes,status=no,resizable=yes,menu=no");
    
    var displayPage = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
    displayPage += "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
        
    displayPage += "<head>\n";
    displayPage += "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />\n";
 
    displayPage += "<title>" + imageTitle + "</title>\n";

    displayPage += "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"/includes/css/default.css\" />\n"
    displayPage += "<script type=\"text/javascript\" src=\"/includes/js/default.js\"></script>\n";
        
    displayPage += "</head>\n";
    displayPage += "<body>\n";
        
    displayPage += "<table class=\"table\" cellspacing=\"0\" cellpadding=\"0\" style=\"height: 100%;\">";
        
    displayPage += "<tr>\n";
    displayPage += "<td class=\"module_right_title\" style=\"height: 20px;\">\n";
    displayPage += "<table class=\"table\" cellspacing=\"0\" cellpadding=\"0\">\n";
        
    displayPage += "<tr>\n";
    displayPage += "<td class=\"right_tleft\">&nbsp;</td>";

    displayPage += "<td class=\"right_tspacer\" style=\"text-align: center;\">[&nbsp;<a href=\"javascript:window.close();\">Close Window</a>&nbsp;]</td>\n";
    displayPage += "<td class=\"right_tright\">&nbsp;</td>\n";

    displayPage += "</tr>\n";

    displayPage += "</table>\n";
    displayPage += "</td>\n";
    displayPage += "</tr>\n";

    displayPage += "<tr>\n";
    displayPage += "<td style=\"height: 100%; text-align: center;\">\n";

    displayPage += "<p><span class=\"bgray\">" + imageTitle + "</span></p>\n";
    
    if (imageMap == "NONE")
    {
        displayPage += "<p><img src=\"" + imageName + "\" alt=\"\" title=\"" + imageTitle + "\" width=\"" + imageWidth + "\" height=\"" + imageHeight + "\" /></p>\n";

    }
    else
    {
        displayPage += mapVariable;
        displayPage += "<p><img src=\"" + imageName + "\" alt=\"\" title=\"" + imageTitle + "\" width=\"" + imageWidth + "\" height=\"" + imageHeight + "\" usemap=\"#" + imageMap + "\" /></p>\n";
    }

    displayPage += "</td>\n";
    displayPage += "</tr>\n";
    displayPage += "</table>\n";
    
    displayPage += "</body>\n";
    displayPage += "</html>\n";
    
    msg.document.write(displayPage);
    msg.document.close();
}

/////////////////////////////////////////////////////////////////////////////////
//  printImage
/////////////////////////////////////////////////////////////////////////////////

function printImage(imageName, imageWidth, imageHeight, target, imageTitle, imageMap, mapVariable)
{
    msg = window.open("", target, "toolbar=no,directories=no,scrollbars=yes,status=no,resizable=yes,menu=no");
    
    var displayPage = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
    displayPage += "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
        
    displayPage += "<head>\n";
    displayPage += "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />\n";
 
    displayPage += "<title>" + imageTitle + "</title>\n";

    displayPage += "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"/includes/css/default.css\" />\n"
    displayPage += "<script type=\"text/javascript\" src=\"/includes/js/default.js\"></script>\n";
        
    displayPage += "</head>\n";
    displayPage += "<body>\n";
        
    displayPage += "<table class=\"table\" cellspacing=\"0\" cellpadding=\"0\" style=\"height: 100%;\">";
        
    displayPage += "<tr>\n";
    displayPage += "<td class=\"module_right_title\" style=\"height: 20px;\">\n";
    displayPage += "<table class=\"table\" cellspacing=\"0\" cellpadding=\"0\">\n";
        
    displayPage += "<tr>\n";
    displayPage += "<td class=\"right_tleft\">&nbsp;</td>";

    displayPage += "<td class=\"right_tspacer\" style=\"text-align: center;\">[&nbsp;<a href=\"javascript:window.close();\">Close Window</a>&nbsp;] [&nbsp;<a href=\"javascript:window.print();\">Print Window</a>&nbsp;]</td>\n";
    displayPage += "<td class=\"right_tright\">&nbsp;</td>\n";

    displayPage += "</tr>\n";

    displayPage += "</table>\n";
    displayPage += "</td>\n";
    displayPage += "</tr>\n";

    displayPage += "<tr>\n";
    displayPage += "<td style=\"height: 100%; text-align: center;\">\n";

    displayPage += "<p><span class=\"bgray\">" + imageTitle + "</span></p>\n";
    
    if (imageMap == "NONE")
    {
        displayPage += "<p><img src=\"" + imageName + "\" alt=\"\" title=\"" + imageTitle + "\" width=\"" + imageWidth + "\" height=\"" + imageHeight + "\" /></p>\n";

    }
    else
    {
        displayPage += mapVariable;
        displayPage += "<p><img src=\"" + imageName + "\" alt=\"\" title=\"" + imageTitle + "\" width=\"" + imageWidth + "\" height=\"" + imageHeight + "\" usemap=\"#" + imageMap + "\" /></p>\n";
    }

    displayPage += "</td>\n";
    displayPage += "</tr>\n";
    displayPage += "</table>\n";
    
    displayPage += "</body>\n";
    displayPage += "</html>\n";
    
    msg.document.write(displayPage);
    msg.document.close();
}

/////////////////////////////////////////////////////////////////////////////////
//  splitImage
/////////////////////////////////////////////////////////////////////////////////

function splitImage(imageName, zoomPercent, imageWidth, imageHeight, target, imageTitle, imageMap, mapVariable)
{
    imageWidth = Math.floor(imageWidth * zoomPercent);
    imageHeight = Math.floor(imageHeight * zoomPercent);

    msg = window.open("", target, "toolbar=no,directories=no,scrollbars=yes,status=no,resizable=yes,menu=no");
    
    var displayPage = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
    displayPage += "<html xmlns=\"http://www.w3.org/1999/xhtml\">\n";
        
    displayPage += "<head>\n";
    displayPage += "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />\n";
 
    displayPage += "<title>" + imageTitle + "</title>\n";

    displayPage += "<link rel=\"stylesheet\" type=\"text/css\" media=\"all\" href=\"/includes/css/default.css\" />\n"
    displayPage += "<script type=\"text/javascript\" src=\"/includes/js/default.js\"></script>\n";
        
    displayPage += "</head>\n";
    displayPage += "<body>\n";
        
    displayPage += "<table class=\"table\" cellspacing=\"0\" cellpadding=\"0\" style=\"height: 100%;\">";
        
    displayPage += "<tr>\n";
    displayPage += "<td class=\"module_right_title\" style=\"height: 20px;\">\n";
    displayPage += "<table class=\"table\" cellspacing=\"0\" cellpadding=\"0\">\n";
        
    displayPage += "<tr>\n";
    displayPage += "<td class=\"right_tleft\">&nbsp;</td>";

    displayPage += "<td class=\"right_tspacer\" style=\"text-align: center;\">[&nbsp;<a href=\"javascript:window.close();\">Close Window</a>&nbsp;] [&nbsp;<a href=\"javascript:window.print();\">Print Window</a>&nbsp;]</td>\n";
    displayPage += "<td class=\"right_tright\">&nbsp;</td>\n";

    displayPage += "</tr>\n";

    displayPage += "</table>\n";
    displayPage += "</td>\n";
    displayPage += "</tr>\n";

    displayPage += "<tr>\n";
    displayPage += "<td style=\"height: 100%; text-align: center;\">\n";

    displayPage += "<p><span class=\"bgray\">" + imageTitle + "</span></p>\n";
    
    if (imageMap == "NONE")
    {
        displayPage += "<p><img src=\"" + imageName + "\" alt=\"\" title=\"" + imageTitle + "\" width=\"" + imageWidth + "\" height=\"" + imageHeight + "\" /></p>\n";

    }
    else
    {
        displayPage += mapVariable;
        displayPage += "<p><img src=\"" + imageName + "\" alt=\"\" title=\"" + imageTitle + "\" width=\"" + imageWidth + "\" height=\"" + imageHeight + "\" usemap=\"#" + imageMap + "\" /></p>\n";
    }

    displayPage += "</td>\n";
    displayPage += "</tr>\n";
    displayPage += "</table>\n";
    
    displayPage += "</body>\n";
    displayPage += "</html>\n";
    
    msg.document.write(displayPage);
    msg.document.close();
}

/////////////////////////////////////////////////////////////////////////////////
//  Javascript end
/////////////////////////////////////////////////////////////////////////////////

