/**
 * Image link grid sprites
 *
 */
$(function(){
    $('.image_link_grid_large li a').empty('');
    // span whose opacity will animate when mouse hovers.
    $('.image_link_grid_large li a').append('<span class="hover"></span>');

    
    $('.image_link_grid_large li a').hover(
        function() {
            $('.hover', this).stop().animate({
            'opacity': 1
            }, 325)
        },
    function() {
        $('.hover', this).stop().animate({
            'opacity': 0
            }, 325)
        })
    });


/**
 * Colorbox (Image thumbnail links to full size images)
 *
 */
$(document).ready(function(){
		 
    try {
        $("a.view_full_size").colorbox({transition:"none"});
        }
    catch (err) {}

    });


/**
 * Stats: Redirects to profile once it's ready
 *
 */
function redirect_if_ready(player_id, destination){
    $.get(
    	"/stats/ajax/profile_has_stats/?player_id="+player_id,
    	"",
    	function(data) {if(data.has_stats) window.location=destination;},
    	"json"
        );
    }
