
/****************************************************************************

  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 showNHist() {

	$("#notehistpinwheel").html('<div class="loading"></div>');

	$.get("data/notifyhistory.php", { tz: nowlocal },
		function(data) {
			//alert("NotifyHist data: \n\n"+data);
			
			$("#notifyhistplaceholder").html(data);
			
			$('#notifyHistDialog').dialog('open');
			$("#notehistpinwheel").html('');


		}
	);
}

$(document).ready(function(){

	$("#filterAll").css("fontWeight", "bold");
	
	$("#filterAll").click( function() {
		$("#filterAll").css("fontWeight", "bold");
		$("#filterUpdateOnly").css("fontWeight", "normal");
		$("#filterChatOnly").css("fontWeight", "normal");
		$("#filterOnOffOnly").css("fontWeight", "normal");
		$("#filterTweetsOnly").css("fontWeight", "normal");
		
		$("#notifyhistoryholder :hidden").fadeIn();		
	});

	$("#filterUpdateOnly").click( function() {
		$("#filterUpdateOnly").css("fontWeight", "bold");
		$("#filterAll").css("fontWeight", "normal");
		$("#filterChatOnly").css("fontWeight", "normal");
		$("#filterOnOffOnly").css("fontWeight", "normal");
		$("#filterTweetsOnly").css("fontWeight", "normal");
		
		$("#notifyhistoryholder > *").fadeOut();

		$("#notifyhistoryholder > .update").fadeIn();
	});

	$("#filterChatOnly").click( function() {
		$("#filterChatOnly").css("fontWeight", "bold");
		$("#filterAll").css("fontWeight", "normal");
		$("#filterUpdateOnly").css("fontWeight", "normal");
		$("#filterOnOffOnly").css("fontWeight", "normal");
		$("#filterTweetsOnly").css("fontWeight", "normal");

		$("#notifyhistoryholder > *").fadeOut();

		$("#notifyhistoryholder > .quote").fadeIn();
	});

	$("#filterOnOffOnly").click( function() {
		$("#filterOnOffOnly").css("fontWeight", "bold");
		$("#filterAll").css("fontWeight", "normal");
		$("#filterUpdateOnly").css("fontWeight", "normal");
		$("#filterChatOnly").css("fontWeight", "normal");
		$("#filterTweetsOnly").css("fontWeight", "normal");
		
		$("#notifyhistoryholder > *").fadeOut();

		$("#notifyhistoryholder > .online").fadeIn();
		$("#notifyhistoryholder > .offline").fadeIn();
	});

	$("#filterTweetsOnly").click( function() {
		$("#filterTweetsOnly").css("fontWeight", "bold");
		$("#filterAll").css("fontWeight", "normal");
		$("#filterChatOnly").css("fontWeight", "normal");
		$("#filterOnOffOnly").css("fontWeight", "normal");
		$("#filterUpdateOnly").css("fontWeight", "normal");
		
		$("#notifyhistoryholder > *").fadeOut();

		$("#notifyhistoryholder > .twitter").fadeIn();
	});


	$("#notifyHistDialog").dialog({
		bgiframe: true,
		autoOpen: false,
		height: 700,
		maxWidth: 330,
		minWidth: 330,
		width: 330,
		position: ['right','center'],
		modal: false,
		resizable: true,
		buttons: {
			'Close': function () { 
				$("#notifyHistDialog").dialog('close');
			},
/*
			Cancel: function() {
				$("#previewDialog").dialog('close');
			}
*/
		},
		close: function() {
			// do nothing
		}
	});
	
});



// EOF
