jQuery(document).ready(function() {
	jQuery('#home-lrg-carousel').jcarousel({
	    scroll: 1,
	    animation: 500,
	    buttonNextHTML: null,
        buttonPrevHTML: null,
        wrap: 'both',
        initCallback: jc_initCallback,
        itemFirstInCallback: jc_itemFirstInCallback
	});
	
	function turnOffSlideShowNavItems() {
		jQuery('#home-lrg-carousel-dots li a').each(function() {
			jQuery(this).removeClass('on').addClass('off');
		});
	}
	
	function jc_itemFirstInCallback(carousel, item, idx, state) {
    	turnOffSlideShowNavItems();
    	jQuery("#home-lrg-carousel-dots li a[rel='"+idx+"']").removeClass('off').addClass('on');
    };

    function jc_initCallback(carousel) {
	   	jQuery('#home-lrg-carousel-dots li a').bind('click', function() {
	        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).attr('rel')));
			turnOffSlideShowNavItems()
			jQuery(this).removeClass('off').addClass('on');
	        return false;
	    });        
    	jQuery('#home-lrg-carousel-next').bind('click', function() {
            carousel.next();
            return false;
        });
    	jQuery('#home-lrg-carousel-prev').bind('click', function() {
            carousel.prev();
            return false;
        });
    }
    
    
	jQuery('.pop').each(function(index) {
		jQuery(this).fancybox({
			'hideOnContentClick': false,
			'width': 940,
			'height': 465,
			'overlayOpacity': 0.5,
			'autoDimensions': false,
			'padding': 18,
			'type': 'iframe'
			
		});
	  });    
});
