function runJS(){

	$("#background").height($('#container').height());
	$("#characters").height($('#container').height());
		   
	$('.email').html(function(){
	 var e = $(this).attr('id');
	 var a = "@";
	 var d = "nalma";
	 var c = ".ca";
	 var h = 'mailto:' + e + a + d + c;
	 $(this).parent('a').attr('href', h);
	 return e + a + d + c;
	});

	$('.showText').click(function() {

		$(this).hide();
	
		$(this).next().show(137);
	
	});
	
	$('.hideText').click(function() {
	
		$(this).parent().hide(0, function(){
		
			$(this).prev().show();
		
		});
	
	});

}

$(function(){ 

	runJS(); 
	
	var hsh=window.location.hash.replace("#","");
	
	if(hsh.length>0){
	
		$('.hTarget').load('/'+hsh+'/.b',function(){ 
		
			runJS(); 
			
			scrollTo("#menu",250);
			
			$('.loader').hide();
			
		});
	
	}
	
	var hTargetCache=$('.hTarget').html();

});

$(window).bind('hashchange', function() { 

	var hsh = window.location.hash.replace("#","");
	
	if(hsh.length>0) { 
	
		$('.loader').show();
	
		$('.hTarget').load('/'+hsh+'/.b',function(){ 
		
			runJS(); 
			
			scrollTo("#menu",250); 
			
			$('.backBtn').show();
			
			$('.loader').hide();
			
		});
		
	} 
	
	else if (!window.location.hash && hTargetCache) { $('.hTarget .loader').show(); $('.hTarget').html(hTargetCache); runJS(); scrollTo("#menu",0); }

});

