// JavaScript Document
var counter;
Javascript = {
	
// The function that is run when the document is ready.
	startup: function(){
		$("#enableJavascript").hide();
		$("#ContentPane").hide();
		$("#calendar").hide();
		counter = -1;
		Javascript.nextImg();
		var timer = setInterval( Javascript.nextImg, 20000);
	},
	nextImg: function()
	{
		if(counter == 4)
			{counter = -1;}
		counter++;
		$("#BackImage").attr("src","images/BackImage"+counter+".jpg");
	},
	joinUs: function()
	{
		$.get("join_us.html",function(data) {
									   $("#Content").empty();
									   $("#Content").append(data);
									   });
		$("#ContentPane").show();
	},
	roster: function()
	{
		$.get("roster.html",function(data) {
									   $("#Content").empty();
									   $("#Content").append(data);
									   });
		$("#ContentPane").show();
	},
	aboutUs: function()
	{
		$.get("about_us.html",function(data) {
									   $("#Content").empty();
									   $("#Content").append(data);
									   });
		$("#ContentPane").show();
	},
	challengeUs: function()
	{
		$.get("challenge_us.html",function(data) {
									   $("#Content").empty();
									   $("#Content").append(data);
									   });
		$("#ContentPane").show();
	},
	calendar: function()
	{
		$.get("calendar.html",function(data) {
									   $("#Content").empty();
									   $("#Content").append(data);
									   });
		$("#ContentPane").show();
	},
	multimedia: function()
	{
		$.get("multimedia.html",function(data) {
									   $("#Content").empty();
									   $("#Content").append(data);
									   });
		$("#ContentPane").show();
	},
	submitImage: function()
	{
		$.get("submit_image.html",function(data) {
									   $("#Content").empty();
									   $("#Content").append(data);
									   });
		$("#ContentPane").show();
	},
	forums: function()
	{
		$.get("../phpBB/index.php",function(data) {
									   $("#Content").empty();
									   $("#Content").append(data);
									   });
		$("#ContentPane").show();
	},
	rules: function()
	{
		$.get("rules.html",function(data) {
									   $("#Content").empty();
									   $("#Content").append(data);
									   });
		$("#ContentPane").show();
	},
	donate: function()
	{
		$.get("donate.html",function(data) {
									   $("#Content").empty();
									   $("#Content").append(data);
									   });
		$("#ContentPane").show();
	},
	goHome: function()
	{
		$("#ContentPane").hide();
	},
	eventsDisplay: function()
	{
		if($("#calendar").is(":visible"))
		{
			$("#calendar").hide();
			$("#eventsToggle").empty();
			$("#eventsToggle").append("Show Events");
		}
		else
		{
			$("#calendar").show();
			$("#eventsToggle").empty();
			$("#eventsToggle").append("Hide Events");
		}
	}
}
