var selector = 'div.kartenInfo';
var context	 = 'div#kartenInfos';
var speed	 = 'normal';


document.write('<style type="text/css">');
document.write('#advancedSearch,#fNav{display:none;}');
if(jQuery.cookie('fontSize')!=null) {
   document.write('#left{font-size:'+jQuery.cookie('fontSize')+'px}');
}
document.write('</style>');

$(document).ready(function() {

   if(jQuery.browser.msie && jQuery.browser.version < 7) {

      /*fix für transparente PNGs*/
      DD_belatedPNG.fix('#wrap, #navigation li a, #navigation li a span, #navigation ul li a, #folgeseite #content, #startseite #content, #startseite #left, #fontSizer, a.arrow, ul#sitemap li a, #startHead, #listview_back a, #listview_next a, a.back, a.next, .button, .button .b1, .button .b2, .button .b3, .button .b4');

      /*fix für #statHead auf startseite, verursacht durch vorherigen fix*/
      $.rule('#startHead','style').append('top:7px;');

   }




   /*Back-Link einfügen*/
   if(history && history.length && history.length>0) {
      $("#fNav").prepend('<li><a href="javascript:history.back();">Zurück</a></li>');
   }

   //Externe Links in neuem Fenster öffnen
   $("#content a[href^='http://'],#content a[href^='https://']").not("a[href^='http://"+window.location.host+"'],a[href^='https://"+window.location.host+"']").not("a[href^='http://www."+window.location.host+"'],a[href^='https://www."+window.location.host+"']").not("a[target=_self]").click(function(){
      window.open(this.href);
      return false;
   });


   /*Font Size Switcher*/
   $("#serviceNav>li.last").removeClass("last").after('<li class="last" id="fontSizer"><span>Textgröße:</span><a id="fs12" class="active"></a><a id="fs16"></a><a id="fs20"></a></li>');
   if($.cookie('fontSize')!=null) {
      switchFontsize($.cookie('fontSize'),1);
   }
   $("#fontSizer #fs12").click(function(){
      switchFontsize(12);
   });
   $("#fontSizer #fs16").click(function(){
      switchFontsize(16);
   });
   $("#fontSizer #fs20").click(function(){
      switchFontsize(20);
   });
   function switchFontsize(size,initial) {
      if(initial==null) {
         $.cookie('fontSize', size,{ path: '/' });
         $("#left").animate({fontSize: size},300);
      }
      $("#fontSizer a").removeClass("active");
      $("#fs"+size).addClass("active");
   }

try {
   if(!($.browser.mozilla && parseFloat($.browser.version)<=1.8) && !($.browser.msie && $.browser.version<7)) { /*wenn nicht Firefox 2*/

      /*Hover-Effekte für Buttons*/
      $(".button").not(".active").not(".bSmall").each(function(){
            $(this).attr("initialBackgroundColor",$.rule('#right .button','link').css("backgroundColor"));
            $(this).attr("initialColor",$.rule('#right .button','link').css("color"));
            $(this).attr("hoverBackgroundColor",$.rule('#right .button:hover','link').css("backgroundColor"));
            $(this).attr("hoverColor",$.rule('#right .button:hover','link').css("color"));
      }).hover(
         function() {
            $(this).stop().css({
               "backgroundColor": $(this).css("background-color"),
               "color": $(this).css("color")
            }).animate({
               "backgroundColor": $(this).attr("hoverBackgroundColor"),
               "color": $(this).attr("hoverColor")
            }, 200);
         },
         function(){
            $(this).stop().css({
               "backgroundColor": $(this).css("background-color"),
               "color": $(this).css("color")
            }).animate({
               "backgroundColor": $(this).attr("initialBackgroundColor"),
               "color": $(this).attr("initialColor")
            }, 200);
         }
      );
      $.rule('#right .button:hover','link').remove();

      /*Hover-Effekte für Navigation*/
      $("#navigation>li>a").not(".active").each(function(){
            $(this).attr("initialBackgroundColor",$.rule('#navigation li a','link').css("backgroundColor"));
            $(this).attr("initialColor",$.rule('#navigation li a','link').css("color"));
            $(this).attr("hoverBackgroundColor",$.rule('#navigation li a:hover','link').css("backgroundColor"));
            $(this).attr("hoverColor",$.rule('#navigation li a:hover','link').css("color"));
      }).hover(
         function() {
            $(this).stop().css({
               "backgroundColor": $(this).css("background-color"),
               "color": $(this).css("color")
            }).animate({
               "backgroundColor": $(this).attr("hoverBackgroundColor"),
               "color": $(this).attr("hoverColor")
            }, 200);
         },
         function(){
            $(this).stop().css({
               "backgroundColor": $(this).css("background-color"),
               "color": $(this).css("color")
            }).animate({
               "backgroundColor": $(this).attr("initialBackgroundColor"),
               "color": $(this).attr("initialColor")
            }, 200);
         }
      );
      $.rule('#navigation li a:hover','link').remove();

      /*Hover-Effekte für Font size Switcher*/
      $("#fontSizer a").each(function(){
            $(this).attr("initialBackgroundColor",$.rule('#fontSizer a','link').css("backgroundColor"));
            $(this).attr("hoverBackgroundColor",$.rule('#fontSizer a:hover','link').css("backgroundColor"));
      }).hover(
         function() {
            $(this).stop().css({
               "backgroundColor": $(this).css("background-color")
            }).animate({
               "backgroundColor": $(this).attr("hoverBackgroundColor")
            }, 200);
         },
         function(){
            $(this).stop().css({
               "backgroundColor": $(this).css("background-color")
            }).animate({
               "backgroundColor": $(this).attr("initialBackgroundColor")
            }, 200);
         }
      );
      $.rule('#fontSizer a:hover','link').remove();

   }
   else { //wenn Firefox 2

      //Korrektur Position Font Size Switcher
      $("#serviceNav li.last a").css("margin-top","1px");

   }
} catch(e) {}
   



   //Top-Link einfügen, wenn seite scrollbar ist
   if($(document).height()<=$.viewportHeight()+10)
      $("#topLink").hide();

   $(window).bind('resize', function() {
      if($(document).height()<=$.viewportHeight()+10)
         $("#topLink").hide();
      else
         $("#topLink").show();
   });
   $("#fNav").show();






});
