$(document).ready(function(){
  var currentText = 0;
  var slider = $('.slides_container').bxSlider({
    auto: true,
    autoControls: false,
    pager: true,
    controls: false,
    speed: 800,
    pause:8000,
    easing:'easeOutQuad',
    onNextSlide: function(currentSlide, totalSlides){
    switch (currentSlide) {
      case 0: 
        currentText = 2;
        break;
      
      case 1: 
        currentText = 0;
        break;
      
      case 2: 
        currentText = 1;
        break;
    }     
      $('#text'+currentText).fadeOut(800);
    },
    onAfterSlide: function(currentSlide, totalSlides){     
      $('#text'+currentSlide).fadeIn(200);
    }  
  });
  
  $('.pager-1').click(function() {
     //alert(currentText);  
     $('#text'+currentText).fadeOut(800);
     currentText = 0;
     //slider.startShow();
  });

  $('.pager-2').click(function() {
     //alert(currentText);
     $('#text'+currentText).fadeOut(800);
     currentText = 1;
     //slider.startShow();
  });

  $('.pager-3').click(function() {
     //alert(currentText);
     $('#text'+currentText).fadeOut(800);
     currentText = 2;
     //slider.startShow();
  });

  
  
  
  $('#text1').css('display','none');
  $('#text2').css('display','none');
  
  var floatState = "closed";
  $('#floater').click(function() {
  	//$('#floating-box').animate( {height: '120px'}, {duration: 1000, specialEasing: {height: 'easeOutQaud'}} );
  	if (floatState == "closed") {
  	  $("#floating-box").animate({height: "120px"}, 400);
  	  $('#floater').attr('src','/fileadmin/templates/img/close.png');
  	  floatState = "open";  
  	} else {
  	  $("#floating-box").animate({height: "22px"}, 400);
  	  $('#floater').attr('src','/fileadmin/templates/img/open.png');
  	  floatState = "closed";  
  	}	
  });
  
});

