function popImage(imgLoc,imgTitle){	
// PATH TO YOUR LOADING ANIMATION
var loadingImagePath = "http://images.cableorganizer.com/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://css.cableorganizer.com/wire-management-2007-opt.css\" rel=\"stylesheet\" type=\"text/css\" /><link href=\"http://css.cableorganizer.com/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();
}


function popRotate(swfLoc, swfHeight, swfWidth, swfTitle) {
// script to create pop window for Flash swf image rotator
// David Mioduszewski
// September 2008
this.swfLoc = swfLoc;
var getSwf = new Object();
getSwf.src = swfLoc;
// creates the pop window
var winPop = window.open("","","menu=0,status=0,resizable,location=0,scrollbars=0,width=100,height=100;");
// places the image
winPop.document.write("<html><head><title>\""+swfTitle+"\"</title><link href=\"http://css.cableorganizer.com/wire-management-2007-opt.css\" rel=\"stylesheet\" type=\"text/css\" /></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.close();\">CLOSE</a></td></tr>");
winPop.document.write("<br><tr><td colspan=\"2\" align=\"center\"><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0\" width=\""+swfWidth+"\" height=\""+swfHeight+"\"><param name=\"movie\" value=\""+swfLoc+"\" /><param name=\"quality\" value=\"high\" /><embed src=\""+swfLoc+"\" quality=\"high\" pluginspage=\"http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\""+swfWidth+"\" height=\""+swfHeight+"\"></embed></object></td></tr>");
winPop.document.write("<tr id=\"popBot\"><td colspan=\"2\"> \""+swfTitle+"\" </td></tr></table></body></html>");
winPop.onload = function(){
winPop.window.resizeBy(swfWidth, swfHeight);
}
// end of script
winPop.document.close();
}