function updateSlide(){
	var active = $("div#thumbs img.active");
	$("div#thumbs img").removeClass("active");

	var nextPic = active.next().length?active.next():$("div#thumbs img:first");						
	$("div#slideshow img").animate({opacity:"0.3"},2000,function(){
		$(this).attr("src",nextPic.attr("src")).animate({opacity:"1.0"},5000);
		nextPic.addClass("active");
		var desc = nextPic.attr("title");
		var width = $(this).width();
		$("div#desc").css('width',width).html(desc).fadeIn('slow');
	});
}//telos function updateSlide()

function updatePubs(){
	stop_timer();
	start_timer('publications');
	var active = $("div#thumbs img.active");
	$("div#thumbs img").removeClass("active");

	var nextPic = active.next().length?active.next():$("div#thumbs img:first");						
	$("div#slideshow img").animate({opacity:"0.3"},100,function(){
		$(this).attr("src",nextPic.attr("src")).animate({opacity:"1.0"},100);
		nextPic.addClass("active");
		var desc = nextPic.attr("title");
		var width = $(this).width();
		$("div#desc").css('width',width).html(desc).fadeIn('slow');
	});
}//telos function updateSlide()

var intval="";					
start_timer = function(menu){
	 if(menu=='home'){
			stop_timer();
			intval = window.setInterval("updateSlide()",5500);
      }else if(menu=='publications'){
			stop_timer();
			intval = window.setInterval("updatePubs()",5500);
      }else{
          stop_timer();
      }
}//telos function start_timer

stop_timer = function(){
	if(intval!="")
		window.clearInterval(intval)
	intval="";
}//telos function start_timer
