function MM_findObj(n, d) { //transtime.01
  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=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function slideshow3(){
	this.style.filter="";
}

function slideshow2(){
	var imageid=arguments[0],imageobj=MM_findObj(imageid);
	if (imageobj&&imageobj.TSS2!=null){
		clearTimeout(imageobj.TSS2);
	}
}

function slideshow1(){
	var imageid=arguments[0],imageobj=MM_findObj(imageid),transtime=arguments[1],showtime=arguments[2],v6,v7,v8,v9,v10,v11;
	if (imageobj&&imageobj.TSS7){
		slideshow2(imageid);
		v9="slideshow1('"+imageid+"',"+transtime+","+showtime+")";
		if (transtime==1){
			if (!imageobj.TSS5.complete){
				imageobj.TSS2=setTimeout(v9,50);
				return;
			}
			v6= Math.round((imageobj.TSS7.length) *Math.random());
/*			v6=imageobj.TSS9+1; */
			if (v6>imageobj.TSS7.length-1){
				if (imageobj.TSS10==0){
					return;
				}else {v6=0;}
			}else if (v6+1<imageobj.TSS7.length){
				imageobj.TSS5.src=imageobj.TSS7[v6+1][0];
				}
			}else {
			if (!imageobj.TSS3.complete){
				imageobj.TSS2=setTimeout(v9,50);
				return;
			}
			v6=imageobj.TSS9-1;
			if (v6<0){
				if (imageobj.TSS10==0){
					return;
				}else 
				{v6=imageobj.TSS7.length-1;}
			}else if (v6-1>0){
				imageobj.TSS3.src=imageobj.TSS7[v6-1][0];
			}
		}
		imageobj.TSS9=v6;
		v10=imageobj.TSS7[v6][0];
		v11=imageobj.TSS7[v6][1];
		v7=(imageobj.filters&&!document.TSS6&&v11<25);
		if (v7){
			if (imageobj.filters[0]&&imageobj.filters[0].status==2){
				imageobj.filters[0].Stop();
			}
			if (v11==0){
				v8="blendTrans(Duration="+imageobj.TSS8+")";
			}else {
				v8="revealTrans(Duration="+imageobj.TSS8+",Transition="+(v11-1)+")";
			}
			imageobj.style.filter=v8;
			imageobj.onfilterchange=slideshow3;
			imageobj.filters[0].Apply();
		}
		imageobj.src=v10;
		if (v7){
			imageobj.filters[0].Play();
		}
		if (showtime==1){
			imageobj.TSS2=setTimeout(v9,imageobj.TSS4);
		}
	}
}

function slideshow(){
	var imageid=arguments[0],imageobj=MM_findObj(imageid),var5;
	if (imageobj){
		document.TSS6=(navigator.userAgent.toLowerCase().indexOf("mac")!=-1);
		imageobj.TSS8=arguments[1]/1000;
		imageobj.TSS4=arguments[2]+arguments[1];
		imageobj.TSS10=arguments[4];
		imageobj.TSS7=new Array();
		for (var count=5;count<arguments.length;count+=2){
			imageobj.TSS7[imageobj.TSS7.length]=new Array(arguments[count],arguments[count+1]);
		}
		imageobj.TSS9=0;
		imageobj.TSS5=new Image();
		imageobj.TSS5.src=arguments[7];
		imageobj.TSS3=new Image();
		imageobj.TSS3.src=arguments[arguments.length-2];
		if (arguments[3]==1){
			var5="slideshow1('"+imageid+"',1,1)";
			imageobj.TSS2=setTimeout(var5,imageobj.TSS4);
		}
	}
}
function slidesetup(){
slideshow('slideshow',2000,4500,1,1,'pictures/when_movement_slows_sld.gif',0,'pictures/be_here_now_sld.gif',0,'pictures/behind_little_clouds_sld.gif',0,'pictures/broccoli_and_love_sld.gif',0,'pictures/friends_around_the_uni_sld.gif',0,'pictures/highest_perspective_sld.gif',0,'pictures/the_dark_and_the_light_sld.gif',0,'pictures/little_spring_flowers_sld.gif',0,'pictures/mamas_tomato_sauce_sld.gif',0,'pictures/puzzle_of_love_sld.gif',0,'pictures/rainbow_world_sld.gif',0,'pictures/snow_king_sld.gif',0,'pictures/space_cookies_sld.gif',0,'pictures/stillness_is_the_source_sld.gif',0,'pictures/tilted_house_sld.gif',0);
}

function gallerysetup(){
slidesetup();
slideshow('gallery1',2000,500,1,1,'images/universal_healing_collection.gif',0,'images/universal_healing_collection.gif',0);
slideshow('gallery2',2000,1500,1,1,'images/world_healing_collection.gif',0,'images/world_healing_collection.gif',0);
slideshow('gallery3',2000,2500,1,1,'images/collaboration_collection.gif',0,'images/collaboration_collection.gif',0);
slideshow('gallery4',2000,3500,1,1,'images/uplifting_collection.gif',0,'images/uplifting_collection.gif',0);
slideshow('gallery5',2000,4500,1,1,'images/animals_collection.gif',0,'images/animals_collection.gif',0);
slideshow('gallery6',2000,5500,1,1,'images/food_love_collection.gif',0,'images/food_love_collection.gif',0);
}
