function resizeOverlay(overlayDiv) {
	var newHeight = $('#wrapper').height() - 226;
	overlayDiv.each(function(me) { $(this).height(newHeight); });
}

/*OverLays for Client and Profile Page */
/* Overlays */
$(document).ready(function() {
     //Variable for Pages
     var testimony = 0;
     var athletes = 0;
     var coaches = 0;
     var entertainers = 0;
     var selectRetiredRoster = 0;
     $('body').click(function() {
          //var closeBtn = $('#close');
          if ($('#testimonials').css('display') == 'block')
               $('#testimonials').slideUp('slow');
          if ($('#athletes').css('display') == 'block')
               $('#athletes').slideUp('slow');
          if ($('#coaches').css('display') == 'block')
               $('#coaches').slideUp('slow');
          if ($('#entertainers').css('display') == 'block')
               $('#entertainers').slideUp('slow');
          if ($('#srr').css('display') == 'block')
               $('#srr').slideUp('slow');
     });
     $('#testimonials').click(function(event) {
          event.stopPropagation();
     });
     $('#athletes').click(function(event) {
          event.stopPropagation();
     });
     $('#coaches').click(function(event) {
          event.stopPropagation();
     });
     $('#entertainers').click(function(event) {
          event.stopPropagation();
     });
     $('#srr').click(function(event) {
          event.stopPropagation();
     });
	resizeOverlay($('#testimonials, #athletes, #coaches, #entertainers, #srr'));
     /* Testimonials */
     $("#openTes").click(function(event) {
          event.stopPropagation();
          if (testimony == 0) {
               if (athletes == 1) {
                    $("#athletes").slideUp("slow");
                    $(".football").removeClass('footballActive');
                    athletes = 0;
                    //Open 
                    $("#testimonials").slideDown("slow");
                    $(".testimonialsLink").addClass('testimonialsActive');
                    $("#close").show("slow");
                    //Close Button Function
                    $("#close").click(function() {
                         $("#testimonials").slideUp("slow");
                         $(".testimonialsLink").removeClass('testimonialsActive');
                         $("#close").hide("slow");
                         testimony = 0;
                    });
                    testimony = 1;
                    //
               } else if (coaches == 1) {
                    $("#coaches").slideUp("slow");
                    $(".coaches").removeClass('coachesActive');
                    coaches = 0;
                    //Open 
                    $("#testimonials").slideDown("slow");
                    $(".testimonialsLink").addClass('testimonialsActive');
                    $("#close").show("slow");
                    //Close Button Function
                    $("#close").click(function() {
                         $("#testimonials").slideUp("slow");
                         $(".testimonialsLink").removeClass('testimonialsActive');
                         $("#close").hide("slow");
                         testimony = 0;
                    });
                    testimony = 1;
                    //
               } else if (entertainers == 1) {
                    $("#entertainers").slideUp("slow");
                    $(".basketball").removeClass('basketballActive');
                    entertainers = 0;
                    //Open 
                    $("#testimonials").slideDown("slow");
                    $(".testimonialsLink").addClass('testimonialsActive');
                    $("#close").show("slow");
                    //Close Button Function
                    $("#close").click(function() {
                         $("#testimonials").slideUp("slow");
                         $(".testimonialsLink").removeClass('testimonialsActive');
                         $("#close").hide("slow");
                         testimony = 0;
                    });
                    testimony = 1;
                    //
               } else if (selectRetiredRoster == 1) {
                    $("#srr").slideUp("slow");
                    $(".srr").removeClass('srrActive');
                    selectRetiredRoster = 0;
                    //Open 
                    $("#testimonials").slideDown("slow");
                    $(".testimonialsLink").addClass('testimonialsActive');
                    $("#close").show("slow");
                    //Close Button Function
                    $("#close").click(function() {
                         $("#testimonials").slideUp("slow");
                         $(".testimonialsLink").removeClass('testimonialsActive');
                         $("#close").hide("slow");
                         testimony = 0;
                    });
                    testimony = 1;
                    //
               }
               $("#testimonials").slideDown("slow");
               $(".testimonialsLink").addClass('testimonialsActive');
               $("#close").show("slow");
               //Close Button Function
               $("#close").click(function() {
                    $("#testimonials").slideUp("slow");
                    $(".testimonialsLink").removeClass('testimonialsActive');
                    $("#close").hide("slow");
                    testimony = 0;
               });
               testimony = 1;
          } else {
               $("#testimonials").slideUp("slow");
               $(".testimonialsLink").removeClass('testimonialsActive');
               testimony = 0;
               $("#close").hide("slow");
          }

     });
     /* Athletes */
     $("#openAth").click(function(event) {
          event.stopPropagation();

          if (athletes == 0) {
               if (testimony == 1) {
                    $("#testimonials").slideUp("slow");
                    $(".testimonialsLink").removeClass('testimonialsActive');
                    testimony = 0;
                    //Open 
                    $("#athletes").slideDown("slow");
                    $(".football").addClass('footballActive');
                    $("#close").show("slow");
                    //Close Button Function
                    $("#close").click(function() {
                         $("#athletes").slideUp("slow");
                         $(".football").removeClass('footballActive');
                         $("#close").hide("slow");
                         athletes = 0;
                    });
                    athletes = 1;
                    //
               } else if (coaches == 1) {
                    $("#coaches").slideUp("slow");
                    $(".coaches").removeClass('coachesActive');
                    coaches = 0;
                    //Open 
                    $("#athletes").slideDown("slow");
                    $(".football").addClass('footballActive');
                    $("#close").show("slow");
                    //Close Button Function
                    $("#close").click(function() {
                         $("#athletes").slideUp("slow");
                         $(".football").removeClass('footballActive');
                         $("#close").hide("slow");
                         athletes = 0;
                    });
                    athletes = 1;
                    //
               } else if (entertainers == 1) {
                    $("#entertainers").slideUp("slow");
                    $(".basketball").removeClass('basketballActive');
                    entertainers = 0;
                    //Open 
                    $("#athletes").slideDown("slow");
                    $(".football").addClass('footballActive');
                    $("#close").show("slow");
                    //Close Button Function
                    $("#close").click(function() {
                         $("#athletes").slideUp("slow");
                         $(".football").removeClass('footballActive');
                         $("#close").hide("slow");
                         athletes = 0;
                    });
                    athletes = 1;
                    //
               } else if (selectRetiredRoster == 1) {
                    $("#srr").slideUp("slow");
                    $(".srr").removeClass('srrActive');
                    selectRetiredRoster = 0;
                    //Open 
                    $("#athletes").slideDown("slow");
                    $(".football").addClass('footballActive');
                    $("#close").show("slow");
                    //Close Button Function
                    $("#close").click(function() {
                         $("#athletes").slideUp("slow");
                         $(".football").removeClass('footballActive');
                         $("#close").hide("slow");
                         athletes = 0;
                    });
                    athletes = 1;
                    //
               }
               $("#athletes").slideDown("slow");
               $(".football").addClass('footballActive');
               $("#close").show("slow");
               //Close Button Function
               $("#close").click(function() {
                    $("#athletes").slideUp("slow");
                    $(".football").removeClass('footballActive');
                    $("#close").hide("slow");
                    athletes = 0;
               });
               athletes = 1;
          } else {
               $("#athletes").slideUp("slow");
               $(".football").removeClass('footballActive');
               $("#close").hide("slow");
               athletes = 0;
          }
     });
     /* Coaches */
     $("#openCoa").click(function(event) {
          event.stopPropagation();
          if (coaches == 0) {
               if (testimony == 1) {
                    $("#testimonials").slideUp("slow");
                    $(".testimonialsLink").removeClass('testimonialsActive');
                    testimony = 0;
                    //Open 
                    $("#coaches").slideDown("slow");
                    $(".coaches").addClass('coachesActive');
                    $("#close").show("slow");
                    //Close Button Function
                    $("#close").click(function() {
                         $("#coaches").slideUp("slow");
                         $(".coaches").removeClass('coachesActive');
                         $("#close").hide("slow");
                         coaches = 0;
                    });
                    coaches = 1;
                    //
               } else if (athletes == 1) {
                    $("#athletes").slideUp("slow");
                    $(".football").removeClass('footballActive');
                    athletes = 0;
                    //Open 
                    $("#coaches").slideDown("slow");
                    $(".coaches").addClass('coachesActive');
                    $("#close").show("slow");
                    //Close Button Function
                    $("#close").click(function() {
                         $("#coaches").slideUp("slow");
                         $(".coaches").removeClass('coachesActive');
                         $("#close").hide("slow");
                         coaches = 0;
                    });
                    coaches = 1;
                    //
               } else if (entertainers == 1) {
                    $("#entertainers").slideUp("slow");
                    $(".basketball").removeClass('basketballActive');
                    entertainers = 0;
                    //Open 
                    $("#coaches").slideDown("slow");
                    $(".coaches").addClass('coachesActive');
                    $("#close").show("slow");
                    //Close Button Function
                    $("#close").click(function() {
                         $("#coaches").slideUp("slow");
                         $(".coaches").removeClass('coachesActive');
                         $("#close").hide("slow");
                         coaches = 0;
                    });
                    coaches = 1;
                    //
               } else if (selectRetiredRoster == 1) {
                    $("#srr").slideUp("slow");
                    $(".srr").removeClass('srrActive');
                    selectRetiredRoster = 0;
                    //Open 
                    $("#coaches").slideDown("slow");
                    $(".coaches").addClass('coachesActive');
                    $("#close").show("slow");
                    //Close Button Function
                    $("#close").click(function() {
                         $("#coaches").slideUp("slow");
                         $(".coaches").removeClass('coachesActive');
                         $("#close").hide("slow");
                         coaches = 0;
                    });
                    coaches = 1;
                    //
               }
               $("#coaches").slideDown("slow");
               $(".coaches").addClass('coachesActive');
               $("#close").show("slow");
               //Close Button Function
               $("#close").click(function() {
                    $("#coaches").slideUp("slow");
                    $(".coaches").removeClass('coachesActive');
                    $("#close").hide("slow");
                    coaches = 0;
               });
               coaches = 1;
          } else {
               $("#coaches").slideUp("slow");
               $(".coaches").removeClass('coachesActive');
               $("#close").hide("slow");
               coaches = 0;
          }
     });
     /* Entertainers */
     $("#openEnt").click(function(event) {
          event.stopPropagation();
          if (entertainers == 0) {
               if (testimony == 1) {
                    $("#testimonials").slideUp("slow");
                    $(".testimonialsLink").removeClass('testimonialsActive');
                    testimony = 0;
                    //Open 
                    $("#entertainers").slideDown("slow");
                    $(".basketball").addClass('basketballActive');
                    $("#close").show("slow");
                    //Close Button Function
                    $("#close").click(function() {
                         $("#entertainers").slideUp("slow");
                         $(".basketball").removeClass('basketballActive');
                         $("#close").hide("slow");
                         entertainers = 0;
                    });
                    entertainers = 1;
                    //
               } else if (athletes == 1) {
                    $("#athletes").slideUp("slow");
                    $(".football").removeClass('footballActive');
                    athletes = 0;
                    //Open 
                    $("#entertainers").slideDown("slow");
                    $(".basketball").addClass('basketballActive');
                    $("#close").show("slow");
                    //Close Button Function
                    $("#close").click(function() {
                         $("#entertainers").slideUp("slow");
                         $(".basketball").removeClass('basketballActive');
                         $("#close").hide("slow");
                         entertainers = 0;
                    });
                    entertainers = 1;
                    //
               } else if (coaches == 1) {
                    $("#coaches").slideUp("slow");
                    $(".coaches").removeClass('coachesActive');
                    coaches = 0;
                    //Open 
                    $("#entertainers").slideDown("slow");
                    $(".basketball").addClass('basketballActive');
                    $("#close").show("slow");
                    //Close Button Function
                    $("#close").click(function() {
                         $("#entertainers").slideUp("slow");
                         $(".basketball").removeClass('basketballActive');
                         $("#close").hide("slow");
                         entertainers = 0;
                    });
                    entertainers = 1;
                    //
               } else if (selectRetiredRoster == 1) {
                    $("#srr").slideUp("slow");
                    $(".srr").removeClass('srrActive');
                    selectRetiredRoster = 0;
                    //Open 
                    $("#entertainers").slideDown("slow");
                    $(".basketball").addClass('basketballActive');
                    $("#close").show("slow");
                    //Close Button Function
                    $("#close").click(function() {
                         $("#entertainers").slideUp("slow");
                         $(".basketball").removeClass('basketballActive');
                         $("#close").hide("slow");
                         entertainers = 0;
                    });
                    entertainers = 1;
                    //
               }
               $("#entertainers").slideDown("slow");
               $(".basketball").addClass('basketballActive');
               $("#close").show("slow");
               //Close Button Function
               $("#close").click(function() {
                    $("#entertainers").slideUp("slow");
                    $(".basketball").removeClass('basketballActive');
                    $("#close").hide("slow");
                    entertainers = 0;
               });
               entertainers = 1;
          } else {
               $("#entertainers").slideUp("slow");
               $(".basketball").removeClass('basketballActive');
               $("#close").hide("slow");
               entertainers = 0;
          }
     });
     /* Select Retired Roster */
     $("#openRos").click(function(event) {
          event.stopPropagation();
          if (selectRetiredRoster == 0) {
               if (testimony == 1) {
                    $("#testimonials").slideUp("slow");
                    $(".testimonialsLink").removeClass('testimonialsActive');
                    testimony = 0;
                    //Open 
                    $("#srr").slideDown("slow");
                    $(".srr").addClass('srrActive');
                    $("#close").show("slow");
                    //Close Button Function
                    $("#close").click(function() {
                         $("#srr").slideUp("slow");
                         $(".srr").removeClass('srrActive');
                         $("#close").hide("slow");
                         selectRetiredRoster = 0;
                    });
                    selectRetiredRoster = 1;
                    //
               } else if (coaches == 1) {
                    $("#coaches").slideUp("slow");
                    $(".coaches").removeClass('coachesActive');
                    coaches = 0;
                    //Open 
                    $("#srr").slideDown("slow");
                    $(".srr").addClass('srrActive');
                    $("#close").show("slow");
                    //Close Button Function
                    $("#close").click(function() {
                         $("#srr").slideUp("slow");
                         $(".srr").removeClass('srrActive');
                         $("#close").hide("slow");
                         selectRetiredRoster = 0;
                    });
                    selectRetiredRoster = 1;
                    //
               } else if (entertainers == 1) {
                    $("#entertainers").slideUp("slow");
                    $(".basketball").removeClass('basketballActive');
                    entertainers = 0;
                    //Open 
                    $("#srr").slideDown("slow");
                    $(".srr").addClass('srrActive');
                    $("#close").show("slow");
                    //Close Button Function
                    $("#close").click(function() {
                         $("#srr").slideUp("slow");
                         $(".srr").removeClass('srrActive');
                         $("#close").hide("slow");
                         selectRetiredRoster = 0;
                    });
                    selectRetiredRoster = 1;
                    //
               } else if (athletes == 1) {
                    $("#athletes").slideUp("slow");
                    $(".football").removeClass('footballActive');
                    athletes = 0;
                    //Open 
                    $("#srr").slideDown("slow");
                    $(".srr").addClass('srrActive');
                    $("#close").show("slow");
                    //Close Button Function
                    $("#close").click(function() {
                         $("#srr").slideUp("slow");
                         $(".srr").removeClass('srrActive');
                         $("#close").hide("slow");
                         selectRetiredRoster = 0;
                    });
                    selectRetiredRoster = 1;
                    //
               }
               $("#srr").slideDown("slow");
               $(".srr").addClass('srrActive');
               $("#close").show("slow");
               //Close Button Function
               $("#close").click(function() {
                    $("#srr").slideUp("slow");
                    $(".srr").removeClass('srrActive');
                    $("#close").hide("slow");
                    selectRetiredRoster = 0;
               });
               selectRetiredRoster = 1;
          } else {
               $("#srr").slideUp("slow");
               $(".srr").removeClass('srrActive');
               $("#close").hide("slow");
               selectRetiredRoster = 0;
          }
     });
     /* Arrow Funtions for Sections */
     //Variables
     var currentTestimonials = 1;
     $(".forward").click(function() {
          if ($('#testimonies-' + (currentTestimonials + 1)).length)
               $('#testimonies-' + currentTestimonials).fadeOut("slow", function() {
                    currentTestimonials++;
                    $('#testimonies-' + currentTestimonials).fadeIn("slow");
               });
     });
     $(".backwards").click(function() {
          if ($('#testimonies-' + (currentTestimonials - 1)).length)
               $('#testimonies-' + currentTestimonials).fadeOut("slow", function() {
                    currentTestimonials--;
                    $('#testimonies-' + currentTestimonials).fadeIn("slow");
               });
     });
     /* Athletes Arrow Functions */
     var currentAthlete = 1;
     $(".forwardA").click(function() {
          //debugger
          if ($('#athletesSection-' + (currentAthlete + 1)).length) {
               $('#athletesSection-' + currentAthlete).fadeOut("slow", function() {
                    currentAthlete++;
                    $('#athletesSection-' + currentAthlete).fadeIn("slow");
               });
               if ($(".athletePicsContainer").length == currentAthlete + 1)
                    $('.forwardA').hide();
               $('.backwardsA').show();
          }
     });
     $(".backwardsA").click(function() {
          //debugger
          if ($('#athletesSection-' + (currentAthlete - 1)).length) {
               $('#athletesSection-' + currentAthlete).fadeOut("slow", function() {
                    currentAthlete--;
                    $('#athletesSection-' + currentAthlete).fadeIn("slow");
               });
               if (currentAthlete == 2)
                    $('.backwardsA').hide();
               $('.forwardA').show();
          }
     });
     /* Coaches Arrow Functions */
     var currentCoach = 1;
     $(".forwardC").click(function() {
          if ($('#coachesSection-' + (currentCoach + 1)).length) {
               $('#coachesSection-' + currentCoach).fadeOut("slow", function() {
                    currentCoach++;
                    $('#coachesSection-' + currentCoach).fadeIn("slow");
               });
               if ($(".coachesPicsContainer").length == currentCoach + 1)
                    $('.forwardC').hide();
               $('.backwardsC').show();
          }
     });

     $(".backwardsC").click(function() {
          if ($('#coachesSection-' + (currentCoach - 1)).length) {
               $('#coachesSection-' + currentCoach).fadeOut("slow", function() {
                    currentCoach--;
                    $('#coachesSection-' + currentCoach).fadeIn("slow");
               });
               if (currentCoach == 2)
                    $('.backwardsC').hide();
               $('.forwardC').show();
          }
     });
     /* Entertainers Arrow Functions */
     var currentEntertainer = 1;
     $(".forwardE").click(function() {
          if ($('#entertainersSection-' + (currentEntertainer + 1)).length) {
               $('#entertainersSection-' + currentEntertainer).fadeOut("slow", function() {
                    currentEntertainer++;
                    $('#entertainersSection-' + currentEntertainer).fadeIn("slow");
               });
               if ($(".basketballPicsContainer").length == currentEntertainer + 1)
                    $('.forwardE').hide();
               $('.backwardsE').show();
          }
     });
     $(".backwardsE").click(function() {
          if ($('#entertainersSection-' + (currentEntertainer - 1)).length) {
               $('#entertainersSection-' + currentEntertainer).fadeOut("slow", function() {
                    currentEntertainer--;
                    $('#entertainersSection-' + currentEntertainer).fadeIn("slow");
               });
               if (currentEntertainer == 2)
                    $('.backwardsE').hide();
               $('.forwardE').show();
          }
     });
     /* Select Retired Roster */
     var currentSRR = 1;
     $(".forwardS").click(function() {
          if ($('#srrSection-' + (currentSRR + 1)).length) {
               $('#srrSection-' + currentSRR).fadeOut("slow", function() {
                    currentSRR++;
                    $('#srrSection-' + currentSRR).fadeIn("slow");
               });
               if ($(".srrPicsContainer").length == currentSRR + 1)
                    $('.forwardS').hide();
               $('.backwardsS').show();
          }
     });
     $(".backwardsS").click(function() {
          if ($('#srrSection-' + (currentSRR - 1)).length) {
               $('#srrSection-' + currentSRR).fadeOut("slow", function() {
                    currentSRR--;
                    $('#srrSection-' + currentSRR).fadeIn("slow");
               });
               if (currentSRR == 2)
                    $('.backwardsS').hide();
               $('.forwardS').show();
          }
     });
});
