/*--------------------------------------------

	added by Eric Ritchey for 
	FAQ Page Development 11/18/2008

--------------------------------------------*/

$(document).ready(function() {

	// --- for bucket hover color
	$('.faq-bucket').hover (
		function () {
			$(this).addClass("hover");
			return false;
		},
		function () {
			$(this).removeClass("hover");
			return false;
		}
	);
	
	// --- for question hover
	$('li h3').hover (
		function () {
			$(this).css({color:'#26A5F0'});
			return false;
		},
		function () {
			$(this).css({color:'#26A5F0'});
			return false;
		}
	);
	
	// --- show individual questions
	$('.questions li h3').toggle(
		function(){
			$(this).siblings().show();
			$(this).addClass('close');
			return false;
		},
		function(){
			$(this).siblings().hide();
			$(this).removeClass('close');
			return false;
		}
	)
	
	// --- show all questions in section
	$('.questions h2').toggle (
		function () {
			$(this).addClass('close');
			
			var nextElement = $($(this).next()[0]).children();
			
			for(i=0;i<nextElement.length;i++) {
				$(nextElement[i]).children('div').slideDown('slow');
			}

			return false;
		},
		function () {
			$(this).removeClass('close');

			var nextElement = $($(this).next()[0]).children();
			
			for(i=0;i<nextElement.length;i++) {
				$(nextElement[i]).children('div').slideUp('fast');
			}
			return false;
		}
	);
});
