Cufon.replace(".cfr-gill", {fontFamily: 'Gill Sans'});
$(function(){
	var content = $("#content");
	
	$("#links li").click(function(e){
		$("#links li").removeClass("light");
		var target = $(e.target);
		if(! target.is("li"))
			target = target.parents('li');
		var t = target.attr('title');
		if (t != 'blog') {
			var page = target.attr('title') + ".html";
			content.load(page);			
			target.addClass("light");
		}
	});
	
	$(".about-text-more > *").live('click', function(e){
		var target = $(e.target);
		if(! target.hasClass(".about-text-more"))
			target = target.parents('.about-text-more');	
		var mt = $(".more-text", target).html();
		$("body").append("<div id='gray-box'></div><div id='white-box'></div>");
		$("#white-box").html(mt).addClass('cfr-gill').click(function(){
			$("#gray-box").remove();
			$("#white-box").remove();
		}); 
		Cufon.refresh();
	});
	
	$("#send-form").live('click', function(){
		var data = {
			"name":$("#name").val(),
			"email":$("#email").val(),
			"message":$("#message").val(),
			"action": true
		}
		$.post('mail.php', data, function(d){
			alert(d);
		});
	});
});

