function hideEmail(domain, user, link) {
	var email = user + '@' +   domain;
	if(link == true) email = '<a href="mailto:' + email + '">' + email + '</a>';
	document.write(email);
}

$(document).ready(function() {
	//Search bar text will default to 'Search' with light grey text, change to dark grey text when typing
	$("#navbar #search input, #contact-form fieldset div input, #comment-form fieldset div input").inputHint();
	$("#comment").textareaHint();
	//Make vertical shadow stretch the whole height of the page
	$("#sideshadow").css("height", $(document).height());
	
	var max_height = 0;
	$("#main-content, #sidebar").equalHeights();
	
	$("#sidebar ul li a").prod({
		distance: 5
	});
	$("#comment-submit").click(function() {
		$("#comment-form").submit();
	});
	$("#contact-submit").click(function() {
		var rand = Math.round(Math.random() * 99999999);
		$.ajax({
			type: "POST",
			url: "ajax/contact.php",
			data: "name=" + $("#name").val() + "&email=" + $("#email").val() + "&website=" + $("#website").val() + "&comment=" + $("#comment").val() + "&rand=" + rand,
			success: function(msg) {
				$("#confirmation").html(msg).hide().removeClass("success error").fadeIn();
				if(msg == "Hey, thanks for the message! I'll get back to you shortly.") {
					$("#confirmation").addClass("success");
					$("#contact-form input, #contact-form textarea").each(function() {
						$(this).val('').blur();
					});
				}
				else {
					$("#confirmation").addClass("error");
				}
			}
		});	
	});
});