/*
function slideImage(activate,automatic) {
	
	$('#descriptions .infotext').fadeOut('slow');
	$('#image-navigation a.active').removeClass('active');
	
	if (activate == 1) {
		$('#imageholder').animate({"backgroundPosition": "0px 0px"}, 800, function() {
			$('#info-' + activate).fadeIn('slow');
			$('#imagelink-' + activate).addClass('active');
			if (automatic) {
				animationSlider = setTimeout("slideImage(2,1)", 5500);
			} else {
				clearTimeout(animationSlider);
			}
		});
	} else if (activate == 2) {
		$('#imageholder').animate({"backgroundPosition": "-1926px 0px"}, 800, function() {
			$('#info-' + activate).fadeIn('slow');
			$('#imagelink-' + activate).addClass('active');
			if (automatic) {
				animationSlider = setTimeout("slideImage(3,1)", 5500);
			} else {
				clearTimeout(animationSlider);
			}
		});
	} else if (activate == 3) {
		$('#imageholder').animate({"backgroundPosition": "-3852px 0px"}, 800, function() {
			$('#info-' + activate).fadeIn('slow');
			$('#imagelink-' + activate).addClass('active');
			if (automatic) {
				animationSlider = setTimeout("slideImage(1,1)", 5500);
			} else {
				clearTimeout(animationSlider);
			}
		});
	}
		
}
*/

function slideImage(activate,automatic) {
	
	clearTimeout(animationSlider);
	$('#descriptions .infotext').hide();
	$('#image-navigation a.active').removeClass('active');
	
	$('#info-' + activate).fadeIn('slow');
	$('#imagelink-' + activate).addClass('active');
	
	if (activate == 1) {
		$('#imageholder #images').animate({"left": "0px"}, 800, function() {
			if (automatic) {
				animationSlider = setTimeout("slideImage(2,1)", 5500);
			} else {
				clearTimeout(animationSlider);
			}
		});
	} else if (activate == 2) {
		$('#imageholder #images').animate({"left": "-1926px"}, 800, function() {
			
			if (automatic) {
				animationSlider = setTimeout("slideImage(3,1)", 5500);
			} else {
				clearTimeout(animationSlider);
			}
		});
	} else if (activate == 3) {
		$('#imageholder #images').animate({"left": "-3852px"}, 800, function() {
			
			if (automatic) {
				animationSlider = setTimeout("slideImage(4,1)", 5500);
			} else {
				clearTimeout(animationSlider);
			}
		});
	} else if (activate == 4) {
		$('#imageholder #images').animate({"left": "-5778px"}, 800, function() {
			
			if (automatic) {
				animationSlider = setTimeout("slideImage(5,1)", 5500);
			} else {
				clearTimeout(animationSlider);
			}
		});
	} else if (activate == 5) {
		$('#imageholder #images').animate({"left": "-7704px"}, 800, function() {
			
			if (automatic) {
				animationSlider = setTimeout("slideImage(1,1)", 5500);
			} else {
				clearTimeout(animationSlider);
			}
		});
	}
	
		
}

var animationSlider = setTimeout("slideImage(2,1)", 5500);

/*

$(document).ready(function() {   
    $('a.fancybox').fancybox({
    	'title': $($(this).children()[0]).attr('alt'),
    	'titlePosition': 'inside',
    	'overlayColor': '#000',
    	'overlayOpacity': 0.7
    });     
});

*/ 
