function show(id) {
	if ($('div#box-container .element').length > 1) {
		oldid = 'b1';
		$.each($('div#box-container .element'),function(i,n){
			if ($(n).hasClass('active')) {
				oldid = $(n).attr('id');
			} else {
				$('div#box-details .'+$(n).attr('id')).css('display','none');
			}
		});
		if (id==null) {
			if ($('div#box-container #'+oldid).next('div').length) {
				id = $('div#box-container #'+oldid).next('div').attr('id');
			} else {
				id = 'b1';
			}
			$('div#box-details .'+oldid).fadeOut("fast",function(){
				$('div#box-details').animate({width:"1"}, {duration:"normal", complete:function(){
					$('div#box-container .element').removeClass('active');
					$('div#box-container #'+id).addClass('active');
					$('div#box-details').animate({width:"212"}, {duration:"normal", complete:function(){
						$('div#box-details .'+id).fadeIn("fast");
					}});
				}});
			});
		} else {
			$('body').stopTime('slide');
			$('body').stopTime('onetimeslide');
			$('body').oneTime('35s', 'onetimeslide', function(){
				slideshow();
			});
			$('div#box-details .'+oldid).fadeOut("fast",function(){
				$('div#box-details').animate({width:"1"}, {duration:"fast", complete:function(){
					$('div#box-container .element').removeClass('active');
					$('div#box-container #'+id).addClass('active');
					$('div#box-details').animate({width:"212"}, {duration:"fast", complete:function(){
						$('div#box-details .'+id).fadeIn("fast");
					}});
				}});
			});
		}
	}
}

function slideshow() {
	if ($('div#box-container .element').length > 1) {
		$('body').everyTime('10s', 'slide', function(){
			show();
		});
	} else {
		$('div#box-container, div#box-details').hide();
	}
}
