	
	// GET SCREEN RESOLUTION
		/*if (window.location.search == "")
		{
			window.location.href = "index.php?width=" + screen.width + "&height=" + screen.height;
		}*/


	// FADE IN FUNCTIONS
	// ------------------------------------------------

	// objectFadeIn() - defined object will fade in
		function objectFadeIn(str)
		{
			imageId = str;
			image = document.getElementById(imageId);
			setOpacity(image, 0);
			image.style.visibility = 'visible';
			fadeIn(imageId,0);
		}

	// setOpacity() - sets the opacity of the image
		function setOpacity(obj, opacity) 
		{
			opacity = (opacity == 100)?99.999:opacity;
		  
			// IE/Win
			obj.style.filter = "alpha(opacity:"+opacity+")";
		  
			// Safari<1.2, Konqueror
			obj.style.KHTMLOpacity = opacity/100;
		  
			// Older Mozilla and Firefox
			obj.style.MozOpacity = opacity/100;
		  
			// Safari 1.2, newer Firefox and Mozilla, CSS3
			obj.style.opacity = opacity/100;
		}

	// fadeIn() - gradually increases the opacity of the image to show the image fading in
		function fadeIn(objId,opacity) 
		{
		  if (document.getElementById) {
			obj = document.getElementById(objId);
			if (opacity <= 100) {
			  setOpacity(obj, opacity);
			  opacity += 10;
			  window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 50);
			}
		  }
		}
		
		function fadeOut(objId,opacity) 
		{
		  if (document.getElementById) {
			obj = document.getElementById(objId);
			if (opacity > 0) {
			  setOpacity(obj, opacity);
			  if (opacity < 20)
			  {
				  obj.style.visibility = "hidden";
			  }
			  else
			  {
				  opacity -= 10; 
			  }
			  window.setTimeout("fadeOut('"+objId+"',"+opacity+")", 50);
			}
		  }
		}




	// AJAX
	
		var pageLoad = 0;
		
		// GET INFO
			function getInfo()
			{
				new Ajax.Request("get_info.php", 
					{ 
						method: 'post', 
						postBody: '',
						onComplete: outputInfo 
					});
			}
	
			function outputInfo(req)
			{
				// output info into content
					$('content').innerHTML= req.responseText;
				
				if (pageLoad < 1)
				{
					pageLoad++;	
				}
				else
				{
					// fade-in content
						objectFadeIn('info');
				}
			}
			
	
		// GET NEWS
			function getNews()
			{
				new Ajax.Request("get_news.php", 
					{ 
						method: 'post', 
						postBody: '',
						onComplete: outputNews 
					});
			}
	
			function outputNews(req)
			{
				// output returned news posts into content
					$('content').innerHTML= req.responseText;
				
				// fade-in content
					objectFadeIn('content');
			}
			
		
		// GET SCHEDULE
			function getSchedule(date)
			{
				new Ajax.Request("get_schedule.php", 
					{ 
						method: 'post', 
						postBody: 'date=' + date,
						onComplete: outputSchedule 
					});
			}
	
			function outputSchedule(req)
			{
				// output schedule into content area
					$('content').innerHTML= req.responseText;
				
				// fade-in content
					objectFadeIn('schedule');
			}




	// SSET WOLF
		function splashWolf()
		{ 
			//document.body.style.backgroundColor = '#811305';
			//fadeOut('splash',100);
			//fadeOut('splash',100);
			window.setTimeout("document.getElementById('splash').style.backgroundImage = 'url(http://www.hooliefestmpls.com/dev2011/gui/splash_wolf.gif)'", 1000);
			//objectFadeIn('splash');
			//document.getElementById('splash').style.visibility = 'visible'", 1000);
			//window.setTimeout("objectFadeIn('splash')", 1000);
			//document.getElementById('splash').style.visibility = 'visible';
		}


	// ON PAGE LOAD
		window.onload = function() 
		{
			//document.body.style.backgroundImage = "url(http://www.hooliefestmpls.com/dev2011/gui/1600_1500.jpg)";
			//window.setTimeout("setBackground()", 2000);
			
			// fade in splash background image
				objectFadeIn('splash');
				getInfo();
			
			// wait one second, then fade in content
				window.setTimeout("objectFadeIn('wrapper')", 1000);
				window.setTimeout("objectFadeIn('info')", 1000);
				
			// fade in wolf
				//window.setTimeout("splashWolf()", 2000);
		}
		
		window.onkeydown = function(e)
		{
			if(e.keyCode == 32)
			{
				//splashWolf();
			}
		}
