$(document).ready(function() 
{

  $('.ajax').live('click', function(event)
    {
      event.preventDefault();
      url = $(this).attr('href');
      selected = $(this).parent()
      $('#teams .team').not(selected).animate({'opacity' : 0.6}, 'slow');
      selected.animate({'opacity' : 1}, 'fast');
      $('#ajaxcontent').fadeOut('slow');
      $('#ajaxcontent').load(url, function()
        {
          $('#ajaxcontent').fadeIn('slow'); 
        });
    });

//	$('#cycle').cycle({
//		fx: 'fade'
//	});

//	$('figure.gallery-item a').attr('rel','gallery');
//	$('figure.gallery-item a[rel="gallery"]').fancybox();

	// Scroll to top
	$('#backUp a').click(function() {
		$('html, body').animate({ scrollTop: 0 }, 'slow');
		return false;
	});
	
	if ( $('body').hasClass("page-id-85") ) {
	
	    //$('#colorstrip').animate({ backgroundColor: "#FF6C00" }, 200);
	    $('#colorstrip').css('background-color', '#FF6C00')
	    
	} else if ($('body').hasClass("page-id-99")) {
	
	    //$('#colorstrip').animate({ backgroundColor: "#98C000" },200);
  	    $('#colorstrip').css('background-color', '#98C000')

	} if ($('body').hasClass("page-id-95")) {
	
	    //$('#colorstrip').animate({ backgroundColor: "#1BB5C7" },200);
	    $('#colorstrip').css('background-color', '#1BB5C7')
	    
	}
	
	$('#kuubireadmorebutton').click(function() {
	    if ($(this).html() == "lue lisää") {
	        $(this).html("pienennä");
	    } else {
	        $(this).html("lue lisää");
	    }
		$('#kuubireadmore').slideToggle();
		return false;
	});
});
