$(document).ready(function() {

  $("#accordion").accordion({ autoHeight: true });
  
  //slideMenu.build('sm',445,10,10)
  $('#accordion-slider').kwicks({
   max : 445,
   spacing : 0
   });
   
   $('#home-feature').cycle({ 
       fx:    'fade', 
       pause:  1 
   });
  
  (function hidenext(jq){
      jq.eq(0).css('visibility','visible').hide().fadeIn("fast", function(){
          (jq=jq.slice(1)).length && hidenext(jq);
      });
  })($('article.type-byc_project'));
  

  $("a[rel=byc_project_gallery]").fancybox({
  		'transitionIn'		: 'easeIn',
  		'transitionOut'		: 'none',
  		'titlePosition' 	: 'over',
  		'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
  		    return '<span id="fancybox-title-over">Image ' +  (currentIndex + 1) + ' / ' + currentArray.length + ' ' + title + '</span>';
  		}
  	});
  	
  /***************************************************
  SlideShow
  ***************************************************/
  function cyclePause() {
    jQuery('#slideshow').hover(
      function() {
        jQuery('.slides').cycle('pause')
      },
      function() {
        jQuery('.slides').cycle('resume')
      }
    );
  }

  cyclePause();
  var sliderspeed = 5000;
  var slider_effect = 'fade';

  $('.slides').cycle({
    fx: slider_effect,
    speed: 700,
    timeout: sliderspeed,
    pager: '.pagination',
    pauseOnPagerHover: true,
      pagerAnchorBuilder: function(idx, slide){
          // return selector string for existing anchor 
          return '.pagination li:eq(' + idx + ') a';
      }
  });
});

  
