
$(document).ready(function() {
	
	$('#faq p').css('zoom', '1').hide();
	
	$('a[href^=\'http\']').attr('target','_blank');
	
	$('#faq h3').each(function() {
		$(this).addClass('question');
		
		$(this).click(function(event) {
			
			var $answer = $(this).nextUntil('h3.question');
			
			$answer.each(function() {
				
				if($(this).is(':hidden')) {
					$(this).show();
				} else {
					$(this).hide();
				}
			});
		
		$("#column2").height($("#faq").height()+57);
		});
	}
		
	);
	
	if($('#supplementChooserWidget')) {

		// Live search in supplements
		$('#supplementChooserWidget input[type=text]').keyup(function() {

			var term = $('#supplementChooserWidget input[type=text]').val().toLowerCase();
						
		  	$("#resultList a").each(function(i){
				
				var text = $(this).text().toLowerCase();
			
				var text = text.replace('è', 'e');
			
			   if(text.indexOf(term) == -1)
			       $(this).parent().hide();
				else
					$(this).parent().show();

			});
		});

		$('#supplementChooserWidget #resultList').scrollTo('a.selected');
	
	}
});

