//-- Begin graphic rollover functions --

// Function to 'activate' images.
	function imgOn(imgName) {
	   if (document.images) {
	      document[imgName].src = eval(imgName + "on.src");
	   }
	}

// Function to 'deactivate' images.
	function imgOff(imgName) {
	   if (document.images) {
	      document[imgName].src = eval(imgName + "off.src");
	   }
	}

//-- End graphic rollover functions --


// Function to cycle slideshow images.
	var slideShowSpeed = 3000 // Set slideShowSpeed (milliseconds)
	var crossFadeDuration = 3 // Duration of crossfade (seconds)
	var p = 39 // Set last image number

	var preLoad = new Image() // Set up variable for preloading each image as slideshow plays
	preLoad.src = "images/slideshow/01.jpg" // Set variable to first image in slideshow

	var t // Throwaway variable for setTimeout function
	var j = 1 // Index variable for slideshow cycling slideshow images

	function runSlideShow(){
		if (document.all){
			document.images.SlideShow.style.filter="blendTrans(duration=2)"
			document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
			document.images.SlideShow.filters.blendTrans.Apply()      
		}
		document.images.SlideShow.src = preLoad.src
		if (document.all){
			document.images.SlideShow.filters.blendTrans.Play()
		}
		j = j + 1
		if (j > p) j=1
		if (j < 10) preLoad.src = eval("'images/slideshow/0" + j + ".jpg'") // Account for leading zeros in filenames
			else preLoad.src = eval("'images/slideshow/" + j + ".jpg'")
		t = setTimeout('runSlideShow()', slideShowSpeed)
	}


//  Function to open image window.
	function newWindow(artInfo) {
		artBig=new Image(); //These two lines convert the image name to an accessible image object.
		artBig.src = "images/artwork/artworkBig/"+artInfo[0]+".jpg"
		
		artWindow=window.open('', 'artWin', 'width=640,height=665'); //Open new window sized to image.
		artWindow.focus()
		
		artWindow.document.write("<html><head><title>Escent Gallery Artwork<\/title><\/head>")
		artWindow.document.write("<body topmargin='0' leftmargin='0' rightmargin='0' bottommargin='0' bgcolor='#420101'>")
		artWindow.document.write("<p style='text-align:center; font:normal 10pt Arial; top-margin:0; bottom-margin:0; color:white'>")
		artWindow.document.write("<img style='bottom-margin:7' border='0' src="+artBig.src+"><br>")
		artWindow.document.write("\""+artInfo[1]+"\"&nbsp;&nbsp;&nbsp;&nbsp;"+artInfo[2]+"&nbsp;&nbsp;&nbsp;&nbsp;"+artInfo[3]+"&nbsp;&nbsp;&nbsp;&nbsp;"+artInfo[4]+"<\/p>")
		artWindow.document.write("<\/body><\/html>")
	}
	
//  Function to open image window for Gallery Tour.
	function enlargePic(picSource) {
		bigPic=new Image(); //These two lines convert the image name to an accessible image object.
		bigPic.src = picSource
		
		bigPicWindow=window.open('', 'bigPic', 'width=800,height=536'); //Open new window sized to image.
		bigPicWindow.focus()
		
		bigPicWindow.document.write("<html><head><title='Escent Gallery Tour'><\/head>")
		bigPicWindow.document.write("<body topmargin='0' leftmargin='0' rightmargin='0' bottommargin='0' bgcolor='#420101' align='center' valign='center'>")
		bigPicWindow.document.write("<p style='text-align:center; font:normal 10pt Arial; top-margin:0; bottom-margin:0; color:white'>")
		bigPicWindow.document.write("<img border='0' src="+bigPic.src+" align='center' valign='center'><\/p>")
		bigPicWindow.document.write("<\/body><\/html>")
	}