$(document).ready(function()
{
	
	
	$(".select-trigger").click(function()
	{
		$(this).closest(".search-select").find(".select-options-top").show();
		return false;
	});
	
	$(".select-options-top").hover(function()
	{
		
	}, function()
	{
		$(this).hide();
	});
	
	$(".select-option").click(function()
	{
		var optionVal = $(this).closest("li").find(".option").val();
		$(this).closest(".search-select").find(".select-option").removeClass("current");
		$(this).addClass("current");
		$(this).closest(".search-select").find(".select-value").attr("value", optionVal);
		$(this).closest(".search-select").find(".select-trigger").html(optionVal.substring(0, 15));
		$(this).closest(".search-select").find(".select-options-top").hide();
		return false;
	});
	
	$("#search-gender-container .radio").click(function()
	{
		$("#search-gender-container .radio").removeClass("selected");
		$(this).addClass("selected");
		
		$("#search-gender-container .radio-input").attr("checked", "");
		$(this).closest(".search-checkbox").find(".radio-input").attr("checked", "checked");
	});
	

	
	
	$(".search-select .select-trigger").each(function()
	{
		var val = $(this).closest(".search-select").find(".select-value").val().substring(0, 15);
		if(val == "")
		{
			$(this).html("Select");
		}
		else
		{
			$(this).html(val);
		}
	}); 
	
	$(".trainer").hover(function()
	{
		$(this).addClass("hover");
	}, function()
	{
		$(this).removeClass("hover");
	});
		
	
	$(".trainer").each(function()
	{
		$(this).fancybox(
		{
			'content' : $(this).find(".bio").html(),
			'onClosed' : function(){ $(".trainer").removeClass("current"); }
		});
	});
	
	$(".trainer").click(function()
	{
		$(".trainer").removeClass("current");
		$(this).addClass("current");
	});
		
	
	
		
});

