$(document).ready(function(){
	$("#closeError").click(function () { 
			$(".present_error").fadeOut("normal");
			$(".black_overlay").fadeOut("normal");
	});
	
	$(".idAbuse").click(function () {
		var href = $(this).attr('href');

		$.ajax({
			type: "GET",
			async: true,
			data: href,
			url: "_Forms/Abuse.php",
			success: function(data, textStatus){
				$("#abuseForm").html(data);
			},
			complete: function() {
				$("#abuseForm").modal({overlay: 80});
			}
		});			
		
		return false;
	});


	if ($.browser.msie && $.browser.version == '6.0')
		{ $("#moveitup").css("margin-top", "-30px"); }	 

	if ($.browser.mozilla) 
	{ 
		$("#StarCash").css("top", "-23px");
		$("#JPContent").css("padding-top", "10px");
	}

	function MyBestResults () {
		$("#AjaxMyBestResultsBlock").animate(1500);
		$.ajax({
			type: "GET",
			async: true,
			data: "GameID=" + $("#Gaid").html(),
			url: "_Boxes/GetMyBestScores.php",
			success: function(data, textStatus){
				$("#AjaxMyBestResultsContent").html(data);
			}
		});
	}
			
	function BestResults () {
		$("#AjaxBestResultsBlock").animate(1500);
		$.ajax({
			type: "GET",
			async: true,
			data: "GameID=" + $("#Gaid").html(),
			url: "_Boxes/TournamentBestScores.php",
			success: function(data, textStatus){
				$("#AjaxBestResultsContent").html(data);
			}
		});
	}

	t1 = setTimeout(BestResults, 1000);
	t2 = setTimeout(MyBestResults, 1000);
	
	 $('#ratingForm').submit(function(){
		$('input',this).each(function(){ 
			if (this.value > 0)
			{
				$.ajax({
					type: "POST",
					async: true,
					data: "rate=" + this.value + "&GameID=" + $("#Gaid").html(),
					url: "_Process/RateGame.php",
					success: function(data, textStatus){
						$("#ratingForm").hide();
						$("#ratingThanks").html(data);
					}
				});
			}
		});
		return false;
	 });
});

