var slideShowTimer,timerTick;
	function startSlideShow(imgblock){
		var anchors = document.getElementsByTagName('a');
		var anchor, relAttribute;
		for (var i=0; i<anchors.length; i++){
			anchor = anchors[i];
			relAttribute = String(anchor.getAttribute('rel'));
			
			// use the string.match() method to catch 'lightbox' references in the rel attribute
			if (anchor.getAttribute('href') && (relAttribute.toLowerCase().match('lightbox'))){
				if (imgblock && relAttribute.toLowerCase().match(imgblock)||!imgblock){
					anchor.onclick();
					slideShowTimer=setInterval('slideShow()', 3250);//half the delay between pictures
					return;
				}
			}
		}
	}
	function slideShow(){
		//we show a new picture only every other time we call slideShow().
		//this allows us to check if the ligtbox is off in half the time... :)
		if(!timerTick){timerTick=true;return;}
		timerTick=false;
		if (Element.visible('lightbox')){
				if(activeImage >= imageArray.length - 1)
					myLightbox.changeImage(0);
				else
					myLightbox.changeImage(activeImage + 1); 
		}else{
			clearInterval(slideShowTimer);
		}
	}