$(function() {
  
  $("div.slider_big > ul").each(function() {
    $(this)
      .after('<div class="nav">') 
      .cycle({ 
          speed:   800, 
          timeout: 5000, 
          pager:   'div.slider_big .nav',
          pause:   true
      });
  });
  
  $("div.slider_home > ul").each(function() {
    $(this)
      .cycle({
          speed:   800, 
          timeout: 5000, 
          pause:   true
      });
  });
  
  $("div.slider_horiz").each(function() {
    $img = $("span.image", $(this));
    mgl = -1;
    setInterval(function() {
      mgl-=1;
      $img.css("marginLeft", mgl+"px");
    }, 20);
  });
  
  if($("div.video_retro_container").length) {
    $("div.playlist a").each(function() {
      $(this).click(function(){
        $("div.video_retro_container").hide();
        $("div.video_retro_container#"+$(this).attr("rel")).show();
      });
    });
    $("div.playlist a:first").trigger("click");
  }

});

if (typeof $.fn.cycle != "undefined")
{
  $.fn.cycle.transitions.scrollLeft = function($cont, $slides, opts) {
    $cont.css('overflow','hidden');
    opts.before.push($.fn.cycle.commonReset);
    var w = $cont.width();
    opts.cssFirst = { left: 0 };
    opts.cssBefore= { left: w, top: 0 };
    opts.animIn   = { left: 0 };
    opts.animOut  = { left: 0-w };
  };
 
 

}


function removeFlash() {

$("div#teaser").remove();

}
