$(document).ready(function () {

//Animation des Menüs
$('ul.menu li.parent>ul').hide();
$('ul.menu li#current').show();
$('ul.menu li#current').parents().show();
$('ul.menu li#current').parents().toggleClass('open');

$('ul.menu li.parent a').click(
function () {
$(this).parent().toggleClass('open');
$(this).siblings().slideToggle();
});

//Animation der Produktslider
$i = 0;

$('a#btnback').click(function() {
  if($i >= 1) {
  $('div#slider').animate({left: '+=560px'}, 'slow');
  $i = $i-1;
  }else{
  $('div#slider').animate({left: '-=2240px'}, 'slow');
  $i = 4;
  }
});
$('a#btnfor').click(function() {
  if($i <= 3) {
  $('div#slider').animate({left: '-=560px'}, 'slow');
  $i = $i+1;
  } else {
  $('div#slider').animate({left: '+=2240px'}, 'slow');
  $i = 0;
  }
});

//Fading der Links in der Marginalien-Spalte
$('.bannergroup img').fadeTo('fast', 0.5);
$('.bannergroup img').hover(
  function() {$(this).fadeTo('slow', 1.00);},
  function() {$(this).fadeTo('slow', 0.50);}
  );

//Animationen Buchbestellung
$('#buchbestellung .bestellung').slideUp();
$('#buchbestellung .anzahl').slideUp();
$('#buchbestellung .checkbox').attr('checked', false);
$('#buchbestellung legend').click(function(){
  $(this).next().slideToggle();
  $('img', this).toggleClass(minus, addOrRemove);
    if ($('img.minus', this)) {
		  $('img', this).attr('src', "http://www.sachsenverlag.de/templates/telefonbuchverlag/images/navi_left-.png");
		} else {
		  $('img', this).attr('src', "http://www.sachsenverlag.de/templates/telefonbuchverlag/images/navi_left+.png");	
		}
  });
$('#buchbestellung .buch .checkbox').change(function() {
  $(this).parent().next().slideToggle();
  });

//Facebook & Twitter-Slider-Animationen
$('div.sociallabel').click(function() {
    $('div.sociallabel').animate({top: '620px'}, 'slow');
	$('div.socialcontent').animate({top: '0px'}, 'slow');
  });
$('div.socialcontent').mouseleave(
  function(){
	$('div.sociallabel').animate({top: '0px'}, 'slow');
    $('div.socialcontent').animate({top: '-620px'}, 'slow'); 
  });

$('div.twitterlabel').click(function() {
    $('div.twitterlabel').animate({top: '620px'}, 'slow');
	$('div.twittercontent').animate({top: '0px'}, 'slow');
  });
$('div.twittercontent').mouseleave(
  function(){
	$('div.twitterlabel').animate({top: '0px'}, 'slow');
    $('div.twittercontent').animate({top: '-620px'}, 'slow');
  });


$('#stickyclose').click(function(){
  $('#stickymove').hide();
});

function anim(){
  $('#stickymove').animate({'top':'300'},4000);
  $('#stickymove').animate({'top':'0'},4000);
  timer=setTimeout(anim,1);
}

var timer;
timer=setTimeout(anim,1);

//HIER NEUE INHALTE EINFÜGEN!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

});
