jQuery.noConflict();

jQuery(document).ready(function($)
{
	// Shadowbox
	Shadowbox.init();
	$('a[rel*=shadowbox]').click( function() {$(this).addClass('visited');} );
	/*
	// Auto set-up Youtube links
	Shadowbox.setup($('a.ujs_youtube'),
	{
		width: 405,
		height: 340,
		autoplayMovies: true
	});
	*/
	// Header's opacity for IE
	$('div#header').css('opacity', 0.1);
	
	// Tabbed box navigation
	$('ul#ui-tabs-nav').tabs( {event: 'mouseover'} ); // fx: {height: 'toggle'}
	
	// Hide content
	$('.ujs_hide').hide();
	
	// Stripe
	$('.ujs_stripe li:nth-child(even)').addClass('even');
	
	// Hover
	$('.ujs_hover li').hover( function() {$(this).addClass('selected');}, function() {$(this).removeClass('selected');} );
	
	// Leave a comment form toggle
	$('h4#leaveComment').wrapInner('<a class="plain" href="#commentForm"></a>').click( function() { $('div#commentForm').toggle(); return false;} );
	
	// Archive entry toggle
	$('li.ujs_archive_month a').hover( function() {$(this).next().toggle();}, function() {} );
	
	// Links within page - animated scrolling
	// http://www.learningjquery.com/2007/10/improved-animated-scrolling-script-for-same-page-links
	$('p a[href*=#]').each(function()
	{
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') 
		&& location.hostname == this.hostname
		&& this.hash.replace(/#/,'') )
		{
			var $targetId = $(this.hash), $targetAnchor = $('[name=' + this.hash.slice(1) +']');
			var $target = $targetId.length ? $targetId : $targetAnchor.length ? $targetAnchor : false;
			if ($target)
			{
				var targetOffset = $target.offset().top;
				$(this).click(function()
				{
					$('html, body').animate({scrollTop: targetOffset}, 200);
					return false;
				});
			}
		}
	});
});