$(function(){
	// Emails
	$(".email").each(function (){
		$(this).html($(this).html().replace(/ at /, "@").replace(/ dot /, "."));
		$(this).attr('href', "mailto:" + $(this).html());
	});
	
	// Nav Menu
	$('nav > ul').lavaLamp({target: ".section-link", fx: "easeOutBack", speed: 500});
	
	// Portfolio Tiles
	$('.web_design .tile, .graphic_design .tile').hover(function() {
		$(this).children('img').animate({ // Mouse In
			height: '150',
			width: '200'
		}, 'fast', 'easeOutBack');
	}, function() {
		$(this).children('img').animate({ // Mouse Out
			height: 200,
			width: 200
		}, 'fast', 'easeOutBack');
	});
	
	// Light Box
	$(".graphic_design a.tile, .photography a.tile, .art a.tile").fancybox({
		'overlayShow'	:	true,
		'overlayOpacity':	.7,
		'overlayColor'	:	'#000',
		'centerOnScroll':	true
	});
	
	// Syntax Highlighting
	$("code.html, code.html-php").each(function(){
		$(this).jush('htm');
	});
	$("code.js").each(function(){
		$(this).jush('js');
	});
	$("code.css").each(function(){
		$(this).jush('css');
	});
	$("code.php").each(function(){
		$(this).jush('php');
	});
	
	if (navigator.appName != "Microsoft Internet Explorer") {
		$("code.html, code.html-php, code.js, code.css, code.php, code.htaccess").each(function(){
			$(this).html($(this).html().replace(/\t/g, "<span class='code-tab'>\t</span>"));
		});
	}
	
	// Scroll effect
	$("body").css("backgroundAttachment", "fixed");
	$(window).scroll(function () {
		$("body").css("backgroundPosition", '50% ' + (0 - $(window).scrollTop() / 2) + 'px');
	});
	
	// Background Clouds Animation
	/*oldX = 0;
	
	$(document).mousemove(function(e){
		if (oldX == 0) oldX = e.pageX;
		change = (oldX - e.pageX) / 30;
		backgroundX = parseInt($('body').css('backgroundPosition')) + change;
		$('body').css('backgroundPosition', (backgroundX + change) + 'px ' + (-e.pageY/40) + 'px');
		oldX = e.pageX;
	});
	
	$(document).mouseout(function(e){
		oldX = 0;
	});*/
});