//mootools image slideshow intro

var FaderHome = new Class({
        Implements: Options,
        options: {
                pause: 6000,
                duration: 6000,
                loop: true,
                onComplete: Class.empty,
                onStart: Class.empty
        },
        initialize: function(container,options) {
                this.setOptions(options);
                this.container = $(container);
				
				// zeigt den container an
				this.container.style.visibility="visible";
				
                this.imgs = this.container.getElements('img');
                this.imgs.setStyles({
                        'position':'relative',
                        'top':0,
                        'left':0,
                        'opacity':0,
						'z-index':15
                });
                this.imgs[0].setStyle('opacity',1);
                this.el = new Element('div',{'styles': {
                        'position':'relative',
						'z-index':15
            }});
            this.el.injectInside(this.container);
            this.el.adopt(this.imgs);
                this.next = 0;
                this.stop();
        },
        start: function() {
                this.show();
                this.periodical = this.show.bind(this).periodical(this.options.pause);
        },
        stop: function() {
                $clear(this.periodical);
        },
        show: function() {
                if (!this.options.loop && this.next==this.imgs.length-1) this.stop();
                this.next = (this.next==this.imgs.length-1)?0:this.next+1;
                var prev = (this.next==0)?this.imgs.length-1:this.next-1;
				this.imgs.set('tween', {duration: '2000'});	
				if(this.next==3) {
					this.imgs.set('tween', {duration: '0'});	
				}
                	this.imgs[this.next].fade('in');
                	this.imgs[prev].fade('out');
				//var FadeOut = function(){ this.imgs[prev].setStyle('opacity', 0); };
				//FadeOut.delay(5000);
				
        }

}); 

var FaderLevel2Right = new Class({
        Implements: Options,
        options: {
                pause: 6000,
                duration: 3000,
                loop: true,
                onComplete: Class.empty,
                onStart: Class.empty
        },
        initialize: function(container,options) {
                this.setOptions(options);
                this.container = $(container);
				
				// zeigt den container an
                this.imgs = this.container.getElements('img');
				this.container.setStyles({
                        'position':'relative',
						'top':10,
                        'left':0,
						'visibility':"visible",
						'width':540,
						'height':578,
				});
                this.imgs = this.container.getElements('img');
                this.imgs.setStyles({
                        'position':'absolute',
						'width':527,
						'height':575,
						'margin-top': 0,
						'margin-left': 0,
                        'opacity':0,
						'z-index':15
                });
                this.imgs[0].setStyle('opacity',1);
                this.el = new Element('div',{'styles': {
                        'position':'absolute',
						'z-index':15
            }});
            this.el.injectInside(this.container);
            this.el.adopt(this.imgs);
                this.next = 0;
                this.stop();
        },
        start: function() {
                this.show();
                this.periodical = this.show.bind(this).periodical(this.options.pause);
        },
        stop: function() {
                $clear(this.periodical);
        },
        show: function() {
                if (!this.options.loop && this.next==this.imgs.length-1) this.stop();
                this.next = (this.next==this.imgs.length-1)?0:this.next+1;
                var prev = (this.next==0)?this.imgs.length-1:this.next-1;
				this.imgs.set('tween', {duration: '4000'});	

                this.imgs[this.next].fade('in');
                this.imgs[prev].fade('out');
				//var FadeOut = function(){ this.imgs[prev].setStyle('opacity', 0); };
				//FadeOut.delay(5000);
				
        }

}); 

var FaderLevel2Left = new Class({
        Implements: Options,
        options: {
                pause: 6000,
                duration: 3000,
                loop: true,
                onComplete: Class.empty,
                onStart: Class.empty
        },
        initialize: function(container,options) {
                this.setOptions(options);
                this.container = $(container);
				
				// zeigt den container an
                this.imgs = this.container.getElements('img');
				this.container.setStyles({
                        'position':'relative',
						'top':0,
                        'left':0,
						'visibility':"visible",
						'width':460,
						'height':460,
				});
                this.imgs = this.container.getElements('img');
                this.imgs.setStyles({
                        'position':'absolute',
						'width':460,
						'height':460,
						'margin-top': 0,
						'margin-left': 0,
                        'opacity':0,
						'z-index':15
                });
                this.imgs[0].setStyle('opacity',1);
                this.el = new Element('div',{'styles': {
                        'position':'absolute',
						'z-index':15
            }});
            this.el.injectInside(this.container);
            this.el.adopt(this.imgs);
                this.next = 0;
                this.stop();
        },
        start: function() {
                this.show();
                this.periodical = this.show.bind(this).periodical(this.options.pause);
        },
        stop: function() {
                $clear(this.periodical);
        },
        show: function() {
                if (!this.options.loop && this.next==this.imgs.length-1) this.stop();
                this.next = (this.next==this.imgs.length-1)?0:this.next+1;
                var prev = (this.next==0)?this.imgs.length-1:this.next-1;
				this.imgs.set('tween', {duration: '4000'});	

                this.imgs[this.next].fade('in');
                this.imgs[prev].fade('out');
				//var FadeOut = function(){ this.imgs[prev].setStyle('opacity', 0); };
				//FadeOut.delay(5000);
				
        }

}); 

