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

	if(Browser.Engine.name == 'trident' && Browser.Engine.version < 5){
		$$('#prodmenue-pu dl').removeProperty('style');
		$$('#prodmenue-us dl').removeProperty('style');
		//alert('hallo');
	}

	//Einblenden Seite

	if($('content')){
		var myFx = new Fx.Morph($('content')).set({
			'opacity': 0
		});
		
		var morph = new Fx.Morph($('content'), {duration: 500, transition: Fx.Transitions.Sine.easeOut});
		morph.start({'opacity': 1});
	}
		
	if($('prodmenuelist')){
	  $('prodmenuelist').getElements('a').addEvent('click', function(){
		  var prodscroll = $('prodmenue-ad').getScroll();
		  $each($('prodmenuelist').getElements('a'), function(val){
			  var srclink = val.getProperty('href');
			  val.setProperty('href',srclink + '&x=' + prodscroll.x);
		  });
	  });
	}

	if($('scrollx')){
		if($('prodmenue-ad')){
			$('prodmenue-ad').scrollTo($('scrollx').value,0);
		}else if($('prodmenue-vt')){
			$('prodmenue-vt').scrollTo($('scrollx').value,0);
		}
	}
	
	
	//seldiv = $('seldivv').value;
	if($('selidd') &&($('selidd').value == 'ad' || $('selidd').value == 'vt')){
		if($('selidd').value == 'ad'){
		  $('m-ad').setStyle('background-image','url(basic/bg-ad-button-ie7.gif)');
		  $('m-ad').setStyle('background-position','left bottom');
		  $('m-ad').setStyle('background-repeat','no-repeat');
		}else if($('selidd').value == 'vt'){
		  $('m-vt').setStyle('background-image','url(basic/bg-ht-button-ie7.gif)');
		  $('m-vt').setStyle('background-position','left bottom');
		  $('m-vt').setStyle('background-repeat','no-repeat');
		}
		//alert($('selidd').value);
	}
	
	
	/****************Logowechsel ****************/
	
	if($('logo-teaser1') && $('logo-teaser2')) { 
    $('logo-teaser1').fade('hide');
	$('logo-teaser2').fade('hide');
    var teaser1 =      new Fx.Tween($('logo-teaser1'),      { duration: 'long' });
    var teaser2 =      new Fx.Tween($('logo-teaser2'),      { duration: 'long' });
    (function() { teaser1.start('opacity', 1); changeTeaser1()	; }).delay(250);
    //(function() { teaserImg1.start('opacity', 1); teaserImgTitle1.start('opacity', 1); changeTeaser1(); }).delay(250);

    function changeTeaser1() {
      (function() { /*teaser1.start('opacity', 0);*/
                    teaser2.start('opacity', 1);
                    changeTeaser2();
                  }).delay(1000);
    }
    
	function changeTeaser2() {
      (function() { teaser2.start('opacity', 0);
                    teaser1.start('opacity', 0);
                    changeTeaser3();
                  }).delay(4000);
    }
	
	function changeTeaser3() {
      (function() {teaser1.start('opacity', 1);
                    changeTeaser1();
                  }).delay(4000);
    }
	
   }

	
	/**
				 * Some options for the large photos.
				 *
				 * The first argument is the argument for $$ (can be an array of elements or a selector)
				 */
	if($$('#content a.rem') != ''){	 
				ReMooz.assign('#content a.rem', {
					'origin': 'img',
					'shadow': 'onOpenEnd', // fx is faster because shadow appears after resize animation
					'resizeFactor': 0.8, // resize to maximum 80% of screen size
					'cutOut': false, // don't hide the original
					'opacityResize': 0.4, // opaque resize
					'dragging': false, // disable dragging
					'centered': true // resize to center of the screen, not relative to the source element
				});
			 
				/**
				 * Note on "shadow": value can be true, onOpenEnd (appear after resize) and false, to disable shadow
				 * WebKit (Safari 3) uses (great looking) CSS shadows, so it ignores this option.
				 */
	}
	
});	
	
/*
$$('#refprojektlist li').addEvents({
			mouseenter: function(){	
			var morph = new Fx.Morph('img' + this.id, {duration: 200, transition: Fx.Transitions.Sine.easeOut});
			morph.start({'opacity': 0});
		},
		mouseleave: function(){
			var morph = new Fx.Morph('img' + this.id, {duration: 200, transition: Fx.Transitions.Sine.easeOut});
			morph.start({'opacity': 1});
		}
	});

*/	