// JavaScript Document
$(document).ready(function($){
	$("ul.glm > li:not(.active)").hover(function(){
		$(this).parent().addClass("glmHover");
	}, function(){
		$(this).parent().removeClass("glmHover");
	});
	$(".h .autorisation a").click(function(){
		$(this).parent().parent().children().removeClass("active");
		$(this).parent().addClass("active");
	});
	$("tr:even").addClass("even");
	$("td img").each(function(){
		$(this).parent().parent().css("width", $(this).width()+5);
	});
	$(".glm .active .active a").css({"background-color": $("body").attr("bgcolor"), "color": $("body").attr("text")});

	$('#select_team').change(function(){
		var choice = $(this).val();
		if (choice!=0){
			if ($(this).val()=='new'){
				window.location.href="/player/addteam"
			} else {
				window.location.href="/player/selectteam/team/"+choice;
			}
		}

	});
    $('.paymentList a.btn').click(function(){
        return false;
    });
    $('.paymentList ul').hide();
    $('.paymentList').hover(
        function() {
            $(this).addClass("active");
            $(this).find('ul').stop(true, true); // останавливаем всю текущую анимацию
            $(this).find('ul').slideDown();
        },
        function() {
            $(this).removeClass("active");
            $(this).find('ul').slideUp('fast');
        }
    );
});
