function initgallery() {  
	/*$('a').each(function() {
		if (this.getAttribute('href') && (this.getAttribute('rel') == 'slide')){
			this.onclick = function () {
				$("#slide").toggle();
				$("#slideimg").html('<img src="'+this.href+'" width="450" height="450" alt="'+this.getAttribute("title")+'" title="'+this.getAttribute("title")+'" />');
				$("#slidecaption").html("<em>"+this.getAttribute("title")+"</em>");
				setTimeout("$('#slide').show('slow')", 2000);
				return false;
			}
		}
	});*/
	var allThumbs = $("#thumbs img").get();	
	thumbLength = allThumbs.length;
	tOffset = 0;
}

function leftScroll() {
	if(tOffset < 10) {
		tOffset = tOffset + 10;
		document.getElementById("thumbs").style.marginLeft = tOffset + "px";
		doscroll = setTimeout("leftScroll()", 30);		
	}
}

function rightScroll() {    
	if( tOffset > ((thumbLength * 150) - ((thumbLength * 150) * 2)) + 150 ) {
		tOffset = tOffset - 10;
		document.getElementById("thumbs").style.marginLeft = tOffset + "px";
		doscroll = setTimeout("rightScroll()", 30);
	}
}

function stopScroll() {
	if(doscroll) clearTimeout(doscroll);
}



	
	 
	
