function ShowLoading(a){
    a&&$("#loading-layer-text").html(a);
    var a=($(window).width()-$("#loading-layer").width())/2,
        b=($(window).height()-$("#loading-layer").height())/2;
    var wdt = $(window).width(),
        hgt = $(window).height();
    $("#loading-layer").css({left:a+"px",top:b+"px",position:"fixed",zIndex:"99"});
    $("#loading-layer,#loading-background").fadeIn("slow");
}
function HideLoading(){
    $("#loading-layer,#loading-background").fadeOut("slow");
}
function doVote( action ){	
	var answer_id = $('#dle-vote input:radio[name=answer]:checked').val();
    var id = $('#qid').val();
	ShowLoading('');

	$.get(
          "/pages/vote.php", 
          { vid: id, whatdo: action, answer: answer_id,access:true }, 
          function(data){
		      HideLoading('');
		      $(".vote_results").fadeOut(500, function() {
                $(this).html(data);
                $(this).fadeIn(500);
		      });
	       }
    );
}
$('.list').click(
                   function() {
								var id = $(this).attr("id");
								//id = id.replace("img", "");
								$.post(
								'newsScripts/GetRequestPlayers.php',
								{"post_id":id},
								function(result){
								$(".cartImg").html(result);
								}, "html");
				   });
$('.listUz').click(
                   function() {
								var id = $(this).attr("id");
								//id = id.replace("img", "");
								$.post(
								'/newsScripts/GetRequestPlayersUz.php',
								{"post_id":id},
								function(result){
								$(".cartImg").html(result);
								}, "html");
				   });				   
				   $('.main').click(
                   function() {
								var id = $(this).attr("id");
								//id = id.replace("img", "");
								$.post(
								'newsScripts/GetRequestPlayers.php',
								{"post_id":id},
								function(result){
								$(".cartImg").html(result);
								}, "html");
				   });
				    $('.spare').click(
                   function() {
								var id = $(this).attr("id");
								//id = id.replace("img", "");
								$.post(
								'/newsScripts/GetRequestPlayers.php',
								{"post_id":id},
								function(result){
								$(".cartImg").html(result);
								}, "html");
				   });
				    $('.mainUz').click(
                   function() {
								var id = $(this).attr("id");
								//id = id.replace("img", "");
								$.post(
								'/newsScripts/GetRequestPlayersUz.php',
								{"post_id":id},
								function(result){
								$(".cartImg").html(result);
								}, "html");
				   });
				    $('.spareUz').click(
                   function() {
								var id = $(this).attr("id");
								//id = id.replace("img", "");
								$.post(
								'/newsScripts/GetRequestPlayersUz.php',
								{"post_id":id},
								function(result){
								$(".cartImg").html(result);
								}, "html");
				   });
				   $('.listCouch').click(
                   function() {
								var id = $(this).attr("id");
								//id = id.replace("img", "");
								$.post(
								'/newsScripts/GetRequestPlayers.php',
								{"postIdCouch":id},
								function(result){
								$(".cartImgCouch").html(result);
								}, "html");
				   });
				   $('.listCouchUz').click(
                   function() {
								var id = $(this).attr("id");
								//id = id.replace("img", "");
								$.post(
								'/newsScripts/GetRequestPlayersUz.php',
								{"postIdCouch":id},
								function(result){
								$(".cartImgCouch").html(result);
								}, "html");
				   });
				   
var a=0;
$(document).ready(function(){
    $('#btn_up').click(function(){
        if (a!=0){
        a=a+40;
        $('#spisok_fon').stop().animate({
            marginTop: a
        },250);}
    });
  $('#btn_down').click(function(){
        if (a>-441){
        a=a-40;
        $('#spisok_fon').stop().animate({
            marginTop: a
        },250);}
    });
});

var b=0;
$(document).ready(function(){
    $('#btn_up_').click(function(){
        if (b!=0){
        b=b+40;
        $('#spisok_fon_').stop().animate({
            marginTop: b
        },250);}
    });
  $('#btn_down_').click(function(){
        if (b>-100){
        b=b-40;
        $('#spisok_fon_').stop().animate({
            marginTop: b
        },250);}
    });
});

var c=0;
$(document).ready(function(){
    $('#btn_up1').click(function(){
        if (c!=0){
        c=c+40;
        $('#spisok_fon1').stop().animate({
            marginTop: c
        },250);}
    });
  $('#btn_down1').click(function(){
        if (c>-80){
        c=c-40;
        $('#spisok_fon1').stop().animate({
            marginTop: c
        },250);}
    });
});

function showCoach(id) {
	showCoachLoading();
	$('#coachs').load('pages/coachload.php',{cid:id,js:true},function (data){
		hideCoachLoading();
		$('#coachs').fadeIn("slow");
	});
}

function showCoachLoading() {
	$('#coachs').hide();
	$('.coachLoading').fadeIn("slow");
}

function hideCoachLoading() {
	$('.coachLoading').hide();
}

function showPlayer(id) {
	showPlayerLoading();
	$('#player').load('pages/playerload.php',{cid:id,js:true},function (data){
		hidePlayerLoading();
		$('#player').fadeIn("slow");
	});
}

function showPlayerLoading() {
	$('#player').hide();
	$('.playerLoading').fadeIn("slow");
}

function hidePlayerLoading() {
	$('.playerLoading').hide();
}
