//	farrell fritz web site redesign
//	functions for attorney page by nick poulos
//	last modified 2.25.2009 

$(document).ready(function () {
	
	var letter = $(document).getUrlParam("letter");
	if (letter==null)	letter="a";
	
	letter=letter.toUpperCase();

	$("#attorney-initials li").hover(
		function () { 
			$(this).addClass("selected"); 
		}	
		, 
		function () { 
			if ($(this).attr("id")!=letter)
				$(this).removeClass("selected"); 
		}
	);
	
	$("#btn_search").click(function() {
									
		$("#frm_search").submit();
	
	});
	
	$("#attorney-initials li").click(function () { $(this).addClass("selected"); });
	
	$("#attorney-listing li").mouseover(function () {
		
		$("#attorney-listing li").removeClass("selected");
		
		$(this).addClass("selected");
													  
	});
	
	$("#attorney-active-profile").html($(".attorney-profile:first").html());
	
	$(".attorney-profile").hide();
	
	$("#attorney-listing li").mouseover(function () {
			//$(".attorney-profile").hide();
			$("#attorney-active-profile").empty();
			$("#attorney-active-profile").html(
			$("#attorney-profile-" + $(this).attr("id").toLowerCase()).html());								   
	});
	
	
	
	
	$(".search-page-link").click(function () {
		
		$("#frm_search").attr("action", "index.php?pg=attorneys&searchpg=" + $(this).text());
		$("#frm_search").submit();
											
											
	});
	
	$("#frm_search input").keypress(function (e) {  
		if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {  
			$("#frm_search").submit(); 
			return false;  
		} else {  
			return true;  
		}  
	});  
	
	
	
	
	
	
});
