/* WEBUNG */

  function banner (type,oms) {
    if ( typeof(oms) == "undefined" ) { var oms = ""; }
    if ( typeof(WLRCMD) == "undefined" ) { var WLRCMD = ""; }
    if ( typeof(adlink_randomnumber) == "undefined" ) { var adlink_randomnumber = Math.floor ( Math.random() * 10000000000 ); }
    if ( type == "superbanner" ) { sz = "728x90"; tile = 1; }
    if ( type == "skyscraper" ) { sz = "120x600"; tile = 2; }
    if ( type == "rectangle" ) { sz = "300x250"; tile = 3; }
    document.write('<scr'+'ipt language="JavaScript" src="http://ad.de.doubleclick.net/adj/oms.westline.de/homepage;oms='+oms+';nielsen=2;dcopt=ist;'+WLRCMD+';sz='+sz+';tile='+tile+';ord='+adlink_randomnumber+'?"></script>');
  }


  function pinboard_start () { return true; }

  $(document).ready(function(){

    // noscript-Klassen werden entfernt
    
    if ( $(".noscript").length != 0 ) {
      $(".noscript").each(function(){
        $(this).removeClass("noscript");
      });
    }

    // Multimedia-Box

    $(".multimedia .right").click(function(){
      var left = ( Math.round ( $(this).parent().find(".scroller").scrollLeft() / 223 ) + 1 ) * 223;
      $(this).parent().find(".scroller").animate({"scrollLeft": left },"fast");
    });

    $(".multimedia .left").click(function(){
      var left = ( Math.round ( $(this).parent().find(".scroller").scrollLeft() / 223 ) - 1 ) * 223;
      $(this).parent().find(".scroller").animate({"scrollLeft": left },"fast");
    });

    // Topscroller

    if ( $("#topscroller TABLE").length == 1 ) {
      $("#topscroller .scroller TR").html($("#topscroller .scroller TR").html()+$("#topscroller .scroller TR").html());
    }

    $("#topscroller .right").click(function(){
      var pos = Math.round ( $(this).parent().find(".scroller").scrollLeft() / 243 );
      var max = $(this).parent().find("TD").length;
      if ( pos >= max/2 ) {
        pos = 0;
        var left = 0;
        $(this).parent().find(".scroller").scrollLeft(left);
      }
      var left = ( pos + 1 ) * 243;
      $(this).parent().find(".scroller").animate({"scrollLeft": left },"fast");
    });

    $("#topscroller .left").click(function(){
      var pos = Math.round ( $(this).parent().find(".scroller").scrollLeft() / 243 );
      var max = $(this).parent().find("TD").length;
      if ( pos == 0 ) {
        pos = max/2;
        var left = pos*243;
        $(this).parent().find(".scroller").scrollLeft(left);
      }
      var left = ( pos - 1 ) * 243;
      $(this).parent().find(".scroller").animate({"scrollLeft": left },"fast");
    });
    
    // contentBox listnavi
    
    $(".contentBox .listnavi").each(function(){
      $(this).find("LI").eq(0).addClass("active");
      $(this).parent().find(".list").addClass("hidden");
      $(this).parent().find(".list").eq(0).removeClass("hidden");
    });
        
    $(".contentBox .listnavi LI").click(function(){
      $(this).parent().find("LI").removeClass("active");
      $(this).addClass("active");
      var index = $(this).parent().find("LI").index(this);
      $(this).parent().parent().find(".list").addClass("hidden");
      $(this).parent().parent().find(".list").eq(index).removeClass("hidden");
    });

    $("A[name='lightbox']").click(function(){
      $("#lightbox").fadeIn();
      var link = $(this).attr("href");
      $("#lightbox").load(link+" #grossesBild");
      return false;
    });    

    $("#lightbox").click(function(){
      $("#lightbox").html("&nbsp;");
      $(this).fadeOut();
    });


  });

/* WETTERBOX */

function wettertagwechsel(id) {
  for(i=0;i<document.getElementById('wetter_hws_header').getElementsByTagName('td').length;i++){
    if(i==id){
      document.getElementById('wetter_hws_header').getElementsByTagName('td')[i].className = "hws_wetter_head_active";
    } else {
      document.getElementById('wetter_hws_header').getElementsByTagName('td')[i].className = "hws_wetter_head";
    }
  }
  document.getElementById('tagesmaximum').innerHTML = wetterdaten[id]["tagesMaximum"];
  document.getElementById('nachtminimum').innerHTML = wetterdaten[id]["nachtMinimum"];
  document.getElementById('wetterSymbolTag').src = wetterdaten[id]["wetterSymbolTag"];
  document.getElementById('wetterSymbolNacht').src = wetterdaten[id]["wetterSymbolNacht"];
  document.getElementById('wetterzustandtag').innerHTML = wetterdaten[id]["wetterzustandTag"];
  document.getElementById('wetterzustandnacht').innerHTML = wetterdaten[id]["wetterzustandNacht"];
}
