/****************************************************************************

  This file is part of the GamesCast.tv Website

	GamesCast.tv coded by Steve "GreasedScotsman" Huff, 
	Copyright 2010 Steve Huff
	
	It is distributed under the terms of the 
	GNU General Public License
		
***************************************************************************/


function noticeUpdate() {

	$.get("/notice.php",  
		function(data) {
			
			if (data == "") {
				// do nothing
			}
			else {
				//alert("Data is: \n\n|"+data+"|");
				$.jGrowl(data, { sticky: true, theme:  'default', speed:  'slow' });
			}
		}
	);
}

function offlineLogo() {
	$("#offlinetv").show();
	$("#onlinetv").hide();
}

function onlineLogo() {
	$("#onlinetv").show();
	$("#offlinetv").hide();
}

function onlineLogoUpdate() {
	$.get("/site_status.php",  
		function(data) {
			
			if (data == "") {
				// do nothing
			}
			else {
				if (data == "online") { onlineLogo(); } else { offlineLogo(); }
			}
		}
	);
}


/////////////////////////////////////////////////////////////////////
//	INTERVAL/TIMEOUT GLOBALS
/////////////////////////////////////////////////////////////////////
var noShowsOnlineTimerId;

/////////////////////////////////////////////////////////////////////

$(document).ready(function(){


	noticeUpdate();
	setInterval( "noticeUpdate()", 60000 );

	onlineLogoUpdate();
	setInterval( "onlineLogoUpdate()", 120000 );
	
	var dwrap = [false, false];
	
});

// EOF
