$(document).ready(function() {

	// http://github.com/peteog/jquery.tweet
	$("#tweet").tweet({ user: "adsmithcom" });

	// http://www.gmarwaha.com/jquery/jcarousellite/
	$('#recent-carousel .slides').jCarouselLite({
		btnNext: '#recent-carousel .next',
		btnPrev: '#recent-carousel .prev',
		visible: 3
	});

	$('#carousel-0 .slides').jCarouselLite({
		btnNext: '#carousel-0 .next',
		btnPrev: '#carousel-0 .prev',
		visible: 3
	});

	$('#carousel-1 .slides').jCarouselLite({
		btnNext: '#carousel-1 .next',
		btnPrev: '#carousel-1 .prev',
		visible: 3
	});

	$('#carousel-2 .slides').jCarouselLite({
		btnNext: '#carousel-2 .next',
		btnPrev: '#carousel-2 .prev',
		visible: 3
	});

	// http://fancybox.net/	
	$("a.gallery").each(function() {
	    var self = $(this);
	    var parent = self.parent();
	    var title = parent.find('p:first');
	    self.fancybox({
    		'transitionIn'		: 'none',
    		'transitionOut'		: 'none',
    		'cyclic'			: true,
    		'titlePosition' 	: 'over',
    		'titleFormat'		: function() {
    			return '<span id="fancybox-title-over"><h6>' + this.title + '</h6><p>' + title[0].innerHTML + '</p></span>';
    		}
    	});	
    });
		
	$("a.video").fancybox({
		'width'				: 630,
		'height'			: 385,
		'padding'			: 0,
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'titleShow'			: false,
		'showNavArrows'		: false
	});


	// Hide/Show Tabbed Content
    var tabContainers = $('.content-module');
    $('#content-select a').click(function () {

        tabContainers.addClass('hide').filter(this.hash).removeClass('hide');

        $('#content-select a').parent().removeClass('active');
        $(this).parent().addClass('active');

        return false;
    }).filter(':first').click();

	// http://snipurl.com/jquery.target.blank
	$('a[href^="http://"]').attr({
		target: "_blank"
	});

});

