window.onload=function() {					
	$('.first-tabs li').mouseover(function() {
		id = $(this).attr('id');
		nr = id.substring(4);
		openOptimizeTabNr(nr);
	});
	
	$('.product-tabs h2').mouseover(function() {
		id = $(this).attr('id');
		nr = id.substring(4);
		openProductTabNr(nr);
	});

	function openOptimizeTabNr(openNr) {
		// schließe alle Tabs
		$('.first-tabs li').each( function() {
			id = $(this).attr('id');
			nr = id.substring(4);
			$(this).css('backgroundImage', 'url(/ocms/opencms/mw_website/resources/images/home/bg'+nr+'_closed.jpg)');
		});
		
		// Öffne danach Tab mit Nr, die übergeben wurde
		$('.first-tabs li#link'+openNr).css('backgroundImage', 'url(/ocms/opencms/mw_website/resources/images/home/bg'+openNr+'_open.jpg)');				

		// schließe alle Inhalte
		$('.optimize-tabs .optimize-content').each( function() {
			$(this).css('display', 'none');
		});
		
		// Öffne danach Inhalt mit Nr, die übergeben wurde
		$('.optimize-tabs .content'+openNr).css('display', 'inline');
	}
	
	function openProductTabNr(openNr) {
		// schließe alle Tabs
		$('.product-tabs h2').each( function() {
			$(this).css('backgroundImage', 'url(/ocms/opencms/mw_website/resources/images/home/bg05_closed.jpg)');
		});
		
		// Öffne danach Tab mit Nr, die übergeben wurde
		$('.product-tabs h2#link'+openNr).css('backgroundImage', 'url(/ocms/opencms/mw_website/resources/images/home/bg05_open.jpg)');		

		// schließe alle Inhalte
		$('.product-tabs .product-content').each( function() {
			$(this).css('display', 'none');
		});
		
		// Öffne danach Inhalt mit Nr, die übergeben wurde
		$('.product-tabs .content'+openNr).css('display', 'block');
	}	
	
}