if($) {
  var wrapperWidth = $(".teaserItem").length * 799 + "px";
  $(".teaserItemWrapper").css({
    'width': wrapperWidth,
    'position': 'absolute'
  });
  
  $(".teaserItemWrapper > div").each(function(index) {
    $('<a href="#" class="teaserControlBadge">  </a>').click(function() {
      $(this).addClass("teaserControlBadgeSelected")
        .siblings(".teaserControlBadgeSelected")
          .removeClass("teaserControlBadgeSelected");
      itemPosition = $(".teaserItem").eq(index).position();
      $(".teaserItemWrapper").stop().animate({"left": "-"+itemPosition.left}, 750, "easeInOutCubic");
      return false;
    }).appendTo(".teaserControl");
    $(".teaserControl a:first").click();
  });
  $(".teaserControlBadge:first").click();
  
  $(".teaserControlRight").click(function(){
    $(".teaserControl > .teaserControlBadgeSelected").next(".teaserControlBadge").click();
    return false;
  })
  
  $(".teaserControlLeft").click(function(){
    $(".teaserControl > .teaserControlBadgeSelected").prev(".teaserControlBadge").click();
    return false;
  })

  $(".pageNavigation a, .subNavigation a, .teaserControl a").click(function() {
    $(this).blur();
  })
}
