<!--
// VARS
slideshow_layers = false;
slideshow_element = false;
slideshow_all = false;
slideshow_NN = false;
slideshow_NN6 = false;
slideshow_IE = false;
slideshow_mac = false;

slideshow_isPlaying = false;
slideshow_timer = null;
slideshow_timeToDelay = 5000;

// the slideshow array of images is
// slideshow_images

// the length of the array must also be defined in
// slideshow_numberOfImages

slideshow_playSrc = "testimonials/play.gif";
slideshow_stopSrc = "testimonials/pause.gif";
slideshow_nextSrc = "testimonials/arrow_for.gif";
slideshow_backSrc = "testimonials/arrow_back.gif";

slideshow_playSrcHi = "testimonials/play1.gif";
slideshow_stopSrcHi = "testimonials/pause1.gif";
slideshow_nextSrcHi = "testimonials/arrow_for1.gif";
slideshow_backSrcHi = "testimonials/arrow_back1.gif";

// my vars. don't change unless you know what you are doing.
slideshow_currentImageIndex = -1;
slideshow_currentImageSource = "";
slideshow_SHOW = 1;
slideshow_HIDE = 0;
slideshow_firstImageLoaded = false;



// Setup Fxns
if (document.getElementById){
	slideshow_element = true;
} else if (document.layers){
	slideshow_layers = true;
} else if (document.all){
	slideshow_all = true;
}

if (navigator.appName == "Netscape"){
	slideshow_NN = true;
	if (navigator.userAgent.toLowerCase().indexOf('netscape6')+1){
		slideshow_NN6 = true;
	}
	if (navigator.userAgent.toLowerCase().indexOf('netscape6/6.0')+1){
		slideshow_NN6 = true;
		alertText = "There is a bug in this version of the Netscape browser that creates unexpected results on this page. Please upgrade your version of the Netscape browser. Thank you.";
		alert(alertText);
	}
} else if (navigator.appName == "Microsoft Internet Explorer"){
	slideshow_IE = true;
}

if (navigator.userAgent.toLowerCase().indexOf('mac')+1){
	slideshow_mac = true;
}

if (slideshow_numberOfImages){
	if (slideshow_numberOfImages < 1){
	  // there aren't any pics
	}
}


// Slideshow function called from body onload
function slideshow_bodyLoaded(){
	if (slideshow_IE){
		im = document.getElementById("mainImage");
		im.style.filter = "blendTrans(duration=2)";
		if (slideshow_mac){
			slideshow_findObj("designerName").style.left = 90;
		}
	}
	slideshow_changeVisibility("backArrow",slideshow_HIDE);
	slideshow_play();
}


// Slideshow control Fxns
function slideshow_play(){
	slideshow_isPlaying = true;
	slideshow_findObj("playImage").src = slideshow_playSrcHi;
	slideshow_findObj("stopImage").src = slideshow_stopSrc;
	if (slideshow_currentImageIndex < slideshow_numberOfImages-1){
		slideshow_displayNextImage();
	}
}

function slideshow_stop(){
	slideshow_isPlaying = false;
	slideshow_findObj("playImage").src = slideshow_playSrc;
	slideshow_findObj("stopImage").src = slideshow_stopSrcHi;
	if (slideshow_timer){
		clearTimeout(slideshow_timer);
	}
}

function slideshow_next(){
	slideshow_stop();
	if (!slideshow_layers){
		slideshow_findObj("nextArrowImg").src = slideshow_nextSrcHi;
		setTimeout("slideshow_swapImage('nextArrowImg',slideshow_nextSrc)",400);
	}
	slideshow_displayNextImage();
}

function slideshow_back(){
	slideshow_stop();
	if (!slideshow_layers){
		slideshow_findObj("backArrowImg").src = slideshow_backSrcHi;
		setTimeout("slideshow_swapImage('backArrowImg',slideshow_backSrc)",400);
	}
	slideshow_displayBackImage();
}


// Slideshow image fxns
function slideshow_imageHasLoaded(){
	if (slideshow_firstImageLoaded){
		slideshow_displayText(slideshow_currentImageIndex);
		if (slideshow_isPlaying){
			slideshow_timer = setTimeout("slideshow_displayNextImage()",slideshow_timeToDelay);
		}
	}
	slideshow_firstImageLoaded = true;
}

function slideshow_displayNextImage(){
	if (slideshow_currentImageIndex == slideshow_numberOfImages-2){
		slideshow_changeVisibility("nextArrow",slideshow_HIDE);
		if (slideshow_isPlaying){
			slideshow_stop();
		}
	}
	if (slideshow_currentImageIndex == 0 ){
		slideshow_changeVisibility("backArrow",slideshow_SHOW);
	}
	if (slideshow_currentImageIndex < slideshow_numberOfImages-1){
		src = slideshow_images[slideshow_currentImageIndex+1];
		slideshow_currentImageIndex++;
		slideshow_findObj("hiddenImage").src = slideshow_images[slideshow_currentImageIndex+1];
		slideshow_displayImage(src);
	}
}

