/**
 * Author:              Matt Rossi
 * Website:             ifohdesigns.com
 * Article Source:      http://ifohdesigns.com/blog/tutorials/
 * Last Modified:       June 1st, 2008 by Guardian
 **/

$(document).ready(function() {
   $("#panel").hide();

 var a = $("<a>Goodies Section</a>").attr('href','#').addClass("btn-slide");
 $('#wrapper').before(a);

 $(".btn-slide").click(function(){

      if ($("#panel").is(":hidden")) {
        $("#panel").slideDown("slow");
	$(this).addClass("active");
         $.cookie('showTop', 'collapsed');
	return false;
	
      } else {
        $("#panel").slideUp("slow");
	$(this).removeClass("active");
        $.cookie('showTop', 'expanded');
	return false;
  }
});

// COOKIES
    // Header State
    var showTop = $.cookie('showTop');
    // Set the user's selection for the Header State
    if (showTop == 'collapsed') {
	$("#panel").show();
	$(".btn-slide").addClass("active");
	};


// SENT MAIL DISPLAY - start funct2
   $("#sent").hide();

 var b = $("<a><img src='sentmail.gif' border='0'></a>").attr('href','#').addClass("sent-slide");
 $('#sentwrapper').before(b);

 $(".sent-slide").click(function(){

      if ($("#sent").is(":hidden")) {
        $("#sent").slideDown("slow");
	$(this).addClass("active");
         $.cookie('showSent', 'collapsed');
	return false;

      } else {
        $("#sent").slideUp("slow");
	$(this).removeClass("active");
        $.cookie('showSent', 'expanded');
	return false;
  }
});

// COOKIES
    // Header State
    var showSent = $.cookie('showSent');
    // Set the user's selection for the Header State
    if (showSent == 'collapsed') {
	$("#sent").show();
	$(".sent-slide").addClass("active");
	};
// SENT MAIL DISPLAY - end func 2
// Shoutbox Editor Display - start funct3
   $("#shoutboxeditor").hide();

 var c = $("<a><img src='bbeditor/images/expandsb.gif' border='0'></a>").attr('href','#').addClass("shoutbox-slide");
 $('#shoutboxwrapper').before(c);

 $(".shoutbox-slide").click(function(){

      if ($("#shoutboxeditor").is(":hidden")) {
        $("#shoutboxeditor").slideDown("slow");
	$(this).addClass("active");
         $.cookie('showShoutbox', 'collapsed', { expires: 7 });
	return false;

      } else {
        $("#shoutboxeditor").slideUp("slow");
	$(this).removeClass("active");
        $.cookie('showShoutbox', 'expanded', { expires: 7 });
	return false;
  }
});

// COOKIES
    // Header State
    var showShoutbox = $.cookie('showShoutbox');
    // Set the user's selection for the Header State
    if (showShoutbox == 'collapsed') {
	$("#shoutboxeditor").show();
	$(".shoutbox-slide").addClass("active");
	};
// Shoutbox Editor Display - end func 3

// SENT MAIL DISPLAY - start funct4
    // Header State
    var showAAVideo = $.cookie('showAAVideo');
    // Set the user's selection for the Header State
    if (showAAVideo == 'expanded') {
   $("#Axis_and_Allies_Video").hide();
      } else {
   $("#Axis_and_Allies_Video").show();
  }

 var d = $("<a><img src='bbeditor/images/expandsb.gif' border='0'></a>").attr('href','#').addClass("Axis_and_Allies_Video-slide");
 $('#Axis_and_Allies_Video-wrapper').before(d);

 $(".Axis_and_Allies_Video-slide").click(function(){

      if ($("#Axis_and_Allies_Video").is(":hidden")) {
        $("#Axis_and_Allies_Video").slideDown("slow");
	$(this).addClass("active");
         $.cookie('showAAVideo', 'collapsed', { expires: 7 });
	return false;

      } else {
        $("#Axis_and_Allies_Video").slideUp("slow");
	$(this).removeClass("active");
        $.cookie('showAAVideo', 'expanded', { expires: 7 });
	return false;
  }
});

// COOKIES
    // Header State
    var showAAVideo = $.cookie('showAAVideo');
    // Set the user's selection for the Header State
    if (showAAVideo == 'collapsed') {
	$("#Axis_and_Allies_Video").show();
	$(".Axis_and_Allies_Video-slide").addClass("active");
	};
// SENT MAIL DISPLAY - end func 4
// SENT MAIL DISPLAY - start funct5
    // Header State
    var showAARTS = $.cookie('showAARTS');
    // Set the user's selection for the Header State
    if (showAARTS == 'expanded') {
   $("#www_axis-and-allies_com").hide();
      } else {
   $("#www_axis-and-allies_com").show();
  }

 var e = $("<a><img src='bbeditor/images/expandsb.gif' border='0'></a>").attr('href','#').addClass("www_axis-and-allies_com-slide");
 $('#www_axis-and-allies_com-wrapper').before(e);

 $(".www_axis-and-allies_com-slide").click(function(){

      if ($("#www_axis-and-allies_com").is(":hidden")) {
        $("#www_axis-and-allies_com").slideDown("slow");
	$(this).addClass("active");
         $.cookie('showAARTS', 'collapsed', { expires: 7 });
	return false;

      } else {
        $("#www_axis-and-allies_com").slideUp("slow");
	$(this).removeClass("active");
        $.cookie('showAARTS', 'expanded', { expires: 7 });
	return false;
  }
});

// COOKIES
    // Header State
    var showAARTS = $.cookie('showAARTS');
    // Set the user's selection for the Header State
    if (showAARTS == 'collapsed') {
	$("#www_axis-and-allies_com").show();
	$(".www_axis-and-allies_com-slide").addClass("active");
	};
// SENT MAIL DISPLAY - end func 5
// SENT MAIL DISPLAY - start funct6
    // Header State
    var showTGATC = $.cookie('showTGATC');
    // Set the user's selection for the Header State
    if (showTGATC == 'expanded') {
   $("#The_Game_and_The_Community").hide();
      } else {
   $("#The_Game_and_The_Community").show();
  }

 var f = $("<a><img src='bbeditor/images/expandsb.gif' border='0'></a>").attr('href','#').addClass("The_Game_and_The_Community-slide");
 $('#The_Game_and_The_Community-wrapper').before(f);

 $(".The_Game_and_The_Community-slide").click(function(){

      if ($("#The_Game_and_The_Community").is(":hidden")) {
        $("#The_Game_and_The_Community").slideDown("slow");
	$(this).addClass("active");
         $.cookie('showTGATC', 'collapsed', { expires: 7 });
	return false;

      } else {
        $("#The_Game_and_The_Community").slideUp("slow");
	$(this).removeClass("active");
        $.cookie('showTGATC', 'expanded', { expires: 7 });
	return false;
  }
});

// COOKIES
    // Header State
    var showTGATC = $.cookie('showTGATC');
    // Set the user's selection for the Header State
    if (showTGATC == 'collapsed') {
	$("#The_Game_and_The_Community").show();
	$(".The_Game_and_The_Community-slide").addClass("active");
	};
// SENT MAIL DISPLAY - end func 6
// AA Content Slider - start funct7
    // Header State
    var showAAcontSlid = $.cookie('showAAcontSlid');
    // Set the user's selection for the Header State
    if (showAAcontSlid == 'expanded') {
   $("#Axis_Allies_Real_Time_Strategy_PC_Game").hide();
      } else {
   $("#Axis_Allies_Real_Time_Strategy_PC_Game").show();
  }

 var g = $("<a><img src='bbeditor/images/expandsb.gif' border='0'></a>").attr('href','#').addClass("Axis_Allies_Real_Time_Strategy_PC_Game-slide");
 $('#Axis_Allies_Real_Time_Strategy_PC_Game-wrapper').before(g);

 $(".Axis_Allies_Real_Time_Strategy_PC_Game-slide").click(function(){

      if ($("#Axis_Allies_Real_Time_Strategy_PC_Game").is(":hidden")) {
        $("#Axis_Allies_Real_Time_Strategy_PC_Game").slideDown("slow");
	$(this).addClass("active");
         $.cookie('showAAcontSlid', 'collapsed', { expires: 7 });
	return false;

      } else {
        $("#Axis_Allies_Real_Time_Strategy_PC_Game").slideUp("slow");
	$(this).removeClass("active");
        $.cookie('showAAcontSlid', 'expanded', { expires: 7 });
	return false;
  }
});

// COOKIES
    // Header State
    var showAAcontSlid = $.cookie('showAAcontSlid');
    // Set the user's selection for the Header State
    if (showAAcontSlid == 'collapsed') {
	$("#Axis_Allies_Real_Time_Strategy_PC_Game").show();
	$(".Axis_Allies_Real_Time_Strategy_PC_Game-slide").addClass("active");
	};
// SENT MAIL DISPLAY - end func 7
// Secret Police - start funct8
    // Header State
    var secretPolice = $.cookie('secretPolice');
    // Set the user's selection for the Header State
    if (secretPolice == 'expanded') {
   $("#The_Secret_Police").hide();
      } else {
   $("#The_Secret_Police").show();
  }

 var h = $("<a><img src='bbeditor/images/expandsb.gif' border='0'></a>").attr('href','#').addClass("The_Secret_Police-slide");
 $('#The_Secret_Police-wrapper').before(h);

 $(".The_Secret_Police-slide").click(function(){

      if ($("#The_Secret_Police").is(":hidden")) {
        $("#The_Secret_Police").slideDown("slow");
	$(this).addClass("active");
         $.cookie('secretPolice', 'collapsed', { expires: 7 });
	return false;

      } else {
        $("#The_Secret_Police").slideUp("slow");
	$(this).removeClass("active");
        $.cookie('secretPolice', 'expanded', { expires: 7 });
	return false;
  }
});

// COOKIES
    // Header State
    var secretPolice = $.cookie('secretPolice');
    // Set the user's selection for the Header State
    if (secretPolice == 'collapsed') {
	$("#The_Secret_Police").show();
	$(".The_Secret_Police-slide").addClass("active");
	};
// SENT MAIL DISPLAY - end func 8
});
