var j = jQuery.noConflict()
function mycarousel_initCallback(carousel) {
  controls_html = "";
  for (var i=1; i <= carousel.size(); i++) {
    controls_html += '<a href="#" class="' + i + '"><span>' + i + "</span></a>";
  }
  j('.pagination').html(controls_html);
  j('.pagination a').bind('click', function() {
      carousel.scroll(j.jcarousel.intval(j(this).text()));
      return false;
  });
};

function mycarousel_itemLoadCallback(carousel, state) {
  idx = carousel.first;
  j('.pagination a.active').removeClass('active');
  j('.pagination a.' + idx).addClass('active');
};

j(document).ready(function() {
 j(".highlight_link").each(function() {
        if (j(this).attr('href') != '#') {
            j(this).fancybox({
                'padding'		    : 0,
                'scrolling'                 : 'no',
                'autoDimensions'            : true,
                'showCloseButton'           : false,
                'centerOnScroll':   false
            });
        }
    });

    j(".work_link").each(function() {
        if (j(this).attr('href') != '#') {
            j(this).fancybox({
                'padding'	            : 0,
                'scrolling'                 : 'no',
                'autoDimensions'            : true,
                'showCloseButton'           : false,
                'centerOnScroll':   false
            });
        }
    });

    j(".backstage_gallery_link").each(function() {
        if (j(this).attr('href') != '#') {
            j(this).fancybox({
                'padding'	            : 0,
                'scrolling'                 : 'no',
                'autoDimensions'            : true,
                'showCloseButton'           : false,
                'centerOnScroll':   false
            });
        }
    });
});


