$(document).ready(function(){
   //$('#plantanimation1').canimate({
//      totalFrames: 124,
//      imagePrefix: 'plant',
//      fps: 5,
//      preload:false
//   });

  $(function() {
    $('#mainwrap').cycle({
        fx:     'scrollHorz',
		speedIn:  750, 
    	speedOut: 750, 
    	easing:  'easeInOutExpo', 
		timeout: 7000,
		pauseOnPagerHover: 1,
		pager: '#nav',
		pagerAnchorBuilder: function(idx, slide) { 
        return '<li><a href="#"></a></li>'; 
    } 
    });
  });

  var n = $("#example div").length;

  $('#description1').show();
  $('.button_overlay1').fadeTo(1, 1);
  
  $(".margin1").hover(function () {
	  $('.button_overlay1').stop().clearQueue().animate({
		  opacity: '1'
	  }, 500);
  }, function () {
	  $('.button_overlay1').stop().clearQueue().animate({
		  opacity: '.01'
	  }, 500);
  });
  
  $(".margin2").hover(function () {
	  $('.button_overlay2').stop().clearQueue().animate({
		  opacity: '1'
	  }, 500);
  }, function () {
	  $('.button_overlay2').stop().clearQueue().animate({
		  opacity: '.01'
	  }, 500);
  });
  
  $(".margin3").hover(function () {
	  $('.button_overlay3').stop().clearQueue().animate({
		  opacity: '1'
	  }, 500);
  }, function () {
	  $('.button_overlay3').stop().clearQueue().animate({
		  opacity: '.01'
	  }, 500);
  });
  
  $(".margin4").hover(function () {
	  $('.button_overlay4').stop().clearQueue().animate({
		  opacity: '1'
	  }, 500);
  }, function () {
	  $('.button_overlay4').stop().clearQueue().animate({
		  opacity: '.01'
	  }, 500);
  });

  $(".margin1").click(function () {
	  $('#description1').show();
  	  $('#description2, #description3, #description4').hide();
  });

  $(".margin2").click(function () {
	  $('#description2').show();
  	  $('#description1, #description3, #description4').hide();
  });

  $(".margin3").click(function () {
	  $('#description3').show();
  	  $('#description1, #description2, #description4').hide();
  });

  $(".margin4").click(function () {
	  $('#description4').show();
  	  $('#description1, #description2, #description3').hide();
  });
  
});
