(function($){
		
		$('#mainMenu').slideMenu();
		
        $('.immRot').each(
        function(){

            var that = this;
            var t = false;
            var l = $('img',$(this)).length;
            var timeout = 5000;
            var fadespeed = 3000;

            that.initFade = function(){
                that.display(1);
            }

            that.display = function(i){

                $('img',$(that)).fadeOut(fadespeed);
                $('.immRot img',$(that)).load(
                    function(){
                        $(this).stop(false,true).fadeIn(fadespeed);
                    }
                    );
                $('img:eq('+i+')',$(that)).fadeIn(fadespeed);

                t = window.setTimeout(
                    function(){
                        that.display((i+1)%l);
                    },
                    timeout
                    );

            }

            $('img:first',$(this)).show();

            if(l>1){
                window.setTimeout(
                    function(){
                        that.initFade();
                    },
                    timeout
                    );
            }

        }

        );


            $('.immRot2').each(
        function(){

            var that = this;
            var t = false;
            var l = $('.img',$(this)).length;
            var timeout = 5000;
            var fadespeed = 3000;

            that.initFade = function(){
                that.display(1);
            }

            that.display = function(i){

                $('.img',$(that)).fadeOut(fadespeed);
                $('.immRot .img',$(that)).load(
                    function(){
                        $(this).stop(false,true).fadeIn(fadespeed);
                    }
                    );
                $('.img:eq('+i+')',$(that)).fadeIn(fadespeed);

                t = window.setTimeout(
                    function(){
                        that.display((i+1)%l);
                    },
                    timeout
                    );

            }

            $('.img:first',$(this)).show();

            if(l>1){
                window.setTimeout(
                    function(){
                        that.initFade();
                    },
                    timeout
                    );
            }

        }

        );

})(this.$);
