// JavaScript Document
var ultimateshow=new Array()

//ultimateshow[x]=["path to image", "OPTIONAL link for image", "OPTIONAL link target"]

ultimateshow[0]=['&quot;Your complementary skills, research savvy and ability to work with a wide range of constituents…  made the process fun, interesting and rewarding.&quot;', 'linfield.html', ' ', 'Jodi Kilcup Ph.D., ', 'Assistant VP for College Relations ', 'Linfield College ']
ultimateshow[1]=['&quot;The Chico Experience Research, conducted by the Discovery Collaborative, not only drove our brand positioning but is being used all over campus.&quot;', 'chico.html', ' ', 'Alan Rellaford, ', 'Creative Director ', 'California State University, Chico ']
ultimateshow[2]=['&quot;I would highly recommend Discovery Collaborative to any person charged with developing research to strengthen their branding effort.&quot;', 'portland.html', ' ', 'Laurie Kelley, ', 'Chief Marketing Officer ', 'University of Portland&nbsp;']

//configure the below 3 variables to set the dimension/background color of the slideshow

var slidewidth="300px" //set to width of LARGEST image in your slideshow
var slideheight="170px" //set to height of LARGEST iamge in your slideshow
var slidecycles="continous" //number of cycles before slideshow stops (ie: "2" or "continous")
var randomorder="no" //randomize the order in which images are displayed? "yes" or "no"
var preloadimages="yes" //preload images? "yes" or "no"
var slidebgcolor='white'

//configure the below variable to determine the delay between image rotations (in miliseconds)
var slidedelay=6000

////Do not edit pass this line////////////////

var ie=document.all
var dom=document.getElementById
var curcycle=0

if (preloadimages=="yes"){
for (i=0;i<ultimateshow.length;i++){
var cacheimage=new Image()
cacheimage.src=ultimateshow[i][0]
}
}

var currentslide=0

function randomize(targetarray){
ultimateshowCopy=new Array()
var the_one
var z=0
while (z<targetarray.length){
the_one=Math.floor(Math.random()*targetarray.length)
if (targetarray[the_one]!="_selected!"){
ultimateshowCopy[z]=targetarray[the_one]
targetarray[the_one]="_selected!"
z++
}
}
}

if (randomorder=="yes")
randomize(ultimateshow)
else
ultimateshowCopy=ultimateshow

var colornum=0;
var colornum2=0;
var tcount=13;

function colorup() {
	eid = document.getElementById("text");
	eid2 = document.getElementById("text2");
	color = ["#fff", "#fff", "#f8f8f8", "#eee", "#ddd", "#ccc", "#bbb", "#aaa", "#999", "#888", "#777", "#666", "#5d5959"];
	eid.style.color = color[colornum];
	eid2.style.color = color[colornum];
	colornum++
	if (colornum >= tcount) {
	clearInterval(flash);
	return
	}
	
}

function fadein() {
	flash=window.setInterval("colorup()", 250);
	}

function colordown() {
	eid = document.getElementById("text");
	eid2 = document.getElementById("text2");
	color = ["#5d5959", "#666", "#777", "#888", "#999", "#aaa", "#bbb", "#ccc", "#ddd", "#eee", "#f8f8f8", "#fff", "#fff"]
	eid.style.color = color[colornum2];
	eid2.style.color = color[colornum2];
	colornum2++
	if (colornum2 >= tcount) {
	clearInterval(flash);
	rotateimages();
	}
	
}

function fadeout() {
	flash=window.setInterval("colordown()", 250);
	}

function rotateimages(){
colornum=0;
colornum2=0;
curcycle=(currentslide==0)? curcycle+1 : curcycle
ultcontainer='<div id="quotebox">'
if (ultimateshowCopy[currentslide][1]!="")
ultcontainer+='<a href="'+ultimateshowCopy[currentslide][1]+'">'
ultcontainer+='<p id="text">'+ultimateshowCopy[currentslide][0]+'</p>'
ultcontainer+='<div id="line2"></div>'
ultcontainer+='<p id="text2">'+ultimateshowCopy[currentslide][3]+'<br />'+ultimateshowCopy[currentslide][4]+'<br />'+ultimateshowCopy[currentslide][5]+'</p>'
if (ultimateshowCopy[currentslide][1]!="")
ultcontainer+='</a>'
ultcontainer+='</div>'
if (ie||dom)
crossrotateobj.innerHTML=ultcontainer
fadein();
if (currentslide==ultimateshow.length-1) currentslide=0
else currentslide++
if (curcycle==parseInt(slidecycles) && currentslide==0)
return
setTimeout("fadeout()",slidedelay)
}

function start_slider(){
crossrotateobj=dom? document.getElementById("slidedom") : document.all.slidedom
rotateimages()
}
