// JavaScript Slideshow by Patrick Fitzgerald
// http://slideshow.barelyfitz.com/

//********************************
//********************************
// Create the slideshow object
ss = new slideshow('ss');
//If you want to have absolute image links, enter this parameter:
ss.rootlink='photos/';
// Set the delay between slides, 1000 = 1 sec
ss.timeout = 5000;
// By default, all of the slideshow images are prefetched.
// If you have a large number of slides you can limit the
// number of images that are prefetched.
 ss.prefetch = 7;
// By default the slideshow will repeat when you get to the end.
// ss.repeat = false;
/*********************************************************************************************************
IMAGES:     1. MUST be exactly 400px wide X 164px high.
TITLES and TEXT: must be all on one line with web browser-friendly characters. May include HTML tags.
**********************************************************************************************************/
// Create the slides and add them to the slideshow.
s = new slide();
s.src =  ss.rootlink + 'model_01.jpg';
s.link = 'featured-projects.php';
s.title = 'ALLEN';s.text = 'DESCRIPTION 1';s.target = '';
ss.add_slide(s);
s = new slide();
s.src =  ss.rootlink + 'model_02.jpg';
s.link = 'featured-projects.php';
s.title = 'BRUNSWICK';s.text = 'DESCRIPTION 2';s.target = '';
ss.add_slide(s);
s = new slide();
s.src =  ss.rootlink + 'model_03.jpg';
s.link = 'featured-projects.php';
s.title = 'BURKS';s.text = 'DESCRIPTION 3';s.target = '';
ss.add_slide(s);
s = new slide();
s.src =  ss.rootlink + 'model_04.jpg';
s.link = 'featured-projects.php';
s.title = 'CAMBRIDGE';s.text = 'DESCRIPTION 4';s.target = '';
ss.add_slide(s);
s = new slide();
s.src =  ss.rootlink + 'model_05.jpg';
s.link = 'featured-projects.php';
s.title = 'CATALINA';s.text = 'DESCRIPTION 5';s.target = '';
ss.add_slide(s);
s = new slide();
s.src =  ss.rootlink + 'model_06.jpg';
s.link = 'featured-projects.php';
s.title = 'DURHAM';s.text = 'DESCRIPTION 6';s.target = '';
ss.add_slide(s);
s = new slide();
s.src =  ss.rootlink + 'model_07.jpg';
s.link = 'featured-projects.php';
s.title = 'GRAND TUSCAN ESTATES';s.text = 'DESCRIPTION 7';s.target = '';
ss.add_slide(s);
s = new slide();
s.src =  ss.rootlink + 'model_08.jpg';
s.link = 'featured-projects.php';
s.title = 'LEXINGTON';s.text = 'DESCRIPTION 8';s.target = '';
ss.add_slide(s);
s = new slide();
s.src =  ss.rootlink + 'model_09.jpg';
s.link = 'featured-projects.php';
s.title = 'MORRIS';s.text = 'DESCRIPTION 9';s.target = '';
ss.add_slide(s);
s = new slide();
s.src =  ss.rootlink + 'model_10.jpg';
s.link = 'featured-projects.php';
s.title = 'PLANTATION';s.text = 'DESCRIPTION 10';s.target = '';
ss.add_slide(s);
s = new slide();
s.src =  ss.rootlink + 'model_11.jpg';
s.link = 'featured-projects.php';
s.title = 'STRATTON';s.text = 'DESCRIPTION 11';s.target = '';
ss.add_slide(s);
s = new slide();
s.src =  ss.rootlink + 'model_12.jpg';
s.link = 'featured-projects.php';
s.title = 'WELLINGTON';s.text = 'DESCRIPTION 12';s.target = '';
ss.add_slide(s);
s = new slide();
s.src =  ss.rootlink + 'model_13.jpg';
s.link = 'featured-projects.php';
s.title = 'WILSHIRE';s.text = 'DESCRIPTION 13';s.target = '';
ss.add_slide(s);
/* ***************************************************
END OF SLIDES
******************************************************/
// The following loop sets an attribute for all of the slides.
// This is easier than setting the attributes individually.
for (var i=0; i < ss.slides.length; i++) {
  s = ss.slides[i];
  s.target = '';
  s.attr = 'width=960,height=600,resizable=yes,scrollbars=yes';
}
//slidex.px=document.layers? 'content_image' : 'px';
//slidex.px=document.layers.content_image.left + 'px';
//Configure speed here (1-5). Note: the x in calls for slidex(id, x) should be evenly divisible by the speed value:
ss.thumbWidth=19; //the width between each thumbnail
numSlides = ss.slides.length;
ss.lastpos=numSlides; //the number of thumbnails
ss.current = 0;
ss.prev_slide_no=0;
var looping = false;
var numLoops = -1;
ss.current=0;
ss.lastNum=0;
//alert(numSlides);
function checkOut(thisID, thisSrc, thisNum) {
	//alert(ss.current + ', ' + ss.lastNum + ', ' + thisID + ', ' + thisSrc + ', ' + thisNum);
	var thisCurrent = ss.current + 1;
	var thisLast = ss.lastNum + 1;
	if (thisCurrent != thisNum) {
		changeImages(thisID, thisSrc);
	}
	thisID = 'but' + ss.lastNum;
	thisSrc = '/files/slideshow/images/but' + ss.lastNum + '.png';
}
