jQuery.noConflict();

jQuery(function($) { 
	/*GALLERY CLICK ON THUMBNAIL*/
	$('#gallery #thumbs li:first').addClass('on');
	$('#thumbs li a').click(function() { 
			$('#thumbs li').removeClass('on');
			$(this).parent().addClass('on');
			var source=$(this).attr('href'); 
			$('#bigimg img').hide();
			$('#bigimg img').removeAttr('width');
			$('#bigimg img').attr('src', source).fadeIn(400); 
			//title();
			return false;	
	});
	
	$('#gallery').show();
	
	$('a.gallery').click(function(){
		$('#youtube').css('display','none');
		$('body').prepend('<div id="overlay"></div>');
		var H = $(document).height();
		$('#overlay').height(H);
		$('#gallery').css('left','30%');
		$('#gallery').fadeIn();
	});
	
	$('#thumbs').jcarousel({ 
		initCallback: thumbs_initCallback
	});
	
	if (($.browser.msie) && ($.browser.version <= 6)) {
	
		var x=$('#thumbs').width();
		$('#thumbs').width(x+75);
	}
	
	$('#gallery').find('.close').click(function(){
		$('#youtube').css('display','inline');
		$(this).parent().fadeOut();
		$('body').find('#overlay').remove();
	})
});

function thumbs_initCallback(carousel) {

(function($) { 

	$('.jcarousel-next').bind('click', function() {
        carousel.options.scroll = 1;
		carousel.next();
        return false;
    });

    $('.jcarousel-prev').bind('click', function() {
        carousel.options.scroll = 1;
    	carousel.prev();
        return false;
    });

    $('.next-fast').bind('click', function() {
	        carousel.options.scroll = 10;
	        carousel.next();
	        return false;
    });

    $('.prev-fast').bind('click', function() {
        carousel.options.scroll = 10;
    	carousel.prev();
        return false;
    });
    
 })(jQuery);
};