function prepKidsQuotesArrow(selector) {
	$(selector).bind('click', function () {
		var link = $(this).attr('href');
		$('#quoteWrap').fadeOut('slow',function () {
			$('#quoteWrap').empty();
			$.ajax({
			    url: link,
			    cache: false,
			    success: function(html){
				    $("#quoteWrap").append(html).fadeIn('slow');
				    prepKidsQuotesArrow(selector);
				}
			});
		});
		return false;
	
	});
}


$(document).ready(
	function(){
		
		// Rotating Photos
		
		$('#photoRotator').innerfade({
			speed: 1000,
			timeout: 4000,
			type: 'sequence'
		});
		
		
		// Staff Section JS
		$('.teamPhotoList li').hide();
		$('.teamPhotoList li.teamMember-1').show();
		
		$('.teamNameList li').bind('mouseover', function () {
			var teamMember = $(this).attr('class');
			$('.teamPhotoList li').hide();
			$('.teamPhotoList li.' + teamMember).show();
		});
		
		$('.hygienists .teamNameList li').bind('mouseover', function () {
			var teamMember = $(this).attr('class');
			$('.hygienists #bottomBlock ul').hide();
			$('.hygienists #bottomBlock ul.' + teamMember).show();
		});
		
		
		//Questions, FAQ's & Quotes JS
		$('.questionList').hide();
		$('.questionList li:first').addClass('active');
		$('.questionList:first').show();
		$('.answerWrap').hide();
		$('.answerWrap:first').show();
		
		$('.quoteList').hide();
		$('.quoteList:first').show();
		$('.kidsIllustration').hide();
		$('.kidsIllustration:first').show();
		
		$('.questionList li').bind('click', function () {
			var questionID = $(this).attr('id');
			$('.questionList li').removeClass('active');
			$(this).addClass('active');
			$('.answerWrap').fadeOut();
			$('.' + questionID).fadeIn();
		});

		
		arrowIndex = 1;
		maxArrowIndex = $('.questionList').size();
		maxQuoteArrowIndex = $('.quoteList').size();
		
		if (maxArrowIndex == 1) {
			$('#navArrowsWrap').hide();
		} else {
			$('#prevArrow').hide();
		}
		
		if (maxQuoteArrowIndex == 1) {
			$('#navArrowsWrap').hide();
		} else {
			$('#prevArrow').hide();
		}

//Worked on in re-code	
		$('.questionsLayout .nextArrow').bind('click', function () {
			var nextArrowIndex = arrowIndex + 1;
			var nextQuestionListID = 'questionList-' + nextArrowIndex;
			var nextAnswerGroupID = 'answerGroup-' + nextArrowIndex;
			arrowIndex = arrowIndex + 1;
			if (arrowIndex == maxArrowIndex) {
				$('#nextArrow').hide();
			} else {
				$('#nextArrow').show();
			}
			if (arrowIndex == 1) {
				$('#prevArrow').hide();
			} else {
				$('#prevArrow').show();
			}
			$('.questionList').fadeOut();
			$('.answerGroup').fadeOut();
			$('.answerWrap').hide();
			$('.questionList li').removeClass('active');
			$('#' + nextQuestionListID + ' li:first').addClass('active');
			$('#' + nextAnswerGroupID + ' .answerWrap:first').show();
			$('#' + nextQuestionListID).fadeIn();
			$('#' + nextAnswerGroupID).fadeIn();
		});

//Worked on in re-code		
		$('.questionsLayout .prevArrow').bind('click', function () {
			var prevArrowIndex = arrowIndex - 1;
			var prevQuestionListID = 'questionList-' + prevArrowIndex;
			var prevAnswerGroupID = 'answerGroup-' + prevArrowIndex;
			arrowIndex = arrowIndex - 1;
			if (arrowIndex == maxArrowIndex) {
				$('#nextArrow').hide();
			} else {
				$('#nextArrow').show();
			}
			if (arrowIndex == 1) {
				$('#prevArrow').hide();
			} else {
				$('#prevArrow').show();
			}
			$('.questionList').fadeOut();
			$('.answerGroup').fadeOut();
			$('.answerWrap').hide();
			$('.questionList li').removeClass('active');
			$('#' + prevQuestionListID + ' li:first').addClass('active');
			$('#' + prevAnswerGroupID + ' .answerWrap:first').show();
			$('#' + prevQuestionListID).fadeIn();
			$('#' + prevAnswerGroupID).fadeIn();
		});
		
		prepKidsQuotesArrow('#kidsQuotes .prevArrow, #kidsQuotes .nextArrow');
		
// END DOCMUENT READY
});