$(document).ready(function() {

	// Homepage carousel
	$("#home-carousel").slides({
		play: 5000,
		pause: 2500,
		hoverPause: true,
		generatePagination: true,
		generateNextPrev: false,
		bigTarget: false
	});
	
	// Sidebar Table of Contents

	
	// Truncate and Expand
	$('div.expandable p').expander({
		slicePoint:       220,  // default is 100
		expandPrefix:     ' ', // default is '... '
		expandText:       '(more...)', // default is 'read more'
		userCollapseText: '(less)'  // default is 'read less'
	});
	
	// Bootstrap Tabs
	$('.tabs').tabs();
	$('.pills').pills();
	
	// Checkout password -> modal select
	$('input#password').click(function() {
		$('input#has_password').attr('checked', 'true');
	});
	
	// #FACT
/*
	var hyperinkis = $("#hyperinkis");
	var i = 0;
	var hyperinkwords = [
		'knowledge',
		'expertise',
		'a story' ];
		
	function newPhrase() {

		hyperinkis.html(hyperinkwords[i]);
		
		i++;
		
		if ( i == hyperinkwords.length ) i = 0;
	}
	
	function switchPhrase() {
		hyperinkis.fadeOut( 250, "swing", function(){
		
			hyperinkis.html(newPhrase());
		}).fadeIn(250, "swing");
	}

	setInterval(switchPhrase, 1800);
*/
  
});

// Facebook Like
(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) {return;}
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

// Google +1
(function() {
var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
po.src = 'https://apis.google.com/js/plusone.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
})();

