(function($){
    //fallback to Cufon for browsers that don't support @font-face
    if (!Modernizr.fontface) {
        //Cufon.replace('selector goes here; either a DOM collection or a jQuery object');
    }

	
	
	$('#band-combinations a').click(function(){
		$('#band-combinations').find('a.active').removeClass('active');
		$(this).addClass('active');
	});
	
//one
	$('#band-combinations #one a').click(function(){
		$('#band').find('img.show').removeClass('show');

                $('#james img:first-child').addClass('show');

                $('#ben img:first-child').addClass('show');

                return false;
	});
	
//two	
	$('#band-combinations #two a').click(function(){
		$('#band').find('img.show').removeClass('show');
		
		$('#james img:first-child').addClass('show');
		$('#andy img:first-child').addClass('show');

                $('#ben img:first-child').addClass('show');

                return false;
	});

//three
	$('#band-combinations #three a').click(function(){
		$('#band').find('img.show').removeClass('show');
		
		$('#james img:first-child').addClass('show');
		$('#andy img:first-child').addClass('show');
		$('#duff img:first-child').addClass('show');

                $('#ben img:first-child').addClass('show');

                return false;
	});

//four
	$('#band-combinations #four a').click(function(){
		$('#band').find('img.show').removeClass('show');
		
		$('#james img:first-child').addClass('show');
		$('#andy img:first-child').addClass('show');
		$('#duff img:first-child').addClass('show');
		$('#tim img:first-child').addClass('show');

                $('#ben img:first-child').addClass('show');

                return false;
	});
	
//five
	$('#band-combinations #five a').click(function(){
		$('#band').find('img.show').removeClass('show');

                $('#james img:first-child').addClass('show');
		$('#andy img:first-child').addClass('show');
		$('#tim img:first-child').addClass('show');
		$('#craig img:first-child').addClass('show');
		$('#nathan img:first-child').addClass('show');

                $('#ben img:first-child').addClass('show');

                return false;
	});	
	
//dj
	$('#band-combinations #dj a').click(function(){
		$('#band').find('img.show').removeClass('show');

                $('#ben img:first-child').addClass('show');

                return false;
	});
	
//default
$('#music').find('.option-1-off').hide();
$('#music').find('.option-2-off').hide();
$('#music').find('.option-1-on').hide();
$('#music').find('.option-2-on').hide();

$('#music').find('.option-1-on').show();
$('#music').find('.option-1-off').show();

$('#option-2').removeClass('cur');

// Option 1
$('#option-1').click(function(){
	$('#music').find('.option-1-off').hide();
	$('#music').find('.option-2-off').hide();
	$('#music').find('.option-1-on').hide();
	$('#music').find('.option-2-on').hide();
	
	$('#music').find('.option-1-on').show();
	$('#music').find('.option-1-off').show();
	
	$('#option-1').addClass('cur');
	$('#option-2').removeClass('cur');
	
	return false;
});

// Option 2s
$('#option-2').click(function(){
	$('#music').find('.option-1-off').hide();
	$('#music').find('.option-2-off').hide();
	$('#music').find('.option-1-on').hide();
	$('#music').find('.option-2-on').hide();
	
	$('#music').find('.option-2-on').show();
	$('#music').find('.option-2-off').show();
	
	$('#option-1').removeClass('cur');
	$('#option-2').addClass('cur');
	
	return false;
});	
	
	
//tooltip
	$('body').append('<div id="tooltip"></div>');
	$('#tooltip').hide();
	var $tooltip = $('#tooltip');
    $('ul#band a').each(function(){
        var $this = $(this),
			$title = $('div.tooltip-info', this).html();
			//$instrument = $('span.instrument', this).html();

        $(this).hover(function(){
			
           // $tooltip.text($title).show();
			$tooltip.append('<div id="tooltip-wrap">' + $title + '</div>').show();
        }, function(){
			
			$tooltip.text('').hide();
        });
		
		$(this).mousemove(function(e){
			$tooltip.css({
				top: e.pageY - 10,
				left: e.pageX + 20
			});
		});
    });
	
//carousel

/**
 * We use the initCallback callback
 * to assign functionality to the controls
 */
function mycarousel_initCallback(carousel) {
    jQuery('.jcarousel-control a').bind('click', function() {
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
        return false;
    });

    jQuery('.jcarousel-scroll select').bind('change', function() {
        carousel.options.scroll = jQuery.jcarousel.intval(this.options[this.selectedIndex].value);
        return false;
    });

    jQuery('#mycarousel-next').bind('click', function() {
        carousel.next();
        return false;
    });

    jQuery('#mycarousel-prev').bind('click', function() {
        carousel.prev();
        return false;
    });
};

// Ride the carousel...
jQuery(document).ready(function() {
    jQuery("#mycarousel").jcarousel({
        scroll: 1,
        initCallback: mycarousel_initCallback,
        // This tells jCarousel NOT to autobuild prev/next buttons
        buttonNextHTML: null,
        buttonPrevHTML: null
    });
});

//see more (home page)
	$('div.entry-content').children('p').each(function(){
		$('div.entry-content p').hide();
		
		$('div.entry-content p:nth-child(1)').show();
		$('div.entry-content p:nth-child(2)').show();
		$('div.entry-content p:last-child').show();
	});
	
	$('div.entry-content a.more').click(function() {
		$(this).hide();
		$('div.entry-content p').show();

	});

})(jQuery);
