<!--
// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this header
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully

// =======================================
// set the following variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 4000

// Duration of crossfade (seconds)
var crossFadeDuration = 1

// Specify the image files
// =======================================
// Duplicate This Part For New Slice

var Pic = new Array()
var t
var j= 0
var p = Pic.length
var preLoad = new Array()

var pauseImg
var playImg

for (i = 0; i < p; i++)
{
	preLoad[i] = new Image()
	preLoad[i].src = Pic[i]
}

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[j].src
	if (document.all){
		document.images.SlideShow.filters.blendTrans.Play()
	}
	j = j + 1
	if (j > (p-1)) j=0
	t = setTimeout('runSlideShow()', slideShowSpeed)
}

function setSlideShow(thisIndex){
	clearTimeout(t);
	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()
	}
	j = thisIndex
	document.images.SlideShow.src = preLoad[j].src
	if (document.all){
		document.images.SlideShow.filters.blendTrans.Play()
	}
	j = j + 1
	if (j > (p-1)) j=0
	t = setTimeout('runSlideShow()', slideShowSpeed*2)
}

var paused = 0

function TogglePause() {
	if (paused==0) {
		clearTimeout(t);
		paused=1;
		document.getElementById('pauseplay').innerHTML = "Play Slideshow";
	}
	else
	{
		runSlideShow();
		paused=0;
		document.getElementById('pauseplay').innerHTML = "Pause Slideshow";
	}
}

function doSlideShow() {

    document.write('<img border=0 src="http://www.paintingwithlight.co.nz/Photoshoots/Danni/DSCF4994.jpg" alt="' + alttext + '" id="SlideShow">')
    document.write('<SCRIPT type="text/javascript">runSlideShow();</SCRIPT>')
}


function writePauseButton() {
    document.write('<div id="pauseplay" onclick="TogglePause()">Pause Slideshow</div>')
}

function writethumbs() {
	document.write('<table><tr>')
	for (i = 0; i < p; i++)
	{
		document.write('<td class="framed"><img width=80 align=middle src="')
		document.write(Pic[i])
		document.write('" onclick="setSlideShow(' + i +')"></td>')
		if ((i+1<p) && (((i+1) % 3) == 0.0)) {
			document.write('</tr><tr>')
		}
		
	}
	document.write('</table>')
}

var increment
var before 
var after


function StartScrollIn() {
	
ScrollIn()
}

function ScrollIn() {
	
	before = document.getElementById('picframe').scrollLeft 
	
	document.getElementById('picframe').scrollLeft += 5;
	
	after = document.getElementById('picframe').scrollLeft 

	if ( (document.getElementById('picframe').scrollLeft < 400) && (before != after) ) {
		t = setTimeout('ScrollIn()', 15)
	}
	else
	{
		document.getElementById('picframe').scrollLeft = 0
		document.getElementById('spacer').width = 0
		document.getElementById('pictable').rows[0].cells[0].visible=0
	}
}


function ScrollABit() {
	
	before = document.getElementById('picframe').scrollLeft 
	
	document.getElementById('picframe').scrollLeft += increment;
	
	after = document.getElementById('picframe').scrollLeft 

	remaining-- ;
	if ( (remaining > 0) && (before != after) ) {
		t = setTimeout('ScrollABit()', 15)
	}
	else 
	{
		if (document.getElementById('picframe').scrollLeft == 0) {
			document.getElementById('scrollLeftId').src = "/img/left_white.gif";
		}
		
		if ((document.getElementById('picframe').scrollLeft + document.getElementById('picframe').clientWidth) >=  document.getElementById('picframe').scrollWidth) {
			document.getElementById('scrollRightId').src = "/img/right_white.gif";
		}
	}
}

var preload1
preload1 = new Image()
preload1.src = "/img/left.gif"
var preload2
preload2 = new Image()
preload2.src = "/img/right_white.gif"
var preload3
preload3 = new Image()
preload3.src = "/img/left_white.gif"
var preload4
preload4 = new Image()
preload4.src = "/img/right.gif"


function ScrollRight() {

	if (increment == 5) {
		remaining += 10000
	}
	else {
		remaining = 10000
	}
	
	document.getElementById('scrollLeftId').src = "/img/left.gif";
	increment = 5
	ScrollABit()
}

function ScrollLeft() {

	if (increment == -5) {
		remaining += 10000
	}
	else {
		remaining = 10000
	}
	
	document.getElementById('scrollRightId').src = "/img/right.gif";
	increment = -5
	ScrollABit()
}

function StopScroll() {

	remaining = 0
}


//-->
