/***********************************************
* DHTML slideshow script-  © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice must stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
if (!(/MSIE/.test(navigator.userAgent)) && navigator.product == "Gecko") {
	HTMLElement.prototype.__defineSetter__("outerHTML", function (sHTML) {
	   var r = this.ownerDocument.createRange();
	   r.setStartBefore(this);
	   var df = r.createContextualFragment(sHTML);
	   this.parentNode.replaceChild(df, this);

	   return sHTML;
	});
}
var photos=new Array();

var photoslink=new Array();
var which=0;

//define images. You can have as many as you want:
photos[0]="../images/locations/advanced_aesthetics_building_photo.jpg";
photos[1]="../images/locations/andover.jpg";
photos[2]="../images/locations/augusta.jpg";
photos[3]="../images/locations/bethel-newton.jpg";
photos[4]="../images/locations/carriage-park.jpg";
photos[5]="../images/locations/derby.jpg";
photos[6]="../images/locations/eberly_farm.jpg";
photos[7]="../images/locations/founders_circle_building.jpg";
photos[8]="../images/locations/murdock.jpg";
photos[9]="../images/locations/northeast.jpg";
photos[10]="../images/locations/sleep_medicine.jpg";
photos[11]="../images/locations/sleep_medicine_east.jpg";




//Specify whether images should be linked or not (1=linked)
var linkornot=0;

//Set corresponding URLs, width and height for links in a new window
//for each of above images. Define ONLY if variable linkornot equals "1"
photoslink[0]=["http://www.wichitaclinic.com/Locations/Advanced_Aesthetics.php", 375, 200];
photoslink[1]=["http://www.wichitaclinic.com/Locations/Andover.php", 375, 200];

//do NOT edit pass this line

var preloadedimages=new Array()
for (i=0;i<photos.length;i++){
preloadedimages[i]=new Image()
preloadedimages[i].src=photos[i]
}

function applyeffect(){
if (document.all && photoslider.filters){
photoslider.filters[0].Stop()
photoslider.filters[0].Apply()
//alert(boxtext)
}
//if (document.all && document.getElementById('boxtext').filters) {
//document.getElementById('boxtext').filters[0].Stop()
//document.getElementById('boxtext').filters[0].Apply()
//}
}

function playeffect(){
if (document.all && photoslider.filters)
photoslider.filters[0].Play();
//if (document.all && document.getElementById('boxtext').filters)
//document.getElementById('boxtext').filters[0].Play();
}

function keeptrack(){
window.status="Image "+(which+1)+" of "+photos.length
}

function backward(){
clearTimeout(moving);
which=which>0? which-1 : photos.length-1
applyeffect()
document.images.photoslider.src=photos[which]
//document.getElementById('boxtext').outerHTML = boxtext[which]
playeffect()
keeptrack()
moving=setTimeout("forward2()",3000)
}

function forward(){
clearTimeout(moving);
which=which<photos.length-1? which+1 : 0
applyeffect()
document.images.photoslider.src=photos[which]
//document.getElementById('boxtext').outerHTML = boxtext[which]
playeffect()
keeptrack()
moving=setTimeout("forward2()",3000)
}

function forward2(){
clearTimeout(moving);
which=which<photos.length-1? which+1 : 0;
applyeffect();
document.images.photoslider.src=photos[which];
//document.getElementById('boxtext').outerHTML = boxtext[which];
playeffect();
keeptrack();
moving=setTimeout("forward2()",3000);
}

function transport(){
window.open(photoslink[which][0],'','width='+photoslink[which][1]+', height='+photoslink[which][2])
}

function move(){
setTimeout("keeptrack()",20);
moving=setTimeout("forward2()",3000)
}

onload=move;
