$(document).ready(function () {				
//QuickSearch
	$('ul#quicksearchdata li').quicksearch
	({
		attached: 'span:searchplace',
		position: 'before',
		labelText: '',
		inputText: 'Click to search...',
		loaderImg: '/images/loading.gif',
		loaderText: 'Searching...'
	})
//YouTube
	$(function() 
		{
		      $("ul.demo2").ytplaylist({addThumbs:true, autoPlay: true, showRelated: false, holderId: 'ytvideo2'});
		});

//Qtip tooltips
	  $('#tooltip a[href][title]').qtip
	  ({
	      content: {
			  text: false // Use each elements title attribute
			},
		position: {
			    corner: {
				target: 'topMiddle',
				tooltip: 'bottomMiddle'
				    }
			  },
		  hide: { when: 'mouseout', fixed: true },
			style: 'dark'
	  });

//Showing/Hiding "About This Site" link
	$('#about').hide() ; 

	$('a#click').click(function(){
		$('#about').show('slow');
	});
	$('a#close').click(function(){
		$('#about').hide('slow');
	});

//Showing which track is currently playing
	$(".currentvideo").css("background","red");
	$(".currentvideo").next().addClass("next");
	$("li.currentvideo .clicktrack").clone().appendTo("#infobox");

// Set up "items per page" select box
	$('#perpage').change(function(){
		var index = this.selectedIndex;
		var options = this.options;
		if(location.href.match(/page=(\d+)/)){
			var page = RegExp.$1;
		}
		if(options && options[index]){
			location.href = '/?' + (page ? 'page=' + page + '&' : '') + 'per_page=' + options[index].value;
		}
	});

//Clicktracker
$("a.clicktrack").clicktrack("/inc/clicktrack.php");

//LazyLoad
$("img").lazyload();

});

