/***********************************************
* Flexi Slideshow- © Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var fam_variableslide=new Array()

//fam_variableslide[x]=["path to image", "OPTIONAL link for image", "OPTIONAL text description (supports HTML tags)"]


/*
fam_variableslide[0]=['slideshow/01.jpg', '#1', ''];
fam_variableslide[1]=['slideshow/02.jpg', '#2', ''];
fam_variableslide[2]=['slideshow/03.jpg', '#3', ''];
fam_variableslide[3]=['slideshow/04.jpg', '#4', ''];
fam_variableslide[4]=['slideshow/05.jpg', '#5', ''];
fam_variableslide[5]=['slideshow/06.jpg', '#6', ''];
*/


/* 
########## ########## ########## ########## ########## ########## ########## ########## ########## 
########## ########## ########## ########## ########## ########## ########## ########## ########## 
########## ########## ########## ########## ########## ########## ########## ########## ########## 
########## ########## ########## ########## ########## ########## ########## ########## ########## 
BEGIN CUSTOM ZCWD CODE FOR RANDOMIZING SLIDES
*/

var tempslides=new Array()

// array format is "path/to.file","link/path.htm","<b>text</b> <a href='file.html'>description</a>"

tempslides[0]=['slideshow/01.jpg', '#1', ''];
tempslides[1]=['slideshow/02.jpg', '#2', ''];
tempslides[2]=['slideshow/03.jpg', '#3', ''];
tempslides[3]=['slideshow/04.jpg', '#4', ''];
tempslides[4]=['slideshow/05.jpg', '#5', ''];
tempslides[5]=['slideshow/06.jpg', '#6', ''];
tempslides[6]=['slideshow/07.jpg', '#1', ''];
tempslides[7]=['slideshow/08.jpg', '#1', ''];
tempslides[8]=['slideshow/09.jpg', '#1', ''];
tempslides[9]=['slideshow/10.jpg', '#1', ''];
tempslides[10]=['slideshow/11.jpg', '#1', ''];

templen = tempslides.length - 1;

var slideorder=new Array();
var trackorder=new Array();

var anyareempty = true;
var validsnum = false;

var emptychecks = 0;

do {

	validsnum = false;
	
	cursld = Math.round(Math.random()*templen);
	if (trackorder[cursld] === undefined) {
		trackorder[cursld] = emptychecks;
		slideorder[emptychecks] = tempslides[cursld];
		//document.write(" <P><b>saved</b>: cur("+emptychecks+") = "+ cursld +"| </P> ");
	} else {
		//document.write(" <P>skipped: cur("+emptychecks+") = "+ cursld +"| </P> ");

		for (scnt=cursld;scnt>=0;scnt=scnt-1) {
			if (trackorder[scnt] === undefined) {
				trackorder[scnt] = emptychecks;
				slideorder[emptychecks] = tempslides[scnt];
				validsnum = true;
				//document.write(" <P><b>saved</b>: for cur down("+emptychecks+") = "+ scnt +"| </P> ");
				break;
			} else {
				//document.write(" <P>for skipped down: cur("+emptychecks+") = "+ scnt +"| </P> ");
			}
		}
		
		if (validsnum !== true) {
			for (scnt=cursld;scnt<=templen;scnt=scnt+1) {
				if (trackorder[scnt] === undefined) {
					trackorder[scnt] = emptychecks;
					slideorder[emptychecks] = tempslides[scnt];
					validsnum = true;
					//document.write(" <P><b>saved</b>: for cur up("+emptychecks+") = "+ scnt +"| </P> ");
					break;
				} else {
					//document.write(" <P>for skipped up: cur("+emptychecks+") = "+ scnt +"| </P> ");
				}
			}
		}
	}

	emptychecks++;
	if (emptychecks >= templen+1) {
		anyareempty = false;
	}
} while (anyareempty !== false);

fam_variableslide = slideorder;  // set regular slide var to new order;


/*
//document.write(" <P>SAVED ORDER:</P> ");

for (x in fam_variableslide) {
	document.write("slide:"+x+" = "+fam_variableslide[x] + "<br />");
} 
*/


/* 
END CUSTOM ZCWD CODE FOR RANDOMIZING
########## ########## ########## ########## ########## ########## ########## ########## ########## 
########## ########## ########## ########## ########## ########## ########## ########## ########## 
########## ########## ########## ########## ########## ########## ########## ########## ########## 
########## ########## ########## ########## ########## ########## ########## ########## ########## 
*/

//configure the below 3 variables to set the dimension/background color of the slideshow

var fam_slidewidth='450px' //set to width of LARGEST image in your slideshow
var fam_slideheight='300px' //set to height of LARGEST iamge in your slideshow, plus any text description
var fam_slidebgcolor='#FFFFFF'

//configure the below variable to determine the delay between image rotations (in miliseconds)
var fam_slidedelay=3000

////Do not edit pass this line////////////////

var ie=document.all
var dom=document.getElementById

for (i=0;i<fam_variableslide.length;i++){
var fam_cacheimage=new Image()
fam_cacheimage.src=fam_variableslide[i][0]
}

var fam_currentslide=0

function fam_rotateimages(){
fam_contentcontainer='<center>'
if (fam_variableslide[fam_currentslide][1]!="")
fam_contentcontainer+='<a href="'+fam_variableslide[fam_currentslide][1]+'">'
fam_contentcontainer+='<img src="'+fam_variableslide[fam_currentslide][0]+'" border="0" vspace="3">'
if (fam_variableslide[fam_currentslide][1]!="")
fam_contentcontainer+='</a>'
fam_contentcontainer+='</center>'
if (fam_variableslide[fam_currentslide][2]!="")
fam_contentcontainer+=fam_variableslide[fam_currentslide][2]

if (document.layers){
fam_crossrotateobj.document.write(fam_contentcontainer)
fam_crossrotateobj.document.close()
}
else if (ie||dom)
fam_crossrotateobj.innerHTML=fam_contentcontainer
if (fam_currentslide==fam_variableslide.length-1) fam_currentslide=0
else fam_currentslide++
setTimeout("fam_rotateimages()",fam_slidedelay)
}

if (ie||dom)
document.write('<div id="fam_slidedom" style="width:'+fam_slidewidth+';height:'+fam_slideheight+'; background-color:'+fam_slidebgcolor+'"></div>')

function start_slider_fam(){
fam_crossrotateobj=dom? document.getElementById("fam_slidedom") : ie? document.all.fam_slidedom : document.fam_slidensmain.document.fam_slidenssub
if (document.layers)
document.fam_slidensmain.visibility="show"
fam_rotateimages()
}

if (ie||dom)
start_slider_fam()
else if (document.layers)
window.onload=start_slider_fam

/*
</script>

<ilayer id="fam_slidensmain" width=&{fam_slidewidth}; height=&{fam_slideheight}; bgColor=&{fam_slidebgcolor}; visibility=hide><layer id="fam_slidenssub" width=&{fam_slidewidth}; left=0 top=0></layer></ilayer>

<p align="center"><font face="Arial" size="-2">Free DHTML scripts provided by<br>
<a href="http://www.dynamicdrive.com">Dynamic Drive</a></font></p>
*/