/* 
------------------------
sounds
------------------------
*/

var topvisualSounds = ( function ($) {

    return {
        
        init : function () {

          //initialize player
          $("#abendmahl-player").jPlayer({
            ready: function (event) {
              $('.abendmahl img').css('display', 'block');
          },
            swfPath: "/wp-content/themes/dennisundjesko/jplayer",
            supplied: "mp3",
            wmode: "window"
          });

          //Arne
          $('#arne').click(function() {
            $("#abendmahl-player").jPlayer("setMedia", {
              mp3:"/wp-content/themes/dennisundjesko/sounds/arne.mp3"
            });
            $("#abendmahl-player").jPlayer("play");

            return false;
          });

          //Schlueter
          $('#schlueter').click(function() {
            $("#abendmahl-player").jPlayer("setMedia", {
              mp3:"/wp-content/themes/dennisundjesko/sounds/schlueter.mp3"
            });
            $("#abendmahl-player").jPlayer("play");

            return false;
          });

          //Renate
          $('#renate').click(function() {
            $("#abendmahl-player").jPlayer("setMedia", {
              mp3:"/wp-content/themes/dennisundjesko/sounds/renate.mp3"
            });
            $("#abendmahl-player").jPlayer("play");

            return false;
          });

          //Fiete
          $('#fiete').click(function() {
            $("#abendmahl-player").jPlayer("setMedia", {
              mp3:"/wp-content/themes/dennisundjesko/sounds/fiete.mp3"
            });
            $("#abendmahl-player").jPlayer("play");

            return false;
          });

          //Olaf
          $('#olaf').click(function() {
            $("#abendmahl-player").jPlayer("setMedia", {
              mp3:"/wp-content/themes/dennisundjesko/sounds/olaf.mp3"
            });
            $("#abendmahl-player").jPlayer("play");

            return false;
          });

          //Doerte
          $('#doerte').click(function() {
            $("#abendmahl-player").jPlayer("setMedia", {
              mp3:"/wp-content/themes/dennisundjesko/sounds/doerte.mp3"
            });
            $("#abendmahl-player").jPlayer("play");

            return false;
          });

          //Helga
          $('#helga').click(function() {
            $("#abendmahl-player").jPlayer("setMedia", {
              mp3:"/wp-content/themes/dennisundjesko/sounds/helga.mp3"
            });
            $("#abendmahl-player").jPlayer("play");

            return false;
          });

          //Otto
          $('#otto').click(function() {
            $("#abendmahl-player").jPlayer("setMedia", {
              mp3:"/wp-content/themes/dennisundjesko/sounds/otto.mp3"
            });
            $("#abendmahl-player").jPlayer("play");

            return false;
          });

          //Supermanfred
          $('#manfred').click(function() {
            $("#abendmahl-player").jPlayer("setMedia", {
              mp3:"/wp-content/themes/dennisundjesko/sounds/manfred.mp3"
            });
            $("#abendmahl-player").jPlayer("play");

            return false;
          });

          //Guenther
          $('#guenther').click(function() {
            $("#abendmahl-player").jPlayer("setMedia", {
              mp3:"/wp-content/themes/dennisundjesko/sounds/guenther.mp3"
            });
            $("#abendmahl-player").jPlayer("play");

            return false;
          });

          //Hardy
          $('#hardi').click(function() {
            $("#abendmahl-player").jPlayer("setMedia", {
              mp3:"/wp-content/themes/dennisundjesko/sounds/hardi.mp3"
            });
            $("#abendmahl-player").jPlayer("play");

            return false;
          });

          //Jordy
          $('#jordi').click(function() {
            $("#abendmahl-player").jPlayer("setMedia", {
              mp3:"/wp-content/themes/dennisundjesko/sounds/jordi.mp3"
            });
            $("#abendmahl-player").jPlayer("play");

            return false;
          });


        }

    }

})(jQuery);

/* 
------------------------
tooltips
------------------------
*/

var topvisualTooltips  = ( function ($) {

    return {
        
        init : function () {
            
            $("map#abendmahl *").tooltip({showURL:false, track:true, delay: 300});
            $("map#abendmahl *").mouseover(function(){
                $('#tooltip').removeClass();
                $('#tooltip').addClass($(this).attr('id'));
            });
        }

    }

})(jQuery);

/* 
------------------------
table menu if less ie8
------------------------
*/

var tableMenu = ( function ($) {

    return {
        
        init : function () {
            if ($.browser.msie && $.browser.version <= 7)
            {
              $("#access li").wrap("<td />");
              $("#access ul").wrap("<tr />");
              $("#access div.menu").wrapInner("<table cellpadding=\"0\" cellspacing=\"0\" />");
            }
        }

    }

})(jQuery);


/* 
------------------------
init on domready
------------------------
*/

jQuery(document).ready(function() {
    topvisualSounds.init();
    topvisualTooltips.init();    
    tableMenu.init();
});


