function popImage(imgLoc,imgTitle){	
// PATH TO YOUR LOADING ANIMATION
var loadingImagePath = "http://www.biorelief.com/images/loading.gif";
// IMAGE AUTO SIZE POP SYSTEM
// Written By : Chad Seaman
// Published : August 18th 2006
// Summary:
// This is a quick javascript app that lets a user pass a image URL to the popImage() function.
// Once the function is called, we begin to preload the image into a javascript image holder.  Once the
// image is loaded we check its width and heigh and in turn adjust the size of the corresponding pop up 
// window to fit the images dimensions.
// FETCH IMAGE LOCATION
this.imgLoc = imgLoc;
// CREATE NEW IMAGE ELEMENT
var getImage = new Image();
// WHEN IMAGE IS LOADED, SWAP OUT THE SRC OF THE "LOADING" IMAGE
// RESIZE WINDOW BY IMAGE HEIGHT AND WIDTH
// CLEAR getImage SRC
getImage.onload = function(){
winPop.document.getElementById("loadIt").src = getImage.src;
winPop.window.resizeBy(getImage.width-112, getImage.height-85);
getImage.src = "";
}
// OPEN WINDOW
var winPop = window.open("","","menu=0,status=0,scrollbars=0,width=112,height=100;");
// WRITE MINI HTML FILE INTO POPPED WINDOW
winPop.document.write("<html><head><title>\""+imgTitle+"\"</title></head><body onblur=\"window.close();\" onclick=\"window.close();\" style=\"padding:0; margin:0;\"><div align=\"center\"><img src=\""+loadingImagePath+"\" id=\"loadIt\"><br><span style=\"font-size:10px; color:#333333; font-family:arial;\"> click anywhere to close this window </span></div></body></html>");
// CLOSE POPUP WINDOW document ELEMENT
winPop.document.close();
// FETCH IMAGE FOR PRELOADING
getImage.src = imgLoc;
// ALL DONE
}

function popImage2(imgLoc, imgTitle) {
// Remake of the original popImage script of Chad Seaman in an attempt to improve
// the reliability of the loading of images and to add a print and close button
// David Mioduszewski
// March 2007
this.imgLoc = imgLoc;
var getImage = new Image();
getImage.src = imgLoc;
// creates the pop window
var winPop = window.open("","","menu=0,status=0,resizable,location=0,scrollbars=0,width=20,height=20;");
// places the image
winPop.document.write("<html><head><title>\""+imgTitle+"\"</title><link href=\"http://biorelief.com/CSS/optimized_render.css\" rel=\"stylesheet\" type=\"text/css\" /><link href=\"http://biorelief.com/CSS/print.css\" rel=\"stylesheet\" media=\"print\" /></head><body style=\"padding:0px;margin:0px;\"><table id=\"popBox\" align=\"center\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"><tr id=\"popTop\"><td class=\"popHead\">Image Viewer</td><td class=\"popBtn\"><a href=\"javascript:window.print();\">PRINT</a> &nbsp;&nbsp;&nbsp; <a href=\"javascript:window.close();\">CLOSE</a></td></tr>");
winPop.document.write("<br><tr><td colspan=\"2\" align=\"center\"><img src=\""+imgLoc+"\" alt=\""+imgTitle+"\" id=\"dImage\"></td></tr></table></body></html>");
//line for bottom: <tr id=\"popBot\"><td colspan=\"2\"> \""+imgTitle+"\" </td></tr>
// for ie
if (navigator.appName == "Microsoft Internet Explorer") {
getImage.onload = function(){
winPop.document.getElementById("dImage").src = getImage.src;
winPop.window.resizeBy(getImage.width, getImage.height);
getImage.src = "";
}
}
// for netscape/ff
if (navigator.appName == "Netscape") {
winPop.onload = function(){
winPop.document.getElementById("dImage").src = getImage.src;
winPop.window.resizeBy(getImage.width, getImage.height);
getImage.src = "";
}
}
winPop.document.close();
}