window.addEvent('domready', function() {

  // Hover Opacity Effekt

    $("menu_items").getElements("li[class=item]").addEvent("mouseover", function() {
      $("menu_items").getElements("li[id!="+this.id+"]").setStyle('opacity', '0.6');  
      //$("items").getElements("li[id!="+this.id+"]").fade('0.5');
    });
 
    $("menu_items").getElements("li[class=item]").addEvent("mouseleave", function() {   
      $("menu_items").getElements("li[class=item]").setStyle('opacity', '1');
    }); 
  
  
  // Menü Slide Effekt
  
  var szNormal = 150, szSmall  = 124, szFull   = 280;
   
  var items = $$("#menu_items .item");
  var fx = new Fx.Elements(items, {wait: false, duration: 400, transition: Fx.Transitions.Circ.easeOut});
  items.each(function(item, i) {
  	item.addEvent("mouseenter", function(event) {
  		var o = {};
  		o[i] = {width: [item.getStyle("width").toInt(), szFull]}
  		items.each(function(other, j) {
  			if(i != j) {
  				var w = other.getStyle("width").toInt();
  				if(w != szSmall) o[j] = {width: [w, szSmall]};
  			}
  		});
  		fx.start(o);
  	});
  });
   
  $("menu_items").addEvent("mouseleave", function(event) {
  	var o = {};
  	items.each(function(item, i) {
  		o[i] = {width: [item.getStyle("width").toInt(), szNormal]}
  	});
  	fx.start(o);
  });

});


