/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


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

       $$('ul.level_1 li a.active').set('background-position', '-104px 0px');

    var list = $$('ul.level_1 li a:not(.active)');
    list.each(function(element) {


        element.addEvents({
            mouseover: function() {
                this.set('tween', {
                    duration: 400,
                    wait:false

                });

                this.tween('background-position','-10px 0px')
            },
            mouseout: function() {
                this.set('tween', {
                    duration: 200,
                    wait:false

                });
                this.tween('background-position','0px 0px')

            }
        });
    });



  /* ajax replace element text */
  $$('a.slide').addEvent('click', function(event) {
    //prevent the page from changing
    event.stop();
    //make the ajax call, replace text
    var req = new Request.HTML({
      method: 'get',
      url: this.get('href'),
      data: { 'do' : '1' },
      onRequest: function() { alert('Request made. Please wait...' + this.get('value'));  },
      update: $('message-here'),
      onComplete: function(response) { alert('Request completed successfully.'); $('message-here').setStyle('background','#fffea1');
      }
    }).send();
  });




              // $('favicon').getFavicons('linkliste_wrapper', false); // class, extensions

});


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

$$('div.referenzen div.image_border').each(function(div){
	div.set('tween', {duration: '450'});
	div.addEvents({
		'mouseover': function(){
			$(this).set('opacity', '0.6');
		},
		'mouseout': function(){
			$(this).tween('opacity', '1');
		}
	});

});

});

