$(document).ready(function () {
    $('.discobody').pulse({
        backgroundColors: ['#ff0000', '#ff00ff', '#0000ff', '#00ffff', '#ffff00'],
        speed: 420,
        duration: 0
    });
    $('#content').css('height', ($(window).height()) - 195);
    var indextitle = $('#index').text();
    indextitle.replace('_ZWEIDREI - ', '');
    $('.dreieck, .backbutton').hover(function () {
        $(this).pulse({
            backgroundColors: ['#ff0000', '#ff00ff', '#0000ff', '#00ffff', '#ffff00', '#ff0000', '#000000'],
            speed: 220,
            duration: 1400
        });
        var linkname = $(this).children(':first-child').attr('title');
        $('#index').html(linkname);
    }, function () {
        $('#index').html(indextitle);
    });
    $(function () {
        $('#content').wrapInner(document.createElement('tr'));
        $('#content').wrapInner(document.createElement('table'));
        $('.column').wrap('<td>');
    });
    $(window).bind('resize', resizeWindow);
    $('.thispage').pulse({
        backgroundColors: ['#ff0000', '#ff00ff', '#0000ff', '#00ffff', '#ffff00', '#ff0000', '#000000'],
        speed: 220,
        duration: 0
    });
    function resizeWindow(e) {
        var newWindowHeight = ($(window).height() - 195);
        $('#content').css('height', newWindowHeight);
    }
    $.fn.clearOnFocus = function() {
      return this.focus(function() {
        if(this.value == this.defaultValue) {
          this.value = '';
        }
      }).blur(function() {
      if(!this.value.length) {
        this.value = this.defaultValue;
      }
      });
    };
    $('.clearfocus').clearOnFocus();
    $('.dreieck').addClass('black');
    $('.energy').addClass('green');
    $('.backbutton').addClass('black');

    $('.energy').hover(function () {
      $(this).pulse({
          backgroundColors: ['#00a549', '#006c30', '#41b900', '#e7fff2', '#eaff00', '#97f404', '#005928'],
          speed: 220,
          duration: 1400
      });
    });
    $('.energy.thisGREEN').pulse({
        backgroundColors: ['#00a549', '#006c30', '#41b900', '#e7fff2', '#eaff00', '#97f404', '#005928'],
        speed: 220,
        duration: 0
    });
});

