$(function(){
	
	//var pathname = window.location.pathname;
	//console.log(pageName);
	//$("#header li, #sidebar ul.sidenav li").find("a[href='"+location.pathname+"']").each(function(){
    //$(this).addClass("currentpage")
    //})

	// navigation effects
	$("#header li").hover(function(){
		
		$("#header li:hover").css({ 'margin-top' : '-5px' });
		
		$(this).stop().animate({ marginTop: "0px" }, 'fast' );
		},function(){
        $(this).stop().animate({ marginTop: "-5px"}, 'fast');
	});
	
	$("#sidebar ul.sidenav li").hover(function(){
	
		$("#sidebar ul.sidenav li:hover").css({ 'margin-Right' : '0px' });
		
		$(this).stop().animate({ marginRight: "-10px" }, 'fast' );
		},function(){
        $(this).stop().animate({ marginRight: "0px"}, 'fast');
	});
	
	
	// meet the team section
	
	$('#people div').css({'position' : 'absolute', 'top' : '0', 'left' : '0'}).hide();
	$('#people div img').css({'position' : 'absolute', 'top' : '-229px', 'left' : '20px'})
	$('#blank').fadeIn("slow");
	
	$('#team a').click(function(event){
		
		event.preventDefault();
		var name = $(this).text().toLowerCase().replace(' ','-');
		$('#blank').hide();
		$('#people div:visible').hide();
		
		$('#' + name).fadeIn("slow");
	});	
	
	// hide email address
    
    $('span.mailme').mailme();
    $('span.mailme1').mailme1(); 
});

    jQuery.fn.mailme = function() {
    var at = / at /;
    var dot = / dot /g;
    this.each( function() {
    var addr = jQuery(this).text().replace(at,"@").replace(dot,".");
    var title = jQuery(this).attr('title')
    $(this)
    .after('<span class="mailme"><a href="mailto:'+addr+'" title="'+title+'">Email Me</a></span>')
    .remove();
    });
};
    
    jQuery.fn.mailme1 = function() {
    var at = / at /;
    var dot = / dot /g;
    this.each( function() {
    var addr = jQuery(this).text().replace(at,"@").replace(dot,".");
    var title = jQuery(this).attr('title')
    $(this)
    .after('<a href="mailto:'+addr+'" title="'+title+'">' + addr + '</a>')
    .remove();
    });
};











