

NewImg = new Array ('http://www.idxcentral.com/images/mls/sltbor/respix/115980_n.jpg','http://www.idxcentral.com/images/mls/sltbor/respix/116420_n.jpg','http://www.idxcentral.com/images/mls/sltbor/respix/116275_n.jpg','http://www.idxcentral.com/images/mls/sltbor/respix/116601_n.jpg','http://www.idxcentral.com/images/mls/sltbor/respix/115802_n.jpg');


NewCap = new Array ('<font size="1" face="Verdana, Arial, Helvetica, sans-serif" color="black"><b>$1,800,000</b><br><b>Bedrooms</b>: 4<br><b>Baths</b>: 2.500<br><b>Square Feet</b>: 2488<br>Fallen Leaf Lake custom home has fantastic views of the ...<br><img src="http://www.idxcentral.com/images/spacer.gif" width="1" height="3"><br><a href="http://www.idxcentral.com/sltbor/idxsearch.cfm?idxid=mmorrison&pg=profile&mls=115980" target="_top"><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>$539,900</b><br><b>Bedrooms</b>: 3<br><b>Baths</b>: 2.500<br><b>Square Feet</b>: 2926<br>This property is a must see! 2005 custom built with a great ...<br><img src="http://www.idxcentral.com/images/spacer.gif" width="1" height="3"><br><a href="http://www.idxcentral.com/sltbor/idxsearch.cfm?idxid=mmorrison&pg=profile&mls=116420" target="_top"><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>$259,900</b><br><b>Bedrooms</b>: 3<br><b>Baths</b>: 1.000<br><b>Square Feet</b>: 1340<br>Great reduction! Darling home that has loads of charm. ...<br><img src="http://www.idxcentral.com/images/spacer.gif" width="1" height="3"><br><a href="http://www.idxcentral.com/sltbor/idxsearch.cfm?idxid=mmorrison&pg=profile&mls=116275" target="_top"><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>$159,900</b><br><b>Bedrooms</b>: 2<br><b>Baths</b>: 1.000<br><b>Square Feet</b>: 572<br>Location, Location, Location!! Just a few blocks from lake ...<br><img src="http://www.idxcentral.com/images/spacer.gif" width="1" height="3"><br><a href="http://www.idxcentral.com/sltbor/idxsearch.cfm?idxid=mmorrison&pg=profile&mls=116601" target="_top"><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>$109,900</b><br><b>Bedrooms</b>: 2<br><b>Baths</b>: 1.000<br><b>Square Feet</b>: 852<br>GOING TO AUCTION! Call your agent for more details. Sunny ...<br><img src="http://www.idxcentral.com/images/spacer.gif" width="1" height="3"><br><a href="http://www.idxcentral.com/sltbor/idxsearch.cfm?idxid=mmorrison&pg=profile&mls=115802" target="_top"><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/sltbor/respix/115980_n.jpg'></td></tr><tr><td bgcolor=''><img src='http://www.idxcentral.com/images/spacer.gif' width='1' height='3'></td></tr><tr><td align='center' bgcolor=''><font size='1' face='Verdana, Arial, Helvetica, sans-serif' color='black'>&laquo;&nbsp;&nbsp;<a onclick='showPicture(\"-\"); return false' href=''>back</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a onclick='showPicture(\"+\"); return false' href=''>next</a>&nbsp;&nbsp;&raquo;</font></td></tr><tr><td bgcolor=''><img src='http://www.idxcentral.com/images/spacer.gif' width='1' height='3'></td></tr><tr><td><table width='100%' cellpadding='2' cellspacing='0'><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,800,000</b><br><b>Bedrooms</b>: 4<br><b>Baths</b>: 2.500<br><b>Square Feet</b>: 2488<br>Fallen Leaf Lake custom home has fantastic views of the ...<br><img src='http://www.idxcentral.com/images/spacer.gif' width='1' height='3'><br><a href='http://www.idxcentral.com/sltbor/idxsearch.cfm?idxid=mmorrison&pg=profile&mls=115980' target='_top'><b>View Details</b></a><br><img src='http://www.idxcentral.com/images/spacer.gif' width='1' height='3'></font></div></td></tr></table></td></tr></table>");
