jQuery.noConflict();

jQuery(document).ready(function($)
{
	// Hide content
	$('.ujs_hide').hide();
	
	// Stripe
	$('.ujs_stripe li:nth-child(even)').addClass('even');
	$('.ujs_stripe tbody tr:nth-child(odd)').addClass('odd');
	
	// Hover
	$('.ujs_hover li').hover( function() {$(this).addClass('selected');}, function() {$(this).removeClass('selected');} );
	
	// Out of use
	$('.ujs_out_of_use').click( function(e) { alert('Tämä ominaisuus ei ole vielä käytössä.'); e.preventDefault(); } );
	
	// 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;
				});
			}
		}
	});
});
