$.fn.pause = function(duration) {
	// NOTE: there's a built-in delay method in jQuery 1.4
    $(this).animate({ dummy: 1 }, duration);
    return this;
};

$(function() {

	$('#mainmenu li').hover( // menu hover animation
		function() { // mouse on
			$('span',this).css('display','block').filter(':not(:animated)').pause(100).slideDown(200); // slight delay to stop flicker of speaking block text
		},
		function() { // mouse off
			$('span',this).slideUp('slow');
		}
	);
	
	// disable all animations for current section
	//var currentId = $('body').attr('id'); // get id of body
	//$('body#' + currentId + ' #mainmenu li#menu_' + currentId).unbind();
	
	$('.e').each(function() {
 		var $this = $(this);
 		var t = $this.text();
		$this.text(t.replace('[at]','@').replace(/\[dot\]/g,'.'));
		$(this).attr('href','mailto:'+$this.text());
	});

	// just for fun
	$('#oi').css('display','none');
	$('#china').click(function() {
		$('#oi').css('display','block');
		$(this).filter(':not(:animated)').slideUp('slow');
		$(this).slideDown('slow');
	});
	
	$('#decoration').click(function() {
		$('#footer').toggle('slow');
	});
	$('#footer').click(function() {
		$(this).toggle('slow');
	});

	$("#tabs").tabs({ fx: { duration:'normal', opacity:'toggle' } });

});

