$(document).ready(function(){

	
	//Email Obfuscation
		$(".replaceAt").replaceWith("@");
  	$(".obfuscate").each(function () {
  		$(this).attr("href", "mailto:"+$(this).text());
  	});
  	

	//Bringing Up Extra Content Window
	$('.expand').bind('click', function(){
		var relValue = $(this).attr('rel');
		$('#rightCol').html($('.expandedContent[rel=' + relValue + ']').html());
		return false;
	});
	
	var currentHash = getHash();
	if (!currentHash) {
		$('.expandedContent:first').each( function() {
			$('#rightCol').html($('.expandedContent:first').html());
		});
	} else {
		$('#rightCol').html($('.expandedContent[rel=' + currentHash + ']').html());
	}
	
	
	

	// Contact popdown at top of page
	var slideTime = 200;
	var contactpopuptimer = false;
	$("#contactwrapper, .contact").hover(function(){
		if (contactpopuptimer) clearTimeout(contactpopuptimer);
		$("#contactwrapper").slideDown(slideTime);
		$("#btn-contact").css({'background-position' : '0 -48px'});
	}, function() {
		contactpopuptimer = setTimeout(function() {
		$("#contactwrapper").slideUp(slideTime);
		$("#btn-contact").css({'background-position' : '0 0px'});
		}, slideTime);
	});


});
function getHash() { var hash = window.location.hash; return hash.substring(1); }