$(document).ready(function(){

	imgLoaderUsr = new Image();
	imgLoaderUsr.src = WEB_ASSETS_PATH+"images/misc/ajax-loader1.gif";
	
	$('#lnkGetGroupVideosToday').click(function(e){
		e.preventDefault();
		$("#GroupVideosCount").html("<div id='save_loader'><img src='"+imgLoaderUsr.src+"' /></div>");
		$(this).addClass("user-stats-active");
		$('#lnkGetGroupVideosMonth').removeClass("user-stats-active");
		$('#lnkGetGroupVideosYear').removeClass("user-stats-active");
		$.getJSON("/11/gateway/userstats.php", {action: "GetGroupVideosCountToday"}, function(json) {
			$("#save_loader").remove();
			$("#GroupVideosCount").html(""+json.msg+"");
		});
	});	
	$('#lnkGetGroupVideosMonth').click(function(e){
		e.preventDefault();
		$("#GroupVideosCount").html("<div id='save_loader'><img src='"+imgLoaderUsr.src+"' /></div>");
		$(this).addClass("user-stats-active");
		$('#lnkGetGroupVideosToday').removeClass("user-stats-active");
		$('#lnkGetGroupVideosYear').removeClass("user-stats-active");
		$.getJSON("/11/gateway/userstats.php", {action: "GetGroupVideosCountMonth"}, function(json) {
			$("#save_loader").remove();
			$("#GroupVideosCount").html(""+json.msg+"");
		});
	});	
	$('#lnkGetGroupVideosYear').click(function(e){
		e.preventDefault();
		$("#GroupVideosCount").html("<div id='save_loader'><img src='"+imgLoaderUsr.src+"' /></div>");
		$(this).addClass("user-stats-active");
		$('#lnkGetGroupVideosMonth').removeClass("user-stats-active");
		$('#lnkGetGroupVideosToday').removeClass("user-stats-active");
		$.getJSON("/11/gateway/userstats.php", {action: "GetGroupVideosCountYear"}, function(json) {
			$("#save_loader").remove();
			$("#GroupVideosCount").html(""+json.msg+"");
		});
	});
		
	$('#lnkGetGroupTimeToday').click(function(e){
		e.preventDefault();
		$("#GroupTimeCount").html("<div id='save_loader'><img src='"+imgLoaderUsr.src+"' /></div>");
		$(this).addClass("user-stats-active");
		$('#lnkGetGroupTimeMonth').removeClass("user-stats-active");
		$('#lnkGetGroupTimeYear').removeClass("user-stats-active");
		$.getJSON("/11/gateway/userstats.php", {action: "GetGroupTimeCountToday"}, function(json) {
			$("#save_loader").remove();
			$("#GroupTimeCount").html(""+json.msg+"");
		});
	});	
	$('#lnkGetGroupTimeMonth').click(function(e){
		e.preventDefault();
		$("#GroupTimeCount").html("<div id='save_loader'><img src='"+imgLoaderUsr.src+"' /></div>");
		$(this).addClass("user-stats-active");
		$('#lnkGetGroupTimeToday').removeClass("user-stats-active");
		$('#lnkGetGroupTimeYear').removeClass("user-stats-active");
		$.getJSON("/11/gateway/userstats.php", {action: "GetGroupTimeCountMonth"}, function(json) {
			$("#save_loader").remove();
			$("#GroupTimeCount").html(""+json.msg+"");
		});
	});
	$('#lnkGetGroupTimeYear').click(function(e){
		e.preventDefault();
		$("#GroupTimeCount").html("<div id='save_loader'><img src='"+imgLoaderUsr.src+"' /></div>");
		$(this).addClass("user-stats-active");
		$('#lnkGetGroupTimeToday').removeClass("user-stats-active");
		$('#lnkGetGroupTimeMonth').removeClass("user-stats-active");
		$.getJSON("/11/gateway/userstats.php", {action: "GetGroupTimeCountYear"}, function(json) {
			$("#save_loader").remove();
			$("#GroupTimeCount").html(""+json.msg+"");
		});
	});
	
	$('#lnkGetGroupLoginsToday').click(function(e){
		e.preventDefault();
		$("#GroupLoginsCount").html("<div id='save_loader'><img src='"+imgLoaderUsr.src+"' /></div>");
		$(this).addClass("user-stats-active");
		$('#lnkGetGroupLoginsMonth').removeClass("user-stats-active");
		$('#lnkGetGroupLoginsYear').removeClass("user-stats-active");
		$.getJSON("/11/gateway/userstats.php", {action: "GetGroupLoginsCountToday"}, function(json) {
			$("#save_loader").remove();
			$("#GroupLoginsCount").html(""+json.msg+"");
		});
	});	
	$('#lnkGetGroupLoginsMonth').click(function(e){
		e.preventDefault();
		$("#GroupLoginsCount").html("<div id='save_loader'><img src='"+imgLoaderUsr.src+"' /></div>");
		$(this).addClass("user-stats-active");
		$('#lnkGetGroupLoginsToday').removeClass("user-stats-active");
		$('#lnkGetGroupLoginsYear').removeClass("user-stats-active");
		$.getJSON("/11/gateway/userstats.php", {action: "GetGroupLoginsCountMonth"}, function(json) {
			$("#save_loader").remove();
			$("#GroupLoginsCount").html(""+json.msg+"");
		});
	});
	$('#lnkGetGroupLoginsYear').click(function(e){
		e.preventDefault();
		$("#GroupLoginsCount").html("<div id='save_loader'><img src='"+imgLoaderUsr.src+"' /></div>");
		$(this).addClass("user-stats-active");
		$('#lnkGetGroupLoginsMonth').removeClass("user-stats-active");
		$('#lnkGetGroupLoginsToday').removeClass("user-stats-active");
		$.getJSON("/11/gateway/userstats.php", {action: "GetGroupLoginsCountYear"}, function(json) {
			$("#save_loader").remove();
			$("#GroupLoginsCount").html(""+json.msg+"");
		});
	});
	
	$('#lnkGetGroupWaitingNow').click(function(e){
		e.preventDefault();
		$("#GroupWaitingCount").html("<div id='save_loader'><img src='"+imgLoaderUsr.src+"' /></div>");
		$(this).addClass("user-stats-active");
		$('#lnkGetGroupWaitingMonth').removeClass("user-stats-active");
		$('#lnkGetGroupWaitingYear').removeClass("user-stats-active");
		$.getJSON("/11/gateway/userstats.php", {action: "GetGroupWaitingCountNow"}, function(json) {
			$("#save_loader").remove();
			$("#GroupWaitingCount").html(""+json.msg+"");
		});
	});	
	$('#lnkGetGroupWaitingMonth').click(function(e){
		e.preventDefault();
		$("#GroupWaitingCount").html("<div id='save_loader'><img src='"+imgLoaderUsr.src+"' /></div>");
		$(this).addClass("user-stats-active");
		$('#lnkGetGroupWaitingNow').removeClass("user-stats-active");
		$('#lnkGetGroupWaitingYear').removeClass("user-stats-active");
		$.getJSON("/11/gateway/userstats.php", {action: "GetGroupWaitingCountMonth"}, function(json) {
			$("#save_loader").remove();
			$("#GroupWaitingCount").html(""+json.msg+"");
		});
	});	
	$('#lnkGetGroupWaitingYear').click(function(e){
		e.preventDefault();
		$("#GroupWaitingCount").html("<div id='save_loader'><img src='"+imgLoaderUsr.src+"' /></div>");
		$(this).addClass("user-stats-active");
		$('#lnkGetGroupWaitingMonth').removeClass("user-stats-active");
		$('#lnkGetGroupWaitingNow').removeClass("user-stats-active");
		$.getJSON("/11/gateway/userstats.php", {action: "GetGroupWaitingCountYear"}, function(json) {
			$("#save_loader").remove();
			$("#GroupWaitingCount").html(""+json.msg+"");
		});
	});	
	
	$("#lnkCloseIndexNFPopup").click(function(e){
		e.preventDefault();
		$.getJSON("/11/gateway/global.php", {action: "RemoveNewIndexPopup"}, function (json){
			tb_remove();
		});
	});
	
});
