$(document).ready(function(){
   
   var CurrentTeamIndex = 0;
   
   var TeamCount = $("#Team div");
   var FullTeamCount = TeamCount.length;
   
   $("#Team div:gt(0)").css("display","none");
   
   $("#Team a.Next").click(function () { 
      CurrentTeamIndex++;
	  if (CurrentTeamIndex == FullTeamCount) {CurrentTeamIndex = 0;};
	  $("#Team div:eq(" + CurrentTeamIndex + ")").css("display","block");
	  $("#Team div:lt(" + CurrentTeamIndex + ")").css("display","none");
	  $("#Team div:gt(" + CurrentTeamIndex + ")").css("display","none");
	  return false;
    });
   
   $("#Team a.Previous").click(function () { 
      CurrentTeamIndex--;
	  if (CurrentTeamIndex == -1) {CurrentTeamIndex = FullTeamCount-1;};
	  $("#Team div:eq(" + CurrentTeamIndex + ")").css("display","block");
	  $("#Team div:lt(" + CurrentTeamIndex + ")").css("display","none");
	  $("#Team div:gt(" + CurrentTeamIndex + ")").css("display","none");
	  return false;
    });
   
   var CurrentPreviewIndex = 0;
   
   var PreviewCount = $("#Preview div");
   var FullPreviewCount = PreviewCount.length;
   
   $("#Preview div:gt(0)").css("display","none");
   
   $("#Preview a.Next").click(function () { 
      CurrentPreviewIndex++;
	  if (CurrentPreviewIndex == FullPreviewCount) {CurrentPreviewIndex = 0;};
	  $("#Preview div:eq(" + CurrentPreviewIndex + ")").css("display","block");
	  $("#Preview div:lt(" + CurrentPreviewIndex + ")").css("display","none");
	  $("#Preview div:gt(" + CurrentPreviewIndex + ")").css("display","none");
	  return false;
    });
   
   $("#Preview a.Previous").click(function () { 
      CurrentPreviewIndex--;
	  if (CurrentPreviewIndex == -1) {CurrentPreviewIndex = FullPreviewCount-1;};
	  $("#Preview div:eq(" + CurrentPreviewIndex + ")").css("display","block");
	  $("#Preview div:lt(" + CurrentPreviewIndex + ")").css("display","none");
	  $("#Preview div:gt(" + CurrentPreviewIndex + ")").css("display","none");
	  return false;
    });
   
   var CurrentQuoteIndex = 0;
   
   var QuoteCount = $("#Quotes div");
   var FullQuoteCount = QuoteCount.length;
   
   $("#Quotes div:gt(0)").css("display","none");
   
   $("#Quotes a.Next").click(function () { 
      CurrentQuoteIndex++;
	  if (CurrentQuoteIndex == FullQuoteCount) {CurrentQuoteIndex = 0;};
	  $("#Quotes div:eq(" + CurrentQuoteIndex + ")").css("display","block");
	  $("#Quotes div:lt(" + CurrentQuoteIndex + ")").css("display","none");
	  $("#Quotes div:gt(" + CurrentQuoteIndex + ")").css("display","none");
	  return false;
    });
   
   $("#Quotes a.Previous").click(function () { 
      CurrentQuoteIndex--;
	  if (CurrentQuoteIndex == -1) {CurrentQuoteIndex = FullQuoteCount-1;};
	  $("#Quotes div:eq(" + CurrentQuoteIndex + ")").css("display","block");
	  $("#Quotes div:lt(" + CurrentQuoteIndex + ")").css("display","none");
	  $("#Quotes div:gt(" + CurrentQuoteIndex + ")").css("display","none");
	  return false;
    });
   
 });