var FaderLevel2LeftWedding = new Class({
        Implements: Options,
        options: {
                pause: 6000,
                duration: 3000,
                loop: true,
                onComplete: Class.empty,
                onStart: Class.empty
        },
        initialize: function(container,options) {
                this.setOptions(options);
                this.container = $(container);
				
				// zeigt den container an
                this.imgs = this.container.getElements('img');
				this.container.setStyles({
                        'position':'relative',
						'top':0,
                        'left':0,
						'visibility':"visible",
						'width':460,
						'height':418,
				});
                this.imgs = this.container.getElements('img');
                this.imgs.setStyles({
                        'position':'absolute',
						'width':460,
						'height':418,
						'margin-top': 0,
						'margin-left': 0,
                        'opacity':0,
						'z-index':15
                });
                this.imgs[0].setStyle('opacity',1);
                this.el = new Element('div',{'styles': {
                        'position':'absolute',
						'z-index':15
            }});
            this.el.injectInside(this.container);
            this.el.adopt(this.imgs);
                this.next = 0;
                this.stop();
        },
        start: function() {
                this.show();
                this.periodical = this.show.bind(this).periodical(this.options.pause);
        },
        stop: function() {
                $clear(this.periodical);
        },
        show: function() {
                if (!this.options.loop && this.next==this.imgs.length-1) this.stop();
                this.next = (this.next==this.imgs.length-1)?0:this.next+1;
                var prev = (this.next==0)?this.imgs.length-1:this.next-1;
				this.imgs.set('tween', {duration: '4000'});	

                this.imgs[this.next].fade('in');
                this.imgs[prev].fade('out');
				//var FadeOut = function(){ this.imgs[prev].setStyle('opacity', 0); };
				//FadeOut.delay(5000);
				
        }

}); 

var FaderLevel2Home = new Class({
        Implements: Options,
        options: {
                pause: 6000,
                duration: 3000,
                loop: true,
                onComplete: Class.empty,
                onStart: Class.empty
        },
        initialize: function(container,options) {
                this.setOptions(options);
                this.container = $(container);
				
				// zeigt den container an
                this.imgs = this.container.getElements('img');
				this.container.setStyles({
                        'position':'relative',
						'top':0,
                        'left':0,
						'visibility':"visible",
						'width':460,
						'height':692,
				});
                this.imgs = this.container.getElements('img');
                this.imgs.setStyles({
                        'position':'absolute',
						'width':460,
						'height':692,
						'margin-top': 0,
						'margin-left': 0,
                        'opacity':0,
						'z-index':15
                });
                this.imgs[0].setStyle('opacity',1);
                this.el = new Element('div',{'styles': {
                        'position':'absolute',
						'z-index':15
            }});
            this.el.injectInside(this.container);
            this.el.adopt(this.imgs);
                this.next = 0;
                this.stop();
        },
        start: function() {
                this.show();
                this.periodical = this.show.bind(this).periodical(this.options.pause);
        },
        stop: function() {
                $clear(this.periodical);
        },
        show: function() {
                if (!this.options.loop && this.next==this.imgs.length-1) this.stop();
                this.next = (this.next==this.imgs.length-1)?0:this.next+1;
                var prev = (this.next==0)?this.imgs.length-1:this.next-1;
				this.imgs.set('tween', {duration: '4000'});	

                this.imgs[this.next].fade('in');
                this.imgs[prev].fade('out');
				//var FadeOut = function(){ this.imgs[prev].setStyle('opacity', 0); };
				//FadeOut.delay(5000);
				
        }

}); 
