NewImg = new Array ('http://cdn.photos.sierrainteractivemls.com/3/mlspics/3_1273637_0351250.jpg','http://cdn.photos.sierrainteractivemls.com/3/mlspics/3_1281635_1318750.jpg','http://cdn.photos.sierrainteractivemls.com/3/mlspics/3_1267643_0223750.jpg','http://cdn.photos.sierrainteractivemls.com/3/mlspics/3_1282228.jpg','http://cdn.photos.sierrainteractivemls.com/3/mlspics/3_1281638_0162500.jpg','http://cdn.photos.sierrainteractivemls.com/3/mlspics/3_1277493_0787500.jpg','http://cdn.photos.sierrainteractivemls.com/3/mlspics/3_1281529.jpg','http://cdn.photos.sierrainteractivemls.com/3/mlspics/3_1278842.jpg');
NewCap = new Array ('
Bedrooms: 3
Baths: 1 Full / 0 Half
Square Feet: 1000
','
Bedrooms: 4
Baths: 1 Full / 0 Half
Square Feet: 1501
','
Bedrooms: 4
Baths: 2 Full / 1 Half
Square Feet: 1815
','
Bedrooms: 4
Baths: 2 Full / 1 Half
Square Feet: 2000
','
Bedrooms: 3
Baths: 3 Full / 0 Half
Square Feet: 1736
','
Bedrooms: 3
Baths: 2 Full / 0 Half
Square Feet: 2370
','
Bedrooms: 3
Baths: 3 Full / 1 Half
Square Feet: 3379
','
Bedrooms: 5
Baths: 3 Full / 2 Half
Square Feet: 5330
');
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 = 5000; //Time delay between Slides in milliseconds
var tmpDelay = 10000; // temp delay when user clicks on a photo
var lock = false;
var run;
var autoPlay = true;
var iPlayed = 0;
function chgImg(direction)
{
var oSlideshowPic = document.getElementById('slideshowPic')
var oSlideshowCap = document.getElementById('slideshowCap')
if (iPlayed > 25)
{
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;
}
oSlideshowPic.src = preLoad[ImgNum].src;
oSlideshowCap.innerHTML = NewCap[ImgNum];
}
}
}
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('slideshowPic')
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()}
oSlideshowPic.src = preLoad[ImgNum].src;
oSlideshowCap.innerHTML = NewCap[ImgNum];
}
if (autoPlay == true) { auto() }
/*Output HTML - Escape any double quotes used */
document.write("