$(function() {

	// Load related competitions
	$("#competitions_related_content").load("/index.php/competitions/relatedcompetitions/" + competitionId + "/" + Math.random(),
		function(msg) {
			$("#competitions_related_container img.ajaxWait").hide();
			$("#competitions_related_content").show();
		}
	);

	$("#competitions_more").one("click", function() {
		$("#competitions_more_content").load("/index.php/competitions/morefromthisuser/" + competitionId + "/" + userId + "/" + userName + "/" + Math.random(),
			function(msg) {
				$("#competitions_more_container img.ajaxWait").hide();
				$("#competitions_more_content").show();
			}
		)}
	);

	$("#competitions_related").click(function() {
		$("#competitions_related").addClass('arrowOn');
		$("#competitions_more").removeClass('arrowOn');
		$("#competitions_related_container").show();
		$("#competitions_more_container").hide();
	});

	$("#competitions_more").click(function() {
		$("#competitions_more").addClass('arrowOn');
		$("#competitions_related").removeClass('arrowOn');
		$("#competitions_more_container").show();
		$("#competitions_related_container").hide();
	});
});