
var testimonials = $(".testimonials");
if (testimonials.length)
{
	testimonials.append("<ul class=\"numbers\"></ul>");
	var h = 0;
	testimonials.find("> ul:not(.numbers) > li").each(function(i)
	{
		h = Math.max(h, $(this).outerHeight());
		$(this).attr("id", "testimonial-" + i);
		testimonials.find(".numbers").append("<li><a href=\"#testimonial-" + i + "\">" + (i + 1) + "</a></li>");
	});
	testimonials.find("> ul:not(.numbers)").height(h);

	testimonials.find(".numbers a").click(function(event, fast)
	{
		if ($(this).hasClass("selected"))
			return false;

		$(this).parents(".numbers").find("a.selected").removeClass("selected");
		$(this).addClass("selected");

		if (fast)
		{
			$(this).parents(".testimonials").find("> ul:not(.numbers) > li:visible").hide();
			$($(this).hrefId()).show();
		}
		else
		{
			$(this).parents(".testimonials").find("> ul:not(.numbers) > li:visible").fadeOut(500);
			$($(this).hrefId()).animate({ opacity: "show" }, 500, "linear", function() { if ($.browser.msie && $.browser.version == 7) this.style.removeAttribute("filter"); });
		}

		return false;
	});

	testimonials.find(".numbers a:first").trigger("click", true);
}


