/*************************************************************************** * Automatic Image Popup * Copyright 2003 by David Schontzler | www.stilleye.com * Free to use under GNU General Public License as long as this message * remains intact. * Description: Automate your image popup windows (centered and sized) * Compatibility: Win/IE5+, Mozilla/Netscape, degrades otherwise * URI: http://www.stilleye.com/projects/iPop *************************************************************************** * Version: 2.0 ***************************************************************************/ ///////////////// USER SETTINGS ///////////////// // Absolute path of *this* file on your server. This must be set for the // script to function!!! iPop.ScriptPath = "ipop.js"; // Set the target for browsers that don't support the script. By default, // target is "_self" which will open in the same window as the link. Change // it to whatever target you like. iPop.DegradeTarget = "_blank"; ///////////////// FUNCTIONALITY ///////////////// ///////////////// DO NOT EDIT ///////////////// function ipopup(img, imgTitle) { window.open(img); //iPop(img, imgTitle); } function iPop(img, imgTitle) { // just follow the link in browsers that do not support images or the DOM if(!document.images || !document.getElementById) { // or launch in new window if that's what you wanted it to do switch(iPop.DegradeTarget) { case "_blank" : open(img); break; case "_self" : location = img; break; case "_top" : top.location = img; break; case "_parent" : window.parent.location = img; break; default : open(img, iPop.DegradeTarget); } return true; } // initial (small) window with loading screen var width = 150, height = 100; var left = (screen.availWidth - width)/2, top = (screen.availHeight - height)/ 2; var imgWin = window.open("about:blank", "", "width=" + width + ",height=" + height + ",left=" + left + ",top=" + top); // when moz disables all popups, imgWin will be false if(!imgWin) return true; // user can pass an image title if they wish. by default, // window title will display: "Image (img source)" imgTitle = imgTitle || "Image (" + img + ")"; // html generated for use in our popup // note on the javascript functions: // wrapper functions with timeouts because sometimes the image is loaded // before the script is loaded, at least in Win/IE when doing local testing; // timeout should (presumably) prevent that var html = '