window.addEvent('domready',function(){				
		
	new Asset.css('css/init_namos.css');
	new Asset.css('css/js_technologie.css');
	new Asset.javascript('js/menu_sitemap.js');
	
	step = 0;
	$('counter').getChildren()[0].set('text', step+1 );
	$('counter').getChildren()[1].set('text', $$('.content').length );
	
	var checkButtonState = function() {
		if (step == 0) {
			$('prev').setStyle('background', 'url(images/gfx/namos_bg_slider_prev_ia.gif) no-repeat top left');
		}
		else {
			$('prev').setStyle('background', 'url(images/gfx/namos_bg_slider_prev_a.gif) no-repeat top left');
		}
		if (step == $$('.content').length-1) {
			$('next').setStyle('background', 'url(images/gfx/namos_bg_slider_next_ia.gif) no-repeat top left');
		}
		else {
			$('next').setStyle('background', 'url(images/gfx/namos_bg_slider_next_a.gif) no-repeat top left');
		}
	}
	
	checkButtonState();
	$$('.content').each(function(content, id){
		if (id != step) {
			content.fade('hide');
		}
		else 
		{
			content.fade('show');
		}	
	});
	
	var mySlider = function(step) {
		checkButtonState();
		$$('.content').each(function(content, id){
			if (id != step) {
				content.fade('out');
			}
			else 
			{
				content.fade('in');
			}	
		});
		return step;
	}
	
	$('next').addEvent('click', function(e){
		new Event(e).stop();
		if (step<$$('.content').length-1) {
			mySlider(++step);
			$('counter').getChildren()[0].set('text', step+1 );
		}
	});
	
	$$('.next').addEvent('click', function(e){
		new Event(e).stop();
		if (step<$$('.content').length-1) {
			mySlider(++step);
			$('counter').getChildren()[0].set('text', step+1 );
		}
	});
	
	$('prev').addEvent('click', function(e){
		new Event(e).stop();
		if (step>0) {
			mySlider(--step);
			$('counter').getChildren()[0].set('text', step+1 );
		}	
	});
	
});	
