$(function() {
	//$('#content.products dl.product_products dd.image ul li').hide();
	
	changeProducts_CivilEngineering();
	setInterval("changeProducts_CivilEngineering()", 1500 );
	
	setTimeout(function() {
		changeProducts_MaterialHandling();
		setInterval("changeProducts_MaterialHandling()", 1500 );
	}, 1000);

	setTimeout(function() {	
		changeProducts_Shelving();
		setInterval("changeProducts_Shelving()", 1500 );
	}, 2000);
	
	$('body.sales table.products td.image a').fancybox();
	$('body.products .product_info a').fancybox();
	
});

function changeProducts_CivilEngineering() {
	if ($('#content.products dl.product_products dd.civilengineering ul li:visible').length == 0) {
		$('#content.products dl.product_products dd.civilengineering ul li:first').fadeIn('2000');
	} else {
		$('#content.products dl.product_products dd.civilengineering ul li:visible').fadeOut('2000', function() {
			$(this).next().fadeIn('2000');
			if ($('#content.products dl.product_products dd.civilengineering ul li:visible').length == 0) {
				$('#content.products dl.product_products dd.civilengineering ul li:first').fadeIn('2000');
			}
		});
	}
}

function changeProducts_MaterialHandling() {
	if ($('#content.products dl.product_products dd.materialhandling ul li:visible').length == 0) {
		$('#content.products dl.product_products dd.materialhandling ul li:first').fadeIn('2000');
	} else {
		$('#content.products dl.product_products dd.materialhandling ul li:visible').fadeOut('2000', function() {
			$(this).next().fadeIn('2000');
			if ($('#content.products dl.product_products dd.materialhandling ul li:visible').length == 0) {
				$('#content.products dl.product_products dd.materialhandling ul li:first').fadeIn('2000');
			}
		});
	}
}

function changeProducts_Shelving() {
	if ($('#content.products dl.product_products dd.shelving ul li:visible').length == 0) {
		$('#content.products dl.product_products dd.shelving ul li:first').fadeIn('2000');
	} else {
		$('#content.products dl.product_products dd.shelving ul li:visible').fadeOut('2000', function() {
			$(this).next().fadeIn('2000');
			if ($('#content.products dl.product_products dd.shelving ul li:visible').length == 0) {
				$('#content.products dl.product_products dd.shelving ul li:first').fadeIn('2000');
			}
		});
	}
}
