$(document).ready(function(){
	
    $(".no_active_state_rollover").hover(
      function () {
		var offImgSrc = $(this).attr("src");
		var onImgSrc = offImgSrc.replace("_off", "_on");
		$(this).attr("src", onImgSrc);
      }, 
      function () {
		var offImgSrc = $(this).attr("src");
		var onImgSrc = offImgSrc.replace("_on", "_off");
		$(this).attr("src", onImgSrc);
      }
    );


	$("#MusicChartPopularDLC_Button").click(function(result) {
		GHToggleHideShow('MusicChartNewestDLC', 'MusicChartPopularDLC');
		var offImgSrc = $(this).attr("src");
		var onImgSrc = offImgSrc.replace("_on", "_active");
		$(this).attr("src", onImgSrc);
		var offImgSrc = $("#MusicChartNewestDLC_Button").attr("src");
		var onImgSrc = offImgSrc.replace("_active", "_off");
		$("#MusicChartNewestDLC_Button").attr("src", onImgSrc);		
		//$("#MusicChartNewestDLC").hide();
		//$("#MusicChartPopularDLC").show();
	});
	
	$("#MusicChartNewestDLC_Button").click(function(result) {
		GHToggleHideShow('MusicChartPopularDLC', 'MusicChartNewestDLC');
		var offImgSrc = $(this).attr("src");
		var onImgSrc = offImgSrc.replace("_on", "_active");
		$(this).attr("src", onImgSrc);
		var offImgSrc = $("#MusicChartPopularDLC_Button").attr("src");
		var onImgSrc = offImgSrc.replace("_active", "_off");
		$("#MusicChartPopularDLC_Button").attr("src", onImgSrc);
		//$("#MusicChartNewestDLC").show();
		//$("#MusicChartPopularDLC").hide();
	});
	
	$("#PopularConversations_Twitter_Buttons").click(function(result) {
		//GHToggleHideShow('PopularConversations_Forums', 'PopularConversations_Twitter');
		$("#PopularConversations_Twitter").show();
		$("#PopularConversations_Forums").hide();
		$("#PopularConversations_Facebook").hide();
		
		var offImgSrc = $(this).attr("src");
		var onImgSrc = offImgSrc.replace("_on", "_active");
		$(this).attr("src", onImgSrc);
		var offImgForumSrc = $("#PopularConversations_Forums_Buttons").attr("src");
		var onImgForumSrc = offImgForumSrc.replace("_active", "_off");
		$("#PopularConversations_Forums_Buttons").attr("src", onImgForumSrc);
		var offImgFacebookSrc = $("#PopularConversations_Facebook_Buttons").attr("src");
		var onImgFacebookSrc = offImgFacebookSrc.replace("_active", "_off");
		$("#PopularConversations_Facebook_Buttons").attr("src", onImgFacebookSrc);		
	});
	
	$("#PopularConversations_Facebook_Buttons").click(function(result) {
		//GHToggleHideShow('PopularConversations_Forums', 'PopularConversations_Twitter');
		$("#PopularConversations_Twitter").hide();
		$("#PopularConversations_Forums").hide();
		$("#PopularConversations_Facebook").show();

		var offImgSrc = $(this).attr("src");
		var onImgSrc = offImgSrc.replace("_on", "_active");
		$(this).attr("src", onImgSrc);
		var offImgTwitterSrc = $("#PopularConversations_Twitter_Buttons").attr("src");
		var onImgTwitterSrc = offImgTwitterSrc.replace("_active", "_off");
		$("#PopularConversations_Twitter_Buttons").attr("src", onImgTwitterSrc);
		var offImgForumSrc = $("#PopularConversations_Forums_Buttons").attr("src");
		var onImgForumSrc = offImgForumSrc.replace("_active", "_off");
		$("#PopularConversations_Forums_Buttons").attr("src", onImgForumSrc);
	});
	
	$("#PopularConversations_Forums_Buttons").click(function(result) {
		//GHToggleHideShow('PopularConversations_Twitter', 'PopularConversations_Forums');
		$("#PopularConversations_Twitter").hide();
		$("#PopularConversations_Forums").show();
		$("#PopularConversations_Facebook").hide();

		var offImgSrc = $(this).attr("src");
		var onImgSrc = offImgSrc.replace("_on", "_active");
		$(this).attr("src", onImgSrc);
		var offImgTwitterSrc = $("#PopularConversations_Twitter_Buttons").attr("src");
		var onImgTwitterSrc = offImgTwitterSrc.replace("_active", "_off");
		$("#PopularConversations_Twitter_Buttons").attr("src", onImgTwitterSrc);
		var offImgFacebookSrc = $("#PopularConversations_Facebook_Buttons").attr("src");
		var onImgFacebookSrc = offImgFacebookSrc.replace("_active", "_off");
		$("#PopularConversations_Facebook_Buttons").attr("src", onImgFacebookSrc);
	});
	
	$("#PopularMedia_Images_Button").click(function(result) {
		GHToggleHideShow('PopularMedia_Videos', 'PopularMedia_Images');

		var offImgSrc = $(this).attr("src");
		var onImgSrc = offImgSrc.replace("_on", "_active");
		$(this).attr("src", onImgSrc);
		var offImgSrc = $("#PopularMedia_Videos_Button").attr("src");
		var onImgSrc = offImgSrc.replace("_active", "_off");
		$("#PopularMedia_Videos_Button").attr("src", onImgSrc);		
		//$("#PopularMedia_Videos").hide();
		//$("#PopularMedia_Images").show();
	});
	
	$("#PopularMedia_Videos_Button").click(function(result) {
		GHToggleHideShow('PopularMedia_Images', 'PopularMedia_Videos');

		var offImgSrc = $(this).attr("src");
		var onImgSrc = offImgSrc.replace("_on", "_active");
		$(this).attr("src", onImgSrc);
		var offImgSrc = $("#PopularMedia_Images_Button").attr("src");
		var onImgSrc = offImgSrc.replace("_active", "_off");
		$("#PopularMedia_Images_Button").attr("src", onImgSrc);
		//$("#PopularMedia_Videos").show();
		//$("#PopularMedia_Images").hide();
	});
	
	$("#MusicChartNewestDLC").click(function(result) {
		GHToggleHideShow('PopularMedia_Images', 'PopularMedia_Videos');
		//$("#PopularMedia_Videos").show();
		//$("#PopularMedia_Images").hide();
	});
	
	
	// music homepage
	$("#MusicDLCChartNewest").click(function(result) {
		GHToggleHideShow('Music_DLCChartPopular', 'Music_DLCChartNewest');
	});
	
	$("#MusicDLCChartPopular").click(function(result) {
		GHToggleHideShow('Music_DLCChartNewest', 'Music_DLCChartPopular');
	});
	
	// latest media (/media/)
	$("#LatestMedia_Images_Button").click(function(result) {
		GHToggleHideShow('LatestMedia_Wallpapers', 'LatestMedia_Images');
	});
	
	$("#LatestMedia_Wallpapers_Button").click(function(result) {
		GHToggleHideShow('LatestMedia_Images', 'LatestMedia_Wallpapers');
	});
	
	
});

function GHToggleHideShow(hide, show)
{
	$("#"+hide).hide();
	$("#"+show).show();
}
