{\rtf1\ansi\ansicpg1252\deff0\deflang3082{\fonttbl{\f0\fswiss\fcharset0 Arial;}}
{\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\f0\fs20 // -------------------------------------------------------------------\par
// Image Thumbnail Viewer II- By Dynamic Drive, available at: http://www.dynamicdrive.com\par
// Last updated: Feb 5th, 2007\par
// -------------------------------------------------------------------\par
\par
var thumbnailviewer2=\{\par
enableTitle: true, //Should "title" attribute of link be used as description?\par
enableTransition: true, //Enable fading transition in IE?\par
hideimgmouseout: false, //Hide enlarged image when mouse moves out of anchor link? (if enlarged image is hyperlinked, always set to false!)\par
\par
/////////////No need to edit beyond here/////////////////////////\par
\par
iefilterstring: 'progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.7)', //IE specific multimedia filter string\par
iefiltercapable: document.compatMode && window.createPopup? true : false, //Detect browser support for IE filters\par
preloadedimages:[], //array to preload enlarged images (ones set to display "onmouseover"\par
targetlinks:[], //array to hold participating links (those with rel="enlargeimage:initType")\par
alreadyrunflag: false, //flag to indicate whether init() function has been run already come window.onload\par
\par
loadimage:function(linkobj)\{\par
var imagepath=linkobj.getAttribute("href") //Get URL to enlarged image\par
var showcontainer=document.getElementById(linkobj.getAttribute("rev").split("::")[0]) //Reference container on page to show enlarged image in\par
var dest=linkobj.getAttribute("rev").split("::")[1] //Get URL enlarged image should be linked to, if any\par
var description=(thumbnailviewer2.enableTitle && linkobj.getAttribute("title"))? linkobj.getAttribute("title") : "" //Get title attr\par
var imageHTML='<img src="'+imagepath+'" style="border-width: 0" />' //Construct HTML for enlarged image\par
if (typeof dest!="undefined") //Hyperlink the enlarged image?\par
imageHTML='<a href="'+dest+'">'+imageHTML+'</a>'\par
if (description!="") //Use title attr of the link as description?\par
imageHTML+='<br />'+description\par
if (this.iefiltercapable)\{ //Is this an IE browser that supports filters?\par
showcontainer.style.filter=this.iefilterstring\par
showcontainer.filters[0].Apply()\par
\}\par
showcontainer.innerHTML=imageHTML\par
this.featureImage=showcontainer.getElementsByTagName("img")[0] //Reference enlarged image itself\par
this.featureImage.onload=function()\{ //When enlarged image has completely loaded\par
if (thumbnailviewer2.iefiltercapable) //Is this an IE browser that supports filters?\par
showcontainer.filters[0].Play()\par
\}\par
this.featureImage.onerror=function()\{ //If an error has occurred while loading the image to show\par
if (thumbnailviewer2.iefiltercapable) //Is this an IE browser that supports filters?\par
showcontainer.filters[0].Stop()\par
\}\par
\},\par
\par
hideimage:function(linkobj)\{\par
var showcontainer=document.getElementById(linkobj.getAttribute("rev").split("::")[0]) //Reference container on page to show enlarged image in\par
showcontainer.innerHTML=""\par
\},\par
\par
\par
cleanup:function()\{ //Clean up routine on page unload\par
if (this.featureImage)\{this.featureImage.onload=null; this.featureImage.onerror=null; this.featureImage=null\}\par
this.showcontainer=null\par
for (var i=0; i<this.targetlinks.length; i++)\{\par
this.targetlinks[i].onclick=null\par
this.targetlinks[i].onmouseover=null\par
this.targetlinks[i].onmouseout=null\par
\}\par
\},\par
\par
addEvent:function(target, functionref, tasktype)\{ //assign a function to execute to an event handler (ie: onunload)\par
var tasktype=(window.addEventListener)? tasktype : "on"+tasktype\par
if (target.addEventListener)\par
target.addEventListener(tasktype, functionref, false)\par
else if (target.attachEvent)\par
target.attachEvent(tasktype, functionref)\par
\},\par
\par
init:function()\{ //Initialize thumbnail viewer script\par
this.iefiltercapable=(this.iefiltercapable && this.enableTransition) //True or false: IE filters supported and is enabled by user\par
var pagelinks=document.getElementsByTagName("a")\par
for (var i=0; i<pagelinks.length; i++)\{ //BEGIN FOR LOOP\par
if (pagelinks[i].getAttribute("rel") && /enlargeimage:/i.test(pagelinks[i].getAttribute("rel")))\{ //Begin if statement: Test for rel="enlargeimage"\par
var initType=pagelinks[i].getAttribute("rel").split("::")[1] //Get display type of enlarged image ("click" or "mouseover")\par
if (initType=="mouseover")\{ //If type is "mouseover", preload the enlarged image for quicker display\par
this.preloadedimages[this.preloadedimages.length]=new Image()\par
this.preloadedimages[this.preloadedimages.length-1].src=pagelinks[i].href\par
pagelinks[i]["onclick"]=function()\{ //Cancel default click action\par
return false\par
\}\par
\}\par
pagelinks[i]["on"+initType]=function()\{ //Load enlarged image based on the specified display type (event)\par
thumbnailviewer2.loadimage(this) //Load image\par
return false\par
\}\par
if (this.hideimgmouseout)\par
pagelinks[i]["onmouseout"]=function()\{\par
thumbnailviewer2.hideimage(this)\par
\}\par
this.targetlinks[this.targetlinks.length]=pagelinks[i] //store reference to target link\par
\} //end if statement\par
\} //END FOR LOOP\par
\par
\par
\} //END init() function\par
\par
\}\par
\par
\par
if (document.addEventListener) //Take advantage of "DOMContentLoaded" event in select Mozilla/ Opera browsers for faster init\par
thumbnailviewer2.addEvent(document, function()\{thumbnailviewer2.alreadyrunflag=1; thumbnailviewer2.init()\}, "DOMContentLoaded") //Initialize script on page load\par
else if (document.all && document.getElementsByTagName("a").length>0)\{ //Take advantage of "defer" attr inside SCRIPT tag in IE for instant init\par
thumbnailviewer2.alreadyrunflag=1\par
thumbnailviewer2.init()\par
\}\par
thumbnailviewer2.addEvent(window, function()\{if (!thumbnailviewer2.alreadyrunflag) thumbnailviewer2.init()\}, "load") //Default init method: window.onload\par
thumbnailviewer2.addEvent(window, function()\{thumbnailviewer2.cleanup()\}, "unload")\par
}
 