

NewImg = new Array ('http://www.wsierra.com/images/uimages/Nevada1023599_n.jpg','http://www.wsierra.com/images/uimages/Casci2.JPG');


NewCap = new Array ('<font size="2" face="Arial, Helvetica, sans-serif"><b><font color="BC3C39">4.3 Acres in Nevada City<br></font></b>Ready for your dream home.  Well in, perc and mantle done.  10 minutes to town. $195,000<br><a href="http://www.idxcentral.com/ncbor/idxsearch.cfm?idxid=dpracht&pg=profileland&mls=1028713&cs=any">View Details</a></font>','<font size="2" face="Arial, Helvetica, sans-serif"><b><font color="BC3C39">29 1/2 View Acres<br></font></b>Rare Scotts Flat Lake View Property.   Spring, Stream, 12 minutes to Nevada City, CA. View more information.<br><a href="http://www.idxcentral.com/ncbor/idxsearch.cfm?idxid=dpracht&pg=profileland&mls=1031281&cs=any">View Details</a></font>');
var preLoad = new Array()
for (i = 0; i < NewImg.length; i++)
{
preLoad[i] = new Image()
preLoad[i].src = NewImg[i]
}

/* Slideshow Functions */

var ImgNum = 0;
var ImgLength = preLoad.length - 1;
var delay = 7000; //Time delay between Slides in milliseconds
var tmpDelay = 10000; // temp delay when user clicks on a photo
var lock = false;
var run;
var autoPlay = false;
var iPlayed = 0;

function chgImg(direction)
{
	var oSlideshowPic = document.getElementById('slideshow')
	var oSlideshowCap = document.getElementById('slideshowCap')

	if (iPlayed > 10)
	{
		lock = false;
		autoPlay = false;
		window.clearInterval(run);
	}
	else
	{
		if (document.images)
		{
			ImgNum = ImgNum + direction;
			if (ImgNum > ImgLength) 
			{
				ImgNum = 0;
				iPlayed = iPlayed + 1
			}
			if (ImgNum < 0)
			{
				ImgNum = ImgLength;
			}

			if (document.all)
			{
				oSlideshowPic.style.filter = "blendTrans(duration=2)"
				oSlideshowPic.style.filter = "blendTrans(duration=crossFadeDuration)"
				oSlideshowPic.filters.blendTrans.Apply()

				oSlideshowCap.style.filter = "blendTrans(duration=2)"
				oSlideshowCap.style.filter = "blendTrans(duration=crossFadeDuration)"
				oSlideshowCap.filters.blendTrans.Apply()
			}

			oSlideshowPic.src = preLoad[ImgNum].src;
			oSlideshowCap.innerHTML = NewCap[ImgNum];

			if (document.all)
			{
				oSlideshowPic.filters.blendTrans.Play()
				oSlideshowCap.filters.blendTrans.Play()
			}
		}
	}
}

function auto()
{
	if (lock == true)
	{
		lock = false;
		autoPlay = false;
		window.clearInterval(run);
		run = setInterval("auto()", tmpDelay);
	}
	else if (lock == false)
	{
		lock = true;
		autoPlay = true;
		run = setInterval("chgImg(1)", delay);
	}
}

function showPicture(whichDir)
{
	var oSlideshowPic = document.getElementById('slideshow')
	var oSlideshowCap = document.getElementById('slideshowCap')

	lock = false;
	autoPlay = false;
	window.clearInterval(run);

	if (whichDir == '+')
	{
		if (ImgNum == ImgLength)
		{
			ImgNum = 0
		}
		else
		{
			ImgNum = ImgNum + 1
		}
	}
	else
	{
		if (ImgNum == 0)
		{
			ImgNum = ImgLength
		}
		else
		{
			ImgNum = ImgNum - 1
		}		
	}

	if (autoPlay == true) {auto()}

	if (document.all)
	{
		oSlideshowPic.style.filter = "blendTrans(duration=2)"
		oSlideshowPic.style.filter = "blendTrans(duration=crossFadeDuration)"
		oSlideshowPic.filters.blendTrans.Apply()

		oSlideshowCap.filter = "blendTrans(duration=2)"
		oSlideshowCap.style.filter = "blendTrans(duration=crossFadeDuration)"
		oSlideshowCap.filters.blendTrans.Apply()
	}

	oSlideshowPic.src = preLoad[ImgNum].src;
	oSlideshowCap.innerHTML = NewCap[ImgNum];

	if (document.all)
	{
		oSlideshowPic.filters.blendTrans.Play()
		oSlideshowCap.filters.blendTrans.Play()
	}
}

auto()


/*Output HTML - Escape any double quotes used */

document.write("<table width='100%' cellpadding='0' cellspacing='0'><tr><td align='center'><img width='185' height='138' border=0 id='slideshow' name='slideshow' src='http://www.wsierra.com/images/uimages/Nevada1023599_n.jpg'></td></tr><tr><td align='center'><a onclick='showPicture(\"-\"); return false' href=''><img border=0 width=40 height=19 src='http://www.idxcentral.com/metro/images/idxbutton_back.gif'></a><a onclick='showPicture(\"+\"); return false' href=''><img border=0 width=55 height=19 src='http://www.idxcentral.com/metro/images/idxbutton_next.gif'></a></td></tr><tr><td align='left' bgcolor='' valign='top'><div id='slideshowCap' name='slideshowCap'><font size='2' face='Arial, Helvetica, sans-serif'><b><font color='BC3C39'>4.3 Acres in Nevada City<br></font></b>Ready for your dream home.  Well in, perc and mantle done.  10 minutes to town. $195,000<br><a href='http://www.idxcentral.com/ncbor/idxsearch.cfm?idxid=dpracht&pg=profileland&mls=1028713&cs=any'>View Details</a></font></div></td></tr></table>");
