var JaS = {
	// Customization parameters
	imagePath : "http://www.adventurefox.com/images/",
	images : [
		["IMG_2103BNW.JPG", "Barnes and Noble Booksellers Oviedo Marketplace Oviedo Florida", "Barnes and Noble"],
		["IMG_2104BNW.JPG", "Barnes and Noble Booksellers Oviedo Marketplace Oviedo Florida", "Barnes and Noble"], 
		["IMG_2105BNW.JPG", "Barnes and Noble Booksellers Oviedo Marketplace Oviedo Florida", "Barnes and Noble"],
		["IMG_2107BNW.JPG", "Barnes and Noble Booksellers Oviedo Marketplace Oviedo Florida", "Barnes and Noble"],
		["IMG_2108BNW.JPG", "Barnes and Noble Booksellers Oviedo Marketplace Oviedo Florida", "Barnes and Noble"],
		["IMG_2109BNW.JPG", "Barnes and Noble Booksellers Oviedo Marketplace Oviedo Florida", "Barnes and Noble"],					["IMG_2110BNW.JPG", "Barnes and Noble Booksellers Oviedo Marketplace Oviedo Florida", "Barnes and Noble"],
		["IMG_2112BNW.JPG", "Barnes and Noble Booksellers Oviedo Marketplace Oviedo Florida", "Barnes and Noble"],					["IMG_2113BNW.JPG", "Barnes and Noble Booksellers Oviedo Marketplace Oviedo Florida", "Barnes and Noble"],
		["IMG_2114BNW.JPG", "Barnes and Noble Booksellers Oviedo Marketplace Oviedo Florida", "Barnes and Noble"],
		["BarnesAndNoble_Sandlake0.JPG", "Barnes and Noble Booksellers West Sand Lake Road Orlando Florida", "Barnes and Noble"],
		["BarnesAndNoble_Sandlake1.jpg", "Barnes and Noble Booksellers West Sand Lake Road Orlando Florida", "Barnes and Noble"],
		["BarnesAndNoble_Sandlake8.jpg", "Barnes and Noble Booksellers West Sand Lake Road Orlando Florida", "Barnes and Noble"],
		["BarnesAndNoble_Sandlake2.jpg", "Barnes and Noble Booksellers West Sand Lake Road Orlando Florida", "Barnes and Noble"],
		["BarnesAndNoble_Sandlake3.jpg", "Barnes and Noble Booksellers West Sand Lake Road Orlando Florida", "Barnes and Noble"],
		["BarnesAndNoble_Sandlake4.jpg", "Barnes and Noble Booksellers West Sand Lake Road Orlando Florida", "Barnes and Noble"],
		["BarnesAndNoble_Sandlake5.jpg", "Barnes and Noble Booksellers West Sand Lake Road Orlando Florida", "Barnes and Noble"],
		["BarnesAndNoble_Sandlake6.jpg", "Barnes and Noble Booksellers West Sand Lake Road Orlando Florida", "Barnes and Noble"],
		["BarnesAndNoble_Sandlake7.jpg", "Barnes and Noble Booksellers West Sand Lake Road Orlando Florida", "Barnes and Noble"],
		["IMG_1042w.JPG", "Barnes and Noble Booksellers Altamonte Springs Florida", "Barnes and Noble"],		
		["IMG_1043w.JPG", "Barnes and Noble Booksellers Altamonte Springs Florida", "Barnes and Noble"],
		["IMG_1044w.JPG", "Barnes and Noble Booksellers Altamonte Springs Florida", "Barnes and Noble"],
		["IMG_1045w.JPG", "Barnes and Noble Booksellers Altamonte Springs Florida", "Barnes and Noble"],
		["IMG_1047w.JPG", "Barnes and Noble Booksellers Altamonte Springs Florida", "Barnes and Noble"],
		["BarnesAndNoble01.jpg", "Barnes and Noble Booksellers Altamonte Springs Florida", "Barnes and Noble"],
		["BarnesAndNoble02.jpg", "Barnes and Noble Booksellers Altamonte Springs Florida", "Barnes and Noble"],
		["BarnesAndNoble04.jpg", "Barnes and Noble Booksellers Altamonte Springs Florida", "Barnes and Noble"], 
		["IMG_0768_1.jpg", "Barnes and Noble Booksellers Altamonte Springs Florida", "Barnes and Noble"],
		["IMG_0770_1.jpg", "Barnes and Noble Booksellers Altamonte Springs Florida", "Barnes and Noble"],
		["IMG_0771_1.jpg", "Barnes and Noble Booksellers Altamonte Springs Florida", "Barnes and Noble"],
		["IMG_0772_1.jpg", "Barnes and Noble Booksellers Altamonte Springs Florida", "Barnes and Noble"],
		["IMG_0773_1.jpg", "Barnes and Noble Booksellers Altamonte Springs Florida", "Barnes and Noble"],
		["IMG_0774_1.jpg", "Barnes and Noble Booksellers Altamonte Springs Florida", "Barnes and Noble"],
		["IMG_0775_1.jpg", "Barnes and Noble Booksellers Altamonte Springs Florida", "Barnes and Noble"],
		["IMG_0776_1.jpg", "Barnes and Noble Booksellers Altamonte Springs Florida", "Barnes and Noble"],
		["BookFair02_05062006.jpg", "Barnes and Noble Booksellers Altamonte Springs Florida", "Barnes and Noble"],
		["BookFair_05062006.jpg", "Barnes and Noble Booksellers Altamonte Springs Florida", "Barnes and Noble"],
		["BookFair1_05062006.jpg", "Barnes and Noble Booksellers Altamonte Springs Florida", "Barnes and Noble"],
		["may06_125.jpg", "Barnes and Noble Booksellers Altamonte Springs Florida", "Barnes and Noble"],
		["BarnesNobleOviedo_1.JPG", "Barnes and Noble Booksellers Oviedo, Florida", "Barnes and Noble"],
		["BarnesNobleOviedo_2.jpg", "Barnes and Noble Booksellers Oviedo, Florida", "Barnes and Noble"],
		["borders0.bmp", "Oviedo Florida", " Borders    Books"],
		["borders1.bmp", " Florida", "Borders    Books"],
		["MiamiBookFestival1.JPG", "Miami Book Fair International Miami Florida", "Miami  Book Fair"],
		["MiamiBookFestival2.JPG", "Miami Book Fair International Miami Florida", "Miami  Book Fair"],
		["MiamiBookFestival3.JPG", "Miami Book Fair International Miami Florida", "Miami  Book Fair"],
		["MiamiBookFestival4.JPG", "Miami Book Fair International Miami Florida", "Miami  Book Fair"],
		["MiamiBookFestival5.JPG", "Miami Book Fair International Miami Florida", "Miami  Book Fair"],
		["MiamiBookFestival6.JPG", "Miami Book Fair International Miami Florida", "Miami  Book Fair"],
		["MiamiBookFestival7.JPG", "Miami Book Fair International Miami Florida", "Miami  Book Fair"],
		["MiamiBookFestival8.JPG", "Miami Book Fair International Miami Florida", "Miami  Book Fair"],
		["MiamiBookFestival9.JPG", "Miami Book Fair International Miami Florida", "Miami  Book Fair"],
		["MiamiBookFestival10.JPG", "Miami Book Fair International Miami Florida", "Miami  Book Fair"],
		["MiamiBookFestival91.JPG", "Miami Book Fair International Miami Florida", "Miami  Book Fair"],
		["MiamiBookFestival91_1.JPG", "Miami Book Fair International Miami Florida", "Miami  Book Fair"],
		["MiamiBookFestival91_2.JPG", "Miami Book Fair International Miami Florida", "Miami  Book Fair"],		
		["MiamiBookFestival91_3.JPG", "Miami Book Fair International Miami Florida", "Miami  Book Fair"],
		["MiamiBookFestival92.JPG", "Miami Book Fair International Miami Florida", "Miami  Book Fair"],
		["MiamiBookFestival93.JPG", "Miami Book Fair International Miami Florida", "Miami  Book Fair"],
		["MiamiBookFestival94.JPG", "Miami Book Fair International Miami Florida", "Miami  Book Fair"],
		["MiamiBookFestival95.JPG", "Miami Book Fair International Miami Florida", "Miami  Book Fair"],
		["MiamiBookFestival96.JPG", "Miami Book Fair International Miami Florida", "Miami  Book Fair"],
		["MiamiBookFestival97.JPG", "Miami Book Fair International Miami Florida", "Miami  Book Fair"], 
		["MiamiBookFestival98.JPG", "Miami Book Fair International Miami Florida", "Miami  Book Fair"],
		["MiamiBookFestival99.JPG", "Miami Book Fair International Miami Florida", "Miami  Book Fair"],
		["MiamiBookFestival100.JPG", "Miami Book Fair International Miami Florida", "Miami  Book Fair"],
		["RBSC04.jpg", "Roget's Fine Wine and Beer Oviedo Florida", "Roget's Fine Wine"],
		["RBSC06.jpg", "Roget's Fine Wine and Beer Oviedo Florida", "Roget's Fine Wine"],
		["RBSC07.jpg", "Roget's Fine Wine and Beer Oviedo Florida", "Roget's Fine Wine"],
		["RBSC09.jpg", "Roget's Fine Wine and Beer Oviedo Florida", "Roget's Fine Wine"],
		["RBSC001.jpg", "Roget's Fine Wine and Beer Oviedo Florida", "Roget's Fine Wine"],
		["me_me.jpg", "Roget's Fine Wine and Beer Oviedo Florida", "Roget's Fine Wine"],
		["Outside_me.jpg", "Roget's Fine Wine and Beer Oviedo Florida", "Roget's Fine Wine"],
		["RBSC08.jpg", "Roget's Fine Wine and Beer Oviedo Florida", "Roget's Fine Wine"],
		["RBSC03.jpg", "Roget's Fine Wine and Beer Oviedo Florida", "Roget's Fine Wine"],
		["RBSC05.jpg", "Roget's Fine Wine and Beer Oviedo Florida", "Roget's Fine Wine"],
		["RBSC02.jpg", "Roget's Fine Wine and Beer Oviedo Florida", "Roget's Fine Wine"],
		["IMG_1461web.JPG", "Waldenbooks Mall of Millenia Orlando Florida", "Waldenbooks"],		
		["IMG_1462web.JPG", "Waldenbooks Mall of Millenia Orlando Florida", "Waldenbooks"],
		["IMG_1463web.JPG", "Waldenbooks Mall of Millenia Orlando Florida", "Waldenbooks"],
		["IMG_1464web.JPG", "Waldenbooks Mall of Millenia Orlando Florida", "Waldenbooks"],
		["IMG_1465web.JPG", "Waldenbooks Mall of Millenia Orlando Florida", "Waldenbooks"],
		["IMG_1466web.JPG", "Waldenbooks Mall of Millenia Orlando Florida", "Waldenbooks"],
		["IMG_1467web.JPG", "Waldenbooks Mall of Millenia Orlando Florida", "Waldenbooks"],
		["IMG_1468web.JPG", "Waldenbooks Mall of Millenia Orlando Florida", "Waldenbooks"], 
// Separate multiple tags by a comma
		["IMG_1469web.JPG", "Waldenbooks Mall of Millenia Orlando Florida", "Waldenbooks"],
		["IMG_1470web.JPG", "Waldenbooks Mall of Millenia Orlando Florida", "Waldenbooks"],
		["IMG_1471web.JPG", "Waldenbooks Mall of Millenia Orlando Florida", "Waldenbooks"],
		["IMG_1472web.JPG", "Waldenbooks Mall of Millenia Orlando Florida", "Waldenbooks"],
		["IMG_1473web.JPG", "Waldenbooks Mall of Millenia Orlando Florida", "Waldenbooks"],
		["IMG_1474web.JPG", "Waldenbooks Mall of Millenia Orlando Florida", "Waldenbooks"],
		["IMG_1475web.JPG", "Waldenbooks Mall of Millenia Orlando Florida", "Waldenbooks"],
		["IMG_1476web.JPG", "Waldenbooks Mall of Millenia Orlando Florida", "Waldenbooks"],
		["IMG_1477web.JPG", "Waldenbooks Mall of Millenia Orlando Florida", "Waldenbooks"],
		["IMG_1478web.JPG", "Waldenbooks Mall of Millenia Orlando Florida", "Waldenbooks"],
		["IMG_1479web.JPG", "Waldenbooks Mall of Millenia Orlando Florida", "Waldenbooks"],
		["IMG_1480web.JPG", "Waldenbooks Mall of Millenia Orlando Florida", "Waldenbooks"],
		["IMG_1490w.JPG", "Waldenbooks West Shore Plaza Tampa Florida", "Waldenbooks"],		
		["IMG_1491w.JPG", "Waldenbooks West Shore Plaza Tampa Florida", "Waldenbooks"],
		["IMG_1494w.JPG", "Waldenbooks West Shore Plaza Tampa Florida", "Waldenbooks"],
		["IMG_1495w.JPG", "Waldenbooks West Shore Plaza Tampa Florida", "Waldenbooks"],
		["IMG_1496w.JPG", "Waldenbooks West Shore Plaza Tampa Florida", "Waldenbooks"],
		["IMG_1497w.JPG", "Waldenbooks West Shore Plaza Tampa Florida", "Waldenbooks"],
		["IMG_1498w.JPG", "Waldenbooks West Shore Plaza Tampa Florida", "Waldenbooks"],
		["IMG_1500w.JPG", "Waldenbooks West Shore Plaza Tampa Florida", "Waldenbooks"], 
		["IMG_1501w.JPG", "Waldenbooks West Shore Plaza Tampa Florida", "Waldenbooks"],
		["IMG_1502w.JPG", "Waldenbooks West Shore Plaza Tampa Florida", "Waldenbooks"],
		["IMG_1505w.JPG", "Waldenbooks West Shore Plaza Tampa Florida", "Waldenbooks"],
		["IMG_1508w.JPG", "Waldenbooks West Shore Plaza Tampa Florida", "Waldenbooks"],
		["IMG_1513w.JPG", "Waldenbooks West Shore Plaza Tampa Florida", "Waldenbooks"],
		["IMG_1514w.JPG", "Waldenbooks West Shore Plaza Tampa Florida", "Waldenbooks"],
		["IMG_1511w.JPG", "Waldenbooks West Shore Plaza Tampa Florida", "Waldenbooks"],
		["IMG_1504w.JPG", "Waldenbooks West Shore Plaza Tampa Florida", "Waldenbooks"],
		["IMG_1512w.JPG", "Waldenbooks West Shore Plaza Tampa Florida", "Waldenbooks"],
		["IMG_1493w.JPG", "Waldenbooks West Shore Plaza Tampa Florida", "Waldenbooks"],
		["IMG_1418_web.JPG", "Waldenbooks Volusia Mall Daytona Florida", "Waldenbooks"],
		["IMG_1419_web.JPG", "Waldenbooks Volusia Mall Daytona Florida", "Waldenbooks"],
		["IMG_1421_web.JPG", "Waldenbooks Volusia Mall Daytona Florida", "Waldenbooks"],
		["IMG_1422_web.JPG", "Waldenbooks Volusia Mall Daytona Florida", "Waldenbooks"],
		["IMG_1423_web.JPG", "Waldenbooks Volusia Mall Daytona Florida", "Waldenbooks"],
		["IMG_1424_web.JPG", "Waldenbooks Volusia Mall Daytona Florida", "Waldenbooks"], 
		["IMG_1425_web.JPG", "Waldenbooks Volusia Mall Daytona Florida", "Waldenbooks"],
		["IMG_1426_web.JPG", "Waldenbooks Volusia Mall Daytona Florida", "Waldenbooks"],
		["waldenbooks1.jpg", "Waldenbooks Volusia Mall Daytona Florida", "Waldenbooks"],
		["waldenbooks2.jpg", "Waldenbooks Volusia Mall Daytona Florida", "Waldenbooks"],
		["waldenbooks3.jpg", "Waldenbooks Volusia Mall Daytona Florida", "Waldenbooks"],
		["waldenbooks4.jpg", "Waldenbooks Volusia Mall Daytona Florida", "Waldenbooks"],
		["waldenbooks5.jpg", "Waldenbooks Volusia Mall Daytona Florida", "Waldenbooks"],
		["waldenbooks6.jpg", "Waldenbooks Volusia Mall Daytona Florida", "Waldenbooks"],
		["waldenbooks7.jpg", "Waldenbooks Volusia Mall Daytona Florida", "Waldenbooks"],
		["waldenbooks8.jpg", "Waldenbooks Volusia Mall Daytona Florida", "Waldenbooks"],
		["waldenbooks_slr1.jpg", "Waldenbooks Mall Orlando, Florida", "Waldenbooks"],
		["waldenbooks_slr2.jpg", "Waldenbooks Mall Orlando, Florida", "Waldenbooks"],
		["waldenbooks_slr3.jpg", "Waldenbooks Mall Orlando, Florida", "Waldenbooks"],
		["waldenbooks_slr4.jpg", "Waldenbooks Mall Orlando, Florida", "Waldenbooks"],
		["waldenbooks_slr5.jpg", "Waldenbooks Mall Orlando, Florida", "Waldenbooks"],
		["waldenbooks_slr6.jpg", "Waldenbooks Mall Orlando, Florida", "Waldenbooks"], 
		["waldenbooks_slr7.jpg", "Waldenbooks Mall Orlando, Florida", "Waldenbooks"],
		["waldenbooks_slr8.jpg", "Waldenbooks Mall Orlando, Florida", "Waldenbooks"],
		["waldenbooks_slr9.jpg", "Waldenbooks Mall Orlando, Florida", "Waldenbooks"],
		["waldenbooks_slr10.jpg", "Waldenbooks Mall Orlando, Florida", "Waldenbooks"],
		["waldenbooks_slr11.jpg", "Waldenbooks Mall Orlando, Florida", "Waldenbooks"],
		["waldenbooks_slr12.jpg", "Waldenbooks Mall Orlando, Florida", "Waldenbooks"],
		["waldenbooks_slr13.jpg", "Waldenbooks Mall Orlando, Florida", "Waldenbooks"],
		["waldenbooks_slr14.jpg", "Waldenbooks Mall Orlando, Florida", "Waldenbooks"],
		["waldenbooks_slr15.jpg", "Waldenbooks Mall Orlando, Florida", "Waldenbooks"],
		["waldenbooks_slr16.jpg", "Waldenbooks Mall Orlando, Florida", "Waldenbooks"],
		["IMG_1433s.JPG", "Assorted SnapShot Around Florida", "Assorted SnapShot"],
		["IMG_1435s.JPG", "Assorted SnapShot Around Florida", "Assorted SnapShot"],
		["IMG_1437s.JPG", "Assorted SnapShot Around Florida", "Assorted SnapShot"],
		["IMG_1441s.JPG", "Assorted SnapShot Around Florida", "Assorted SnapShot"],
		["IMG_1440s.JPG", "Assorted SnapShot Around Florida", "Assorted SnapShot"],
		["MaryJoeMe1.jpg", "Assorted SnapShot Around Florida", "Assorted SnapShot"],
		["Joe1.jpg", "Assorted SnapShot Around Florida", "Assorted SnapShot"],
		["MeK.jpg", "Assorted SnapShot Around Florida", "Assorted SnapShot"],
		["_938.jpeg", "Assorted SnapShot Around Florida", "Assorted SnapShot"],
		["MarlinAtLibrary.jpg", "Assorted SnapShot Around Florida", "Assorted SnapShot"],
		["WinterWonderland_11_web.jpg", "Assorted SnapShot Around Florida", "Assorted SnapShot"],
		["WinterWonderland_12_web.jpg", "Assorted SnapShot Around Florida", "Assorted SnapShot"],
		["WinterWonderland_13_web.jpg", "Assorted SnapShot Around Florida", "Assorted SnapShot"],		
		["WinterWonderland_14_web.jpg", "Assorted SnapShot Around Florida", "Assorted SnapShot"],
		["WinterWonderland_15_web.jpg", "Assorted SnapShot Around Florida", "Assorted SnapShot"],
		["IMG_1460_3.JPG", "Assorted SnapShot Around Florida", "Assorted SnapShot"],
		["bookfair069.jpg", "Assorted SnapShot Around Florida", "Assorted SnapShot"],
		["IMG_1434_web.JPG", "Assorted SnapShot Around Florida", "Assorted SnapShot"],
                                    ["awardphoto1.jpg", "Florida Publisher Association Best Children's Fiction Award 2006", "Award Snap Shots"],		
		["presidentaward1.jpg", "Florida Publisher Association Group Award 2006", "Award Snap Shots"],
		["awardphoto2.jpg", "Florida Publisher Association Award 2006", "Award Snap Shots"],
		["awardphoto3.jpg", "Florida Publisher Association Award 2006", "Award Snap Shots"],
		["IMG_1594a.JPG", "Florida Publisher Association Award 2006 Plaque", "Award Snap Shots"],
		["IMG_1592a.JPG", "USA BOOKNEWS.COM BEST BOOK AWARD 2005", "Award Snap Shots"],
		["IMG_1597a.JPG", "CITY OF ORLANDO AWARD OF MERIT 2006", "Award Snap Shots"],
		["IMG_1857_Award2007_S_web.JPG", "Florida Publisher Association Best Juvenile Fiction Award 2007", "Award Snap Shots"],
		["IMG_1853_Award2007_web.JPG", "Florida Publisher Association Award  Plaques 2007", "Award Snap Shots"],
		["IMG_1859_Award2007_S_web.JPG", "Florida Publisher Association OVERALL BOOK Award 2007", "Award Snap Shots"]	
	],
	fadeContainerId : "jas-container",
	imageContainerId : "jas-image",
	imageTextContainerId : "jas-image-text",
	previousLinkId : "previous-image",
	nextLinkId : "next-image",
	imageCounterId : "image-counter",
	startSlideShowId : "start-slideshow",
	stopSlideShowId : "stop-slideshow",
	thumbnailContainerId: "jas-thumbnails",
	tagsContainerId: "jas-tags",
	tagsSelectAllId: "jas-select-all-tags",
	useImageText : true,
	useThumbnails : true,
	useTags : true,
	useKeyboardShortcuts : true,
	useFadingIn : true,
	useFadingOut : true,
	useFadeWhenNotSlideshow : false,
	useFadeForSlideshow : true,
	useFadeAtInitialLoad : false,
	fadeIncrement : 0.1,
	fadeInterval : 100, // Milliseconds
	timeForSlideInSlideshow : 1500, // Milliseconds

	// JaS function parameters
	allImages : null,
	currentImages : null,
	fadeContainer : null,
	imageContainer : null,
	imageTextContainer : null,
	previousLink : null,
	nextLink : null,
	imageCounter : null,
	startSlideShowLink : null,
	stopSlideShowLink : null,
	thumbnailContainer : null,
	thumbnailCollection : [],
	currentThumbnailSelected : null,
	tagsContainer : null,
	tagsSelectAll : null,
	tagsList : null,
	tags : [],
	tagsCheckboxes : [],
	selectAllTags : true,
	imageText : null,
	imageText : "",
	imageSource : "",
	imageIndex : 0,
	fadingIn : true,
	fadeLevel : 0,
	fadeEndLevel : 1,
	fadeTimer : null,
	hasOpacitySupport : false,
	useMSFilter : false,
	useMSCurrentStyle : false,
	slideshowIsSupported : false,
	slideshowIsPlaying : false,
	functionAfterFade : null,
	isInitialLoad : false,

	init : function (){
    	if(document.getElementById){
			this.fadeContainer = document.getElementById(this.fadeContainerId);
			this.imageContainer = document.getElementById(this.imageContainerId);
			this.slideshowIsSupported = this.fadeContainer && this.imageContainer;
			if(this.slideshowIsSupported){
				this.allImages = this.images;
				this.currentImages = this.images;
				if(this.useImageText){
					this.imageTextContainer = document.getElementById(this.imageTextContainerId);
					if(!this.imageTextContainer){
						this.useImageText = false;
					}
				}
				this.hasOpacitySupport = typeof this.fadeContainer.style.filter != "undefined" || typeof this.fadeContainer.style.opacity != "undefined";
				this.useMSFilter = typeof this.fadeContainer.style.filter != "undefined";
				this.useMSCurrentStyle = typeof this.fadeContainer.currentStyle != "undefined";

				this.previousLink = document.getElementById(this.previousLinkId);
				this.previousLink.onclick = function(oEvent){
					var oEvent = (typeof oEvent != "undefined")? oEvent : event;
					JaS.preventDefaultEventBehavior(oEvent);
					JaS.previousImage();
				};
				this.nextLink = document.getElementById(this.nextLinkId);
				this.nextLink.onclick = function(oEvent){
					var oEvent = (typeof oEvent != "undefined")? oEvent : event;
					JaS.preventDefaultEventBehavior(oEvent);
					JaS.nextImage();
				};
				this.imageCounter = document.getElementById(this.imageCounterId);
				this.startSlideShowLink = document.getElementById(this.startSlideShowId);
				if(this.startSlideShowLink){
					this.startSlideShowLink.style.display = "inline";
				}
				this.startSlideShowLink.onclick = function(oEvent){
					var oEvent = (typeof oEvent != "undefined")? oEvent : event;
					JaS.preventDefaultEventBehavior(oEvent);
					JaS.startSlideshow();
				};
				this.stopSlideShowLink = document.getElementById(this.stopSlideShowId);
				if(this.stopSlideShowLink){
					this.stopSlideShowLink.style.display = "none";
				}
				this.stopSlideShowLink.onclick = function(oEvent){
					var oEvent = (typeof oEvent != "undefined")? oEvent : event;
					JaS.preventDefaultEventBehavior(oEvent);
					JaS.stopSlideshow();
				};

				if(this.useKeyboardShortcuts){
					document.onkeydown = function(oEvent){
						var oEvent = (typeof oEvent != "undefined")? oEvent : event;
						JaS.applyKeyboardNavigation(oEvent);
					};
				}

				this.thumbnailContainer = document.getElementById(this.thumbnailContainerId);
				if(this.useThumbnails && this.thumbnailContainer){
					this.createThumbnails();
				}

				this.tagsContainer = document.getElementById(this.tagsContainerId);
				if(this.useTags && this.tagsContainer){
					this.tagsSelectAll = document.getElementById(this.tagsSelectAllId);
					if(this.tagsSelectAll){
						this.tagsSelectAll.onclick = function (oEvent){
							JaS.tagsSelectAll = this.checked;
							JaS.markAllTags();
						};
						this.createTagList();
					}
				}

				this.isInitialLoad = true;
				this.setImage();
				this.isInitialLoad = false;
			}
		}
	},

	setImage : function (){
		if(this.currentImages.length > 0){
			this.imageContainer.style.visibility = "visible";
			this.imageSource = this.currentImages[this.imageIndex][0];
			this.imageText = this.currentImages[this.imageIndex][1];
			if(this.useFadingOut && (this.slideshowIsPlaying && this.useFadeForSlideshow) || (!this.slideshowIsPlaying && this.useFadeWhenNotSlideshow) && (this.useFadeAtInitialLoad && this.isInitialLoad || !this.isInitialLoad)){
				this.fadeOut();
			}
			else{
				this.displayImageCount();
				this.imageContainer.setAttribute("src", (this.imagePath + this.imageSource));
				this.setImageText();
				this.previousLink.style.visibility = (this.imageIndex > 0)? "visible" : "hidden";
				this.nextLink.style.visibility = (this.imageIndex < (this.currentImages.length - 1))? "visible" : "hidden";
				if((this.useFadeAtInitialLoad && this.isInitialLoad || !this.isInitialLoad) && ((this.slideshowIsPlaying && this.useFadeForSlideshow) || (!this.slideshowIsPlaying && this.useFadeWhenNotSlideshow))){
					this.fadeIn();
				}
			}
			if(this.useThumbnails){
				this.markCurrentThumbnail();
			}
		}
		else{
			this.imageSource = "";
			this.imageText = "";
			this.displayImageCount();
			this.imageContainer.style.visibility = "hidden";
			this.setImageText();
		}
	},

	displayImageCount : function (){
    	if(this.imageCounter){
			this.imageCounter.innerHTML = (((this.currentImages.length > 0)? this.imageIndex : -1) + 1) + " / " + this.currentImages.length;
		}
	},

	nextImage : function (){
		if(this.imageIndex < (this.currentImages.length - 1)){
			++this.imageIndex;
			this.setImage();
		}
		else if(this.slideshowIsPlaying){
			this.stopSlideshow();
			this.imageIndex = 0;
			this.setImage();
		}
	},

	previousImage : function (){
		if(this.imageIndex > 0){
			--this.imageIndex;
			this.setImage();
		}
	},

	setImageText : function (){
		this.imageTextContainer.setAttribute("alt", this.imageText);
    	if(this.useImageText && typeof this.imageText == "string"){
			this.imageTextContainer.innerHTML = this.imageText;
		}
	},

	startSlideshow : function (){
		if(this.currentImages.length > 0){
			this.startSlideShowLink.style.display = "none";
			this.stopSlideShowLink.style.display = "inline";
			this.slideshowIsPlaying = true;
			this.fadeTimer = setTimeout("JaS.nextImage()", JaS.timeForSlideInSlideshow);
		}
	},

	stopSlideshow : function (){
		if(this.currentImages.length > 0){
			this.startSlideShowLink.style.display = "inline";
			this.stopSlideShowLink.style.display = "none";
			this.slideshowIsPlaying = false;
			this.setFadeParams(false, 1, 0);
			this.setFade();
			clearTimeout(this.fadeTimer);
		}
	},

	fadeIn : function (){
		this.setFadeParams(true, 0, 1);
		this.functionAfterFade = null;
		this.fade();
		if(this.slideshowIsPlaying){
			this.functionAfterFade = "this.startSlideshow()";
		}
	},

	fadeOut : function (){
		this.setFadeParams(false, 1, 0);
		this.functionAfterFade = "this.fadeOutDone()";
		this.fade();
	},

	fadeOutDone : function (){
        this.displayImageCount();
		this.imageContainer.setAttribute("src", (this.imagePath + this.imageSource));
		this.setImageText();
		if(this.useFadingIn){
			this.fadeIn();
		}
		else{
			this.fadeLevel = 1;
			this.setFade();
		}
	},

	fade : function (){
		if((this.fadingIn && this.fadeLevel < this.fadeEndLevel) || !this.fadingIn && this.fadeLevel > this.fadeEndLevel){
			this.fadeLevel = (this.fadingIn)? this.fadeLevel + this.fadeIncrement : this.fadeLevel - this.fadeIncrement;
			// This line is b/c of a floating point bug in JavaScript
			this.fadeLevel = Math.round(this.fadeLevel * 10) / 10;
			this.setFade();
			this.fadeTimer = setTimeout("JaS.fade()", this.fadeInterval);
		}
		else{
			clearTimeout(this.fadeTimer);
			if(this.functionAfterFade){
				eval(this.functionAfterFade);
			}
		}
	},

	setFade : function (){
		if(this.useMSFilter){
			this.fadeContainer.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=" + (this.fadeLevel * 100) + ")";
		}
		else{
			this.fadeContainer.style.opacity = this.fadeLevel;
		}
	},

	setFadeParams : function (bFadingIn, intStartLevel, intEndLevel){
		this.fadingIn = bFadingIn;
		this.fadeLevel = intStartLevel;
		this.fadeEndLevel = intEndLevel;
	},

	createThumbnails : function (){
		this.thumbnailContainer.innerHTML = "";
		this.thumbnailCollection = [];
    	var oThumbnailsList = document.createElement("ul");
		var oListItem;
		var oThumbnail;
		var oCurrentImage;
		for(var i=0; i<this.currentImages.length; i++){
        	oCurrentImage = this.currentImages[i];
			oListItem = document.createElement("li");
			oThumbnail = document.createElement("img");
			oThumbnail.setAttribute("id", ("jas-thumbnail-" + i));
			oThumbnail.setAttribute("src", (this.imagePath + oCurrentImage[0]));
			oThumbnail.setAttribute("alt", oCurrentImage[1]);
			oThumbnail.setAttribute("title", oCurrentImage[1]);
			oThumbnail.onclick = function (oEvent){
				JaS.imageIndex = parseInt(this.getAttribute("id").replace(/\D*(\d+)$/, "$1"), 10);
				JaS.setImage();
			};
			this.thumbnailCollection.push(oThumbnail);
			oListItem.appendChild(oThumbnail);
			oThumbnailsList.appendChild(oListItem);
        }
		this.thumbnailContainer.appendChild(oThumbnailsList);
		if(this.thumbnailCollection.length > 0){
			this.markCurrentThumbnail();
		}
		if(this.slideshowIsPlaying){
			this.stopSlideshow();
		}
	},

	markCurrentThumbnail : function (){
		if(this.currentThumbnailSelected){
	        this.currentThumbnailSelected.className = "";
			// Sometimes, in IE, the image loses its reference to its parent
			if(this.currentThumbnailSelected.parentNode){
				this.currentThumbnailSelected.parentNode.className = "";
			}
		}
		this.currentThumbnailSelected = this.thumbnailCollection[this.imageIndex];
		this.currentThumbnailSelected.className = "selected";
		this.currentThumbnailSelected.parentNode.className = "selected-parent";
	},

	createTagList : function (){
		var strCurrentTag;
		var arrCurrentTag;
		var oRegExp;
		for(var i=0; i<this.images.length; i++){
			arrCurrentTag = this.images[i][2].replace(/\s*(,)\s*/,  "$1").split(",");
			for(var j=0; j<arrCurrentTag.length; j++){
            	strCurrentTag = arrCurrentTag[j];
				oRegExp = new RegExp(strCurrentTag, "i");
				if(this.tags.toString().search(oRegExp) == -1){
					this.tags.push(strCurrentTag);
				}
            }
        }
		this.tagsList = document.createElement("ul");
		var oListItem;
		var oTagCheckbox;
		var oLabel;
		for(var k=0; k<this.tags.length; k++){
			oTag = this.tags[k];
			oListItem = document.createElement("li");
			oTagCheckbox = document.createElement("input");
			oTagCheckbox.setAttribute("type", "checkbox");
			oTagCheckbox.setAttribute("id", ("jas-" + oTag));
			oTagCheckbox.setAttribute("value", oTag);
			oTagCheckbox.checked = true;
			oTagCheckbox.onclick = function (oEvent){
				JaS.applyTagFilter();
			};
			oLabel = document.createElement("label");
			oLabel.setAttribute("for", ("jas-" + oTag));
			oLabel.innerHTML = oTag;
			this.tagsCheckboxes.push(oTagCheckbox);
			oListItem.appendChild(oTagCheckbox);
			oListItem.appendChild(oLabel);
			this.tagsList.appendChild(oListItem);
		}
		this.tagsContainer.appendChild(this.tagsList);
		// This loop is necessary since IE can only mark checkboxes as checked after they've been added to the document
		for(var l=0; l<this.tagsCheckboxes.length; l++){
			this.tagsCheckboxes[l].checked = true;
		}
	},

	applyTagFilter : function (){
		this.currentImages = [];
		var arrCurrentTags = [];
		var oCheckbox;
		for(var i=0; i<this.tagsCheckboxes.length; i++){
        	oCheckbox = this.tagsCheckboxes[i];
			if(oCheckbox.checked){
				arrCurrentTags.push(oCheckbox.value);
			}
        }
		var oRegExp;
		var oImage;
		for(var j=0; j<this.images.length; j++){
        	oImage = this.images[j];
			for(var k=0; k<arrCurrentTags.length; k++){
				oRegExp = new RegExp(arrCurrentTags[k], "i");
				if(oImage[2].search(oRegExp) != -1){
					this.currentImages.push(oImage);
					break;
				}
			}
        }

		if(this.useThumbnails){
			this.createThumbnails();
		}
		this.imageIndex = 0;
		this.setImage();
	},

	markAllTags : function (){
		for(var i=0; i<this.tagsCheckboxes.length; i++){
			this.tagsCheckboxes[i].checked = this.tagsSelectAll;
        }
		this.applyTagFilter();
	},

	closeSession : function (oEvent){
		JaS = null;
		delete JaS;
	},

	applyKeyboardNavigation : function (oEvent){
    	var intKeyCode = oEvent.keyCode;
    	if(!oEvent.altKey){
			switch(intKeyCode){
				case 32:
					this.slideshowIsPlaying = (this.slideshowIsPlaying)? false : true;
					if(this.slideshowIsPlaying){
						this.startSlideshow();
					}
					else{
						this.stopSlideshow();
					}
					this.preventDefaultEventBehavior(oEvent);
					break;
				case 37:
				case 38:
					this.previousImage();
					this.preventDefaultEventBehavior(oEvent);
					break;
				case 39:
				case 40:
					this.nextImage();
					this.preventDefaultEventBehavior(oEvent);
					break;
			}
		}
	},

	preventDefaultEventBehavior : function (oEvent){
		if(oEvent){
			oEvent.returnValue = false;
			if(oEvent.preventDefault){
				oEvent.preventDefault();
			}
		}
	}
};
// ---
addEvent(window, "load", function(){JaS.init();}, false);
addEvent(window, "unload", function(){JaS.closeSession();}, false);
// ---
// Utility functions
function addEvent(oObject, strEvent, oFunction, bCapture){
	if(oObject){
		if(oObject.addEventListener){
			oObject.addEventListener(strEvent, oFunction, bCapture);
		}
		else if(window.attachEvent){
			oObject.attachEvent(("on" + strEvent), oFunction)
		}
	}
}
// ---
if(typeof Array.prototype.push != "function"){
	Array.prototype.push = ArrayPush;
	function ArrayPush(value){
		this[this.length] = value;
	}
}