$(document).ready(function() {

   $('a.colorbox').colorbox();

   $('body').removeClass('nojs');

   $('#spendenGallery ul li:not(.einfach):not(.mehrfach) a img').hover(function(){
      $(this).stop().fadeTo(50, 1);
   },function(){
      $(this).stop().fadeTo("slow", 0.3);
   });

try {//ie mal wieder zu blöd
   $("#spendenGallery ul li[title]").tooltip({ position: "top right", opacity: 0.9, offset: [10,-77], effect: 'slide',
      onBeforeShow: function() {
         if(this.getTip().html().match(/^(.+): (.+)$/i)) {
            this.getTip().html('<div class="xasd"><span class="nupsi"></span><span class="icon"></span><div class="dasx">'+RegExp.$1+'</div>'+RegExp.$2+'</div>');
            if(this.getTrigger().hasClass('einfach')) {
               this.getTip().find('span.icon').addClass('einfach');
            }
            else if(this.getTrigger().hasClass('mehrfach')) {
               this.getTip().find('span.icon').addClass('mehrfach');
            }
         }
         else if(this.getTrigger().hasClass('frei') && !this.getTip().hasClass('tooltip_frei')) {
            this.getTip().html('<div class="xasd"><span class="nupsi"></span><span class="icon"></span><div class="dasx">'+this.getTip().html()+'</div></div>');
            this.getTip().addClass('tooltip_frei');
         }
      },
      onHide: function() {
         this.hide();
      }
   });
   $("#spendenGallery li.frei a").colorbox({opacity:0.5,iframe:true, innerWidth:528, innerHeight:600});
}
catch(e){}


/*
   $('a.external,a[href^="http://"]').attr("target", "_blank");
*/
   $.preload([ 'suche_go_hover', 'versenden_hover', 'drucker_hover', 'navi_pfeil_orange' ], {
       base:'/_img/icons/',
       ext:'.gif'
   });
   $(document).ready(function(){
      $('.button').each(function(){
         $(this).html('<i></i><span><span></span><i></i>'+ $(this).html() +'</span>');
      });
   });
});


function StopSound(SoundID)
{
 if(document.all && (navigator.appName.indexOf('Opera') == -1))
 {
  document.MediaPlayer.stop();
 } else
 {
  document.getElementById(SoundID).Stop();
 }
}
function PlaySound(SoundID)
{
 if(document.all && (navigator.appName.indexOf('Opera') == -1))
 {
  document.MediaPlayer.play();
 } else
 {
  document.getElementById(SoundID).Play();
 }
}

