$(document).ready(function() {
	slide("#nav ul li a", 29, 35, 150);
    initLinks();
});

function slide(id, pad_over, pad_out, time)
{
	
	// creates the hover-slide effect for all link elements 		
	$(id).each(function(i)
	{
		if (!($(this).parent().hasClass("selected")))
		{
			$(this).hover(
			function()
			{
				$(this).animate({ paddingTop: pad_over }, time);
			},		
			function()
			{
				$(this).animate({ paddingTop: pad_out }, time);
			});
		}
	});
}

function attorneyHover(id)
{
	$(id).hover(
		function()
		{
			$(this).addClass('hover');
		},
		function()
		{
			$(this).removeClass('hover');
		});
	
	$(id).click(
		function()
		{
			var href = $(this).children('p').children('a').attr('href');
			document.location = href;
		});
}

// Script written by Drew Noakes -- http://drewnoakes.com
function initLinks() {
  for (i in document.links) {
    link = document.links[i];
    if (link.rel && link.rel.indexOf('external')!=-1) {
      link.onclick = onExternalLinkActivate;
      link.onkeypress = onExternalLinkActivate;
    }
  }
}

function onExternalLinkActivate() {
  window.open(this.href);
  return false;
}
