

NewImg = new Array ('http://www.idxcentral.com/images/mls/snar/pix/4/100009194_1_n.jpg','http://www.idxcentral.com/images/mls/snar/pix/4/100007414_1_n.jpg','http://www.idxcentral.com/images/mls/snar/pix/5/90008865_1_n.jpg','http://www.idxcentral.com/images/mls/snar/pix/3/90008683_1_n.jpg','http://www.idxcentral.com/images/mls/snar/pix/6/100010306_1_n.jpg');


NewCap = new Array ('<font size="1" face="Verdana, Arial, Helvetica, sans-serif" color="black"><b>$1,100,000</b><br><b>Bedrooms</b>: 4<br><b>Baths</b>: 3<br><b>Square Feet</b>: 4854<br>Custom built 4800 sf recently updated home in the Foothills. ...<br><img src="http://www.idxcentral.com/images/spacer.gif" width="1" height="3"><br><a href="http://www.idxcentral.com/snar/idxsearch.cfm?idxid=gcoons&pg=profile&mls=100009194"><b>View Details</b></a><br><img src="http://www.idxcentral.com/images/spacer.gif" width="1" height="3"></font>','<font size="1" face="Verdana, Arial, Helvetica, sans-serif" color="black"><b>$1,085,000</b><br><b>Bedrooms</b>: 3<br><b>Baths</b>: 2<br><b>Square Feet</b>: 3091<br>Look no further for the ultimate Carson Valley custom built ...<br><img src="http://www.idxcentral.com/images/spacer.gif" width="1" height="3"><br><a href="http://www.idxcentral.com/snar/idxsearch.cfm?idxid=gcoons&pg=profile&mls=100007414"><b>View Details</b></a><br><img src="http://www.idxcentral.com/images/spacer.gif" width="1" height="3"></font>','<font size="1" face="Verdana, Arial, Helvetica, sans-serif" color="black"><b>$995,000</b><br><b>Bedrooms</b>: 6<br><b>Baths</b>: 6<br><b>Square Feet</b>: 4696<br>HUGE PRICE REDUCTION!!! over $500,000 drop.  Watch the ...<br><img src="http://www.idxcentral.com/images/spacer.gif" width="1" height="3"><br><a href="http://www.idxcentral.com/snar/idxsearch.cfm?idxid=gcoons&pg=profile&mls=90008865"><b>View Details</b></a><br><img src="http://www.idxcentral.com/images/spacer.gif" width="1" height="3"></font>','<font size="1" face="Verdana, Arial, Helvetica, sans-serif" color="black"><b>$550,000</b><br><b>Bedrooms</b>: 5<br><b>Baths</b>: 3<br><b>Square Feet</b>: 3695<br>This beautiful old world style custom home sits on the ...<br><img src="http://www.idxcentral.com/images/spacer.gif" width="1" height="3"><br><a href="http://www.idxcentral.com/snar/idxsearch.cfm?idxid=gcoons&pg=profile&mls=90008683"><b>View Details</b></a><br><img src="http://www.idxcentral.com/images/spacer.gif" width="1" height="3"></font>','<font size="1" face="Verdana, Arial, Helvetica, sans-serif" color="black"><b>$459,000</b><br><b>Bedrooms</b>: 3<br><b>Baths</b>: 2<br><b>Square Feet</b>: 2226<br>"Gorgeous Genoa Lakes patio home backing to the 9th tee ...<br><img src="http://www.idxcentral.com/images/spacer.gif" width="1" height="3"><br><a href="http://www.idxcentral.com/snar/idxsearch.cfm?idxid=gcoons&pg=profile&mls=100010306"><b>View Details</b></a><br><img src="http://www.idxcentral.com/images/spacer.gif" width="1" height="3"></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='244' height='181' border=0 id='slideshow' name='slideshow' src='http://www.idxcentral.com/images/mls/snar/pix/4/100009194_1_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='1' face='Verdana, Arial, Helvetica, sans-serif' color='black'><b>$1,100,000</b><br><b>Bedrooms</b>: 4<br><b>Baths</b>: 3<br><b>Square Feet</b>: 4854<br>Custom built 4800 sf recently updated home in the Foothills. ...<br><img src='http://www.idxcentral.com/images/spacer.gif' width='1' height='3'><br><a href='http://www.idxcentral.com/snar/idxsearch.cfm?idxid=gcoons&pg=profile&mls=100009194'><b>View Details</b></a><br><img src='http://www.idxcentral.com/images/spacer.gif' width='1' height='3'></font></div></td></tr></table>");
