var not_sel_i = 0;

// fix the width of the menu-elements (IE-only) as soon as possible (hopefully before drawing the menu)
$$('.topmenua').each(function(x) {
	x.ancestors().first().style.width = (x.getWidth() + 21)+ 'px';
});

// set the background color of the menu elements
$$('.not_selected').each(function(el, i){
	el.style.backgroundImage = 'url(/css/menu_'+(i%4+1)+'nb.png)';
	Event.observe(el, "mouseover", function(el) {
		el.style.backgroundImage = 'url(/css/menu_sb.png)';
		el.getElementsBySelector('.not_selected_left').first().style.backgroundImage = 'url(/css/menu_sl.png)';
		el.getElementsBySelector('.not_selected_right').first().style.backgroundImage = 'url(/css/menu_sr.png)';
	}.bind(this, el));
	
	Event.observe(el, "mouseout", function(el) {
		el.style.backgroundImage = 'url(/css/menu_'+(i%4+1)+'nb.png)';
		el.getElementsBySelector('.not_selected_left').first().style.backgroundImage = 'url(/css/menu_'+(i%4+1)+'nl.png)';
		el.getElementsBySelector('.not_selected_right').first().style.backgroundImage = 'url(/css/menu_'+(i%4+1)+'nr.png)';
	}.bind(this, el, i));
});

$$('.not_selected_left').each(function(el, i){
	el.style.backgroundImage = 'url(/css/menu_'+(i%4+1)+'nl.png)';
});

$$('.not_selected_right').each(function(el, i){
	el.style.backgroundImage = 'url(/css/menu_'+(i%4+1)+'nr.png)';
});

