function bg_mv (a, b) {

    $(a).setStyle('background-position', b);
}

/*
var startMenu = function() {
if (document.all&&document.getElementById)
{
	cssmenu = document.getElementById("csstopmenu");
	for (i=0; i<cssmenu.childNodes.length; i++)
	{
		node = cssmenu.childNodes[i];
		if (node.nodeName=="LI")
		{
			node.onmouseover=function()
			{
				this.className+=" over";
			}
			node.onmouseout=function()
			{
				this.className=this.className.replace(" over", "")
			}
		}
	}
}
}


var write_nwslt =  function(e) {
	e = new Event(e).stop();

	var url = "http://spotnew.spotwerbung.ch/fileadmin/spotnew/templates/test.html?L=0";

	
	new Ajax(url, {
		method: 'get',
		update: $('newsletter')
	}).request();
}



if (window.attachEvent) {
    window.attachEvent("onload", startMenu);
    //window.attachEvent("onload", write_nwslt);
}
else {
    window.onload=startMenu;
    //window.onload=write_nwslt;
}

*/


var Sprites2 = new Class({
  Implements: [Options],
  
  options: {
    item_selector: '#navi_top a',
    parent_selector: 'li',
    mode: 'fade',
    duration:300
  },
  
  initialize: function(options) {
    this.setOptions(options);
    var self = this;
    
    document.getElements(self.options.item_selector).each(function(item) {
      var parent_element = item.getParent(self.options.parent_selector);
      
      var fx_element = new Element('div', {
        'class': 'effect',
        'tween': { duration: self.options.duration }
      }).inject(parent_element, 'top');
      
      self.effects[self.options.mode].call(self, fx_element);
      parent_element.addEvents({
        mouseover: function() { if (!parent_element.hasClass('current')) self.show_fn(fx_element); },
        mouseout: function() { if (!parent_element.hasClass('current')) { self.hide_fn(fx_element); fx_element.removeClass('mousedown'); }},
        mousedown: function() { fx_element.addClass('mousedown'); },
        mouseup: function() { fx_element.removeClass('mousedown'); },
        mouseleave: function() { fx_element.removeClass('mousedown'); }
      });
      
      if (!parent_element.hasClass('current')) item.setStyle('background-image', 'none');
    });
  },
  
  effects: {
    fade: function(fx_element) {
      fx_element.fade('hide');
      
      this.show_fn = function(fx_element) { fx_element.fade('in'); };
      this.hide_fn = function(fx_element) { fx_element.fade('out'); };
    },
  
    slide: function(fx_element) {
      fx_element.store('height', fx_element.getSize().y).setStyle('height', 0);
      
      this.show_fn = function(fx_element) { fx_element.tween('height', fx_element.retrieve('height')); };
      this.hide_fn = function(fx_element) { fx_element.tween('height', 0); };
    },
  
    animate: function(fx_element) {
      fx_element.setStyles({'height': 0, 'top': fx_element.retrieve('height', fx_element.getSize().y), 'opacity': 0})
                .set('morph', {
                  'duration': this.options.duration / 2,
                  'onComplete': function() { if (fx_element.getSize().y === 0) fx_element.setStyles({'top': fx_element.retrieve('height'), 'opacity': 0}); }
                });
      
      this.show_fn = function(fx_element) { fx_element.morph({'height': fx_element.retrieve('height'), 'top': 0, 'opacity': 1}); };
      this.hide_fn = function(fx_element) { fx_element.morph({'height': 0, 'opacity': 0.5}); };
    }
  }
});




 window.addEvent('domready', function() {
      new Sprites2({mode: 'fade', item_selector: '#nav_fade a'});

    });
