/**
 * default.js
 * Core functions
 *
 * @author      Sebastian Wolff
 * @updated     2011-11-02
 * @copyright   A Cappella Records, Inc.
 * @link		http://acappellarecords.com/
 */
 
 
$(document).ready(function() {

	//Modernizr.load()
	
	init = {
	
		datatables : function() {
			//$('.dataTable').dataTable( {} );
			$('.table-tracklist').dataTable( {
				"bPaginate": false,
				"bLengthChange": false,
				"bFilter": false,
				"bSort": false,
				"bInfo": false,
				'aaSorting': [[0, 'asc']] /* track number */
				/*
				"bJQueryUI": true,
				"sPaginationType": "full_numbers",
				'aaSorting': [[0, 'asc']],
				*/}
			);
		}
	
	}
	
	// Document initialized, let's do things to it.
	
	/*
	$('.button').button();
	
	*/
	
	init.datatables();
	
	
	$('.searchbox').bind('focus blur', function() {
		if($(this).val() == $(this)[0].defaultValue) $(this).val('');
		else if($(this).val() == '') $(this).val($(this)[0].defaultValue);
	});
	
	// Lazy load images.
	$("img.lazy").lazyload({
		effect:"fadeIn",
		placeholder: base_url + 'images/px.gif'
	});

	
	
	// +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);
	})();
	
	
	//disqus
	if($('#disqus_thread').length>0) {
		/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
		var disqus_shortname = 'acappellarecords';

		/* * * DON'T EDIT BELOW THIS LINE * * */
		(function() {
			var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
			dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
			(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
		})();
	}
});
