function change_big_photo(idBigPhotoFrame, idNewPhoto)
{
  $(idBigPhotoFrame).src = $(idNewPhoto).src;
}


/* Code below (makepage, print): taken from 'http://www.boutell.com/newfaq/creating/printpart.html'. */

/**
 * Printing of an image (and only an image).
 * Calls another page just embedding the image, with two hacks:
 *   - extra page will close prompty, just the time to load the image and then call the printer;
 *   - the closing "script" tag for embedded javascript is split;
 *   - automatic printing and closing set thanks to a callback function set from... the loading function.
 * @param {Object} src The url of the image to be printed
 */
function makepage(src) {
  // We break the closing script tag in half to prevent
  // the HTML parser from seeing it as a part of
  // the *main* page.
  return "<html>\n" +
    "<head>\n" +
    "<title>Temporary Printing Window</title>\n" +
    "<script>\n" +
    "function step1() {\n" +
    "  setTimeout('step2()', 10);\n" +
    "}\n" +
    "function step2() {\n" +
    "  window.print();\n" +
    "  window.close();\n" +
    "}\n" +
    "</scr" + "ipt>\n" +
    "</head>\n" +
    "<body onLoad='step1()'>\n" +
    "<img src='" + src + "'/>\n" +
    "</body>\n" +
    "</html>\n";
}

/**
 * Public entry point to print a single image.
 * @param {Object} evt  The trigger for printing, i.e. a click on the image, presumably.
 */
function printme(evt) {
  if (!evt) {
    // Old IE
    evt = window.event;
  }    
  var image = evt.target;
  if (!image) {
    // Old IE
    image = window.event.srcElement;
  }
  printImage(image);
}

function printImage(imgObject) {
  src = imgObject.src;
  link = "about:blank";
  var pw = window.open(link, "_new");
  pw.document.open();
  pw.document.write(makepage(src));
  pw.document.close();
}
