$(function() {
	$('.contact').each(function(){
		var email = $(this).attr('href');
		$(this).attr('href', email.replace(/#/g, 'e').replace(/_/g, 'a'));
	});

	$('dd:even').addClass('odd');
	$('.section').each(function() {
		$(this).find('h4:first').addClass('first');
	});
	
	$('#ie6 #content dl dd').pngfix();
	
	$('h3:first').addClass('first');
	$('li:first-child').addClass('first');
	$('li:last-child').addClass('last');
	
	$('a.sideBar').css('opacity', '0.75').hover(
		function() { $(this).stop().animate({opacity: 1}, 200); }, 
		function() { $(this).stop().animate({opacity: 0.75}, 200); });
	
	$('img.sideBar:first').addClass('sideBarTop');
	
	$('dd').hover(
		function() { $(this).addClass('hover'); },
		function() { $(this).removeClass('hover'); });
	
	$('dt').css('cursor', 'pointer').hover(
		function() { $(this).next().trigger('mouseover'); },
		function() { $(this).next().trigger('mouseout'); });
});

//This has to be in onload for Safari
window.onload = function() {
	/*var lastBottom = -1000;	
	$('.sideBar').each(function() {
		if($(this).position().top - lastBottom < 0)
			$(this).css('margin-top','0px');

		lastBottom = $(this).position().top + $(this).outerHeight();
	});*/
};

