/* TYPO3 UnCryptMailto */
var browserName=navigator.appName;var browserVer=parseInt(navigator.appVersion);var version="";var msie4=(browserName=="Microsoft Internet Explorer"&&browserVer>=4);if((browserName=="Netscape"&&browserVer>=3)||msie4||browserName=="Konqueror"||browserName=="Opera"){version="n3";}else{version="n2";}
function blurLink(theObject){if(msie4){theObject.blur();}}
function decryptCharcode(n,start,end,offset){n=n+offset;if(offset>0&&n>end){n=start+(n-end-1);}else if(offset<0&&n<start){n=end-(start-n-1);}
return String.fromCharCode(n);}
function decryptString(enc,offset){var dec="";var len=enc.length;for(var i=0;i<len;i++){var n=enc.charCodeAt(i);if(n>=0x2B&&n<=0x3A){dec+=decryptCharcode(n,0x2B,0x3A,offset);}else if(n>=0x40&&n<=0x5A){dec+=decryptCharcode(n,0x40,0x5A,offset);}else if(n>=0x61&&n<=0x7A){dec+=decryptCharcode(n,0x61,0x7A,offset);}else{dec+=enc.charAt(i);}}
return dec;}
function linkTo_UnCryptMailto(s){location.href=decryptString(s,-2);}

/* powermail dummy */
function Validation() {}

jQuery(document).ready(function() {

  /* Startseite BEGIN */
  if( $('body.start').length ) {

    var elements = {
      'div1' : { start: 10, distance: 100, duration: 1500},
      'div2' : { start: 30, distance: 600, duration: 1000}
    }
    $('.box').each(function (k, v) {
      var i = elements[v.id];
      $(v).css('left', i.start + 'px').animate({left: (i.start + i.distance) + 'px'}, i.duration);
    });

    $('#chairman').fadeIn(1000, function () {
      $('.homepage #bar').fadeIn(1000, function () {
        $('#menu_top').slideDown(1000);
        $('#menu_bottom').slideDown(1000, function () {
          $('#metanav').show();
          $('#icon_w').show();
          $('#ticker').show().vTicker({
            speed: 500, pause: 3000, showItems: 1, animation: 'fade', mousePause: true
          });
          if($('#content_top').html().length) { $('#content_top').fadeIn(); }
          if($('#content_bottom').html().length) { $('#content_bottom').fadeIn(); }
        });
      });
    });

    //if ( $('#content_top div').length ) $('#content_top').show();
    }
    /* Startseite END */


    /* Inhaltsseiten BEGIN */
    if( $('body:not(.start)') ) {
  
    $('div.holder').jScrollPane({
      showArrows: true
    });

    $("a.popup").fancybox({ 'hideOnContentClick':false });
    $("a.internal-popup").fancybox({ 'hideOnContentClick':false });
    $("a.download-popup").fancybox({ 'hideOnContentClick':false });
    $("area.popup").fancybox({ 'hideOnContentClick':false });
  }
  /* Inhaltsseiten END */

  $('#chairman').vibrate({
    speed:     30, 
    duration:  1000, 
    frequency: 10000, 
    spread:    3
  });
  
  $('a.sequencer').css('backgroundPosition', "-81px "+ ($(this).outerHeight()-2) +"px");
  $('a.sequencer').bind('mouseenter',function(e){
    var a = $(this);
    a.animate({'backgroundPosition': a.outerWidth() + "px "+ (a.outerHeight()-2) +"px"},600);
  });
  $('a.sequencer').bind('mouseleave',function(e){
    var a = $(this)
    a.animate({'backgroundPosition': "-81px "+ (a.outerHeight()-2) +"px"},600);
  });
});