$(document).ready(function(jQuery) {

  $typo = $('.typo');
  
  // ie < 7.0 kann kein li:hover
  if ($.browser.msie && $.browser.version < '7') {
    var ie6navigation = function(e) {
      if (this.hovering) {
        this.hovering = false;
      } else {
        this.hovering = true;
      }
      $(this).toggleClass('hover');
    };
    function buttonHover(e) {
      ie6navigation.call(this, e);
      $(this.parentNode).toggleClass(this.className);
    }
    function hideInputs(e) {
      ie6navigation.call(this, e);
      $(this).nextAll().find('input, select').toggle();
    }
    $('.Navigation li').hover(ie6navigation, ie6navigation);
    $('.send input').hover(ie6navigation, ie6navigation);
    $('.typo .homeTeaser a').hover(ie6navigation, ie6navigation);
    
    
  }
  
  // schriftgrößen
  $("a#toggleMinus").bind('click', function() {
    $("body").addClass("minus");
    $("body").removeClass("standard");
    $("body").removeClass("plus");
    return false;
  });
  $("a#toggleStandard").bind('click', function() {
    $("body").addClass("standard");
    $("body").removeClass("minus");
    $("body").removeClass("plus");
    return false;
  });
  $("a#togglePlus").bind('click', function() {
    $("body").addClass("plus");
    $("body").removeClass("standard");
    $("body").removeClass("minus");
    return false;
  });
  
  // openLayer-Link 
  $("a.openLayer").addClass("borderWhite");
  
  //runde Ecken
  $(".frmButton").corner("4px ");
  $(".borderWhite").corner("6px ");
  
  $('.roundCorner').corner("6px");
  $('.roundCornerTop').corner("6px top");
  $('.roundCornerBottom').corner("6px bottom");
  
  $('.serviceList').find('h3 a').click(function(e) {
    $(this.parentNode.parentNode).toggleClass('aktiv').siblings().removeClass('aktiv');
    return false;
  });
  
  // popup-fenster
  var mini;
  function pop() {
    var a = this.href;
    mini = window.open(a, 'Glossar', 'toolbar=0,location=0,directories=0,status=0,menubar=1,menubar=yes, scrollbars=1,resizable=0,copyhistory=0,height=760,width=640,top=0,left=0');
    mini.focus();
    return false;
  }
  $('a.pop').click(pop);
  
  
  //	// schnelleinstieg
  //	$('#Einstieg1').schnelleinstieg();
  //	// schnelleinstieg
  //	$('#Einstieg2').schnelleinstieg();
  //	
  correctPNG();
});

if (navigator.appName.indexOf("Explorer") != -1 && navigator.appVersion < '7') {
  document.write('\<link rel="Stylesheet" href="../../cms-layout/jscript/css/ie6.css" type="text/css">')
}

// transparentes PNG für IE6
function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
  var arVersion = navigator.appVersion.split("MSIE")
  var version = parseFloat(arVersion[1])
  if ((version < 7) && (version >= 5.5) && (document.body.filters)) {
    for (var i = 0; i < document.images.length; i++) {
      var img = document.images[i]
      var imgName = img.src.toUpperCase()
      
      if (imgName.substring(imgName.length - 3, imgName.length) == "PNG") {
        if (img.width) {
          var imgID = (img.id) ? "id='" + img.id + "' " : ""
          var imgClass = (img.className) ? "class='" + img.className + "' " : ""
          var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
          var imgStyle = "display:inline-block;" + img.style.cssText
          if (img.align == "left") imgStyle = "float:left;" + imgStyle
          if (img.align == "right") imgStyle = "float:right;" + imgStyle
          if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle
          var strNewHTML = "<span " + imgID + imgClass + imgTitle +
          " style=\"" +
          "width:" +
          img.width +
          "px; height:" +
          img.height +
          "px;" +
          imgStyle +
          ";" +
          "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" +
          "(src=\'" +
          img.src +
          "\');\"></span>";
          img.outerHTML = strNewHTML;
          i = i - 1;
        }
      }
    }
  }
}