function slideshow_displayBackImage(){
	if (slideshow_currentImageIndex == 1){
		slideshow_changeVisibility("backArrow",slideshow_HIDE);
	}
	if (slideshow_currentImageIndex == slideshow_numberOfImages-1){
		slideshow_changeVisibility("nextArrow",slideshow_SHOW);
	}
	if (slideshow_currentImageIndex > 0){
		src = slideshow_images[slideshow_currentImageIndex-1];
		slideshow_currentImageIndex--;
		slideshow_displayImage(src);
	}
}

function slideshow_displayImage(src){
	slideshow_currentImageSource = src;
	if (slideshow_layers){
		obj = slideshow_findObj("imageLayer");
		obj.document.open();
		obj.document.write("<center><img name=\"mainImage\" id=\"mainImage\" src=\""+src+"\"  onload=\"slideshow_imageHasLoaded()\" border=0></center>");
		obj.document.close();
	} else if (slideshow_all){
			obj = slideshow_swapImage("imageLayer",src);
			obj.src = src;
	} else if (slideshow_element){
		obj = document.getElementById("mainImage");
		if (slideshow_NN){
			obj.src = src;
			if (slideshow_NN6){
				setTimeout("slideshow_delayNN6()",1000);
			}
		} else {
			im = document.getElementById("mainImage");
			im.filters.blendTrans.Apply();
			document.getElementById("mainImage").src = src
			im.filters.blendTrans.Play();
		}
	}
}

function slideshow_displayText(index){
	txt = "<p>"+slideshow_testimonials[index]+"</p>";
	if (slideshow_layers){
		obj = slideshow_findObj("testimonialText");
		txt = "<br><br>"+txt;
		//if (obj){
			obj.document.open();
			obj.document.write(txt);
			obj.document.close();
		//}
	} else if (slideshow_all){
		document.all("testimonialText").innerHTML = txt;
	} else if (slideshow_element){
		document.getElementById("testimonialText").innerHTML=txt;
	}
}

function slideshow_preloadImages() { //taken from MM v3.0
	var d=document; 
  	if(d.images){ 
		if(!d.MM_p) 
			d.MM_p=new Array();
    	var i,j=d.MM_p.length,a=slideshow_preloadImages.arguments; 
		for(i=0; i<a.length; i++){
    		if (a[i].indexOf("#")!=0){
				d.MM_p[j]=new Image;
				d.MM_p[j++].src=a[i];
			}
		}
	}
}

// slideshow helper fxns
function slideshow_changeVisibility(theObj,toDo){
	if (toDo == slideshow_HIDE){
		if (slideshow_layers){
			slideshow_findObj(theObj).visibility = "hidden";
		} else if (slideshow_element){
			document.getElementById(theObj).style.visibility = "hidden";
		}
	} else {
		if (slideshow_layers){
			slideshow_findObj(theObj).visibility = "visible";
		} else if (slideshow_element){
			document.getElementById(theObj).style.visibility = "visible";
		}
	}
}

function slideshow_delayNN6(){
	if (document.getElementById('mainImage').complete){
		slideshow_firstImageLoaded = true;
		slideshow_imageHasLoaded();
	} else {
		setTimeout("slideshow_delayNN6()",250);
	}
}

function slideshow_findObj(n, d) { //taken from MM v4.0
  	var p,i,x;  
  	if(!d) d=document;
  	if( ((p=n.indexOf("?")) > 0) && parent.frames.length) {
    	d=parent.frames[n.substring(p+1)].document;
		n=n.substring(0,p);
	}
  	if(!(x=d[n]) && d.all)
		x=d.all[n];
	for (i=0; !x && i<d.forms.length; i++)
		x=d.forms[i][n];
  	for(i=0; !x && d.layers && i<d.layers.length; i++)
		x=slideshow_findObj(n,d.layers[i].document);
  	if(!x && document.getElementById)
		x=document.getElementById(n);
	return x;
}

function slideshow_swapImage(img,src) { //taken from MM v3.0
  	var i,j=0,x;
  	if ((x=slideshow_findObj(img))!=null){ 
   		x.src=src;
	}
}

function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
	this.obj = getObjNN4(document,name);
	this.style = this.obj;
  }
}

function getObjNN4(obj,name)
{
	var x = obj.layers;
	var thereturn;
	for (var i=0;i<x.length;i++)
	{
		if (x[i].id == name)
		 	thereturn = x[i];
		else if (x[i].layers.length)
			var tmp = getObjNN4(x[i],name);
		if (tmp) thereturn = tmp;
	}
	return thereturn;
}


//-->