window.addEvent('domready',function(){				
		
	new Asset.css('css/init_namos.css');
	new Asset.css('css/js_intro.css');	
	new Asset.javascript('js/menu_sitemap.js');
	
	$('mainmenu').setStyle('background', 'none');
	$('mainmenu').getChildren('li')[0].setStyle('width', '50px');
	if ($('lang').get('text') == 'english')	
		$('mainmenu').getChildren('li').getChildren('a')[0].set('text', 'Menü');
	else
		$('mainmenu').getChildren('li').getChildren('a')[0].set('text', 'Menu');
	$('mainmenu').getChildren('li').getChildren('a')[0].setStyle('color', '#00A4E7');
	

	$('mainmenu').addEvent('mouseover', function(e){
		$('mainmenu').getChildren('li').getChildren('a')[0].setStyle('color', '#666666');
		$('mainmenu').getChildren('li').getChildren('a')[0].set('text', 'Home');
		$('mainmenu').morph('.mainmenu_active');
	});
	$$('.content').addEvent('mouseover', function(e){
		$('mainmenu').getChildren('li').getChildren('a')[0].setStyle('color', '#00A4E7');
		if ($('lang').get('text') == 'english')	
			$('mainmenu').getChildren('li').getChildren('a')[0].set('text', 'Menü');
		else
			$('mainmenu').getChildren('li').getChildren('a')[0].set('text', 'Menu');
		$('mainmenu').morph('.mainmenu_inactive');
	});
	
	
	
	
	
	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 );
		});
	
	$('prev').addEvent('click', function(e){
		new Event(e).stop();
		if (step>0)
			mySlider(--step);
			$('counter').getChildren()[0].set('text', step+1 );
	});
	
});			
