$(function() {
	$('#art a').hover(function() {
		opAnim($(this).prev('em'), '1', 0, 100);
		opAnim($(this).children('span'), '1', 0, 100);
	}, function() {
		opAnim($(this).prev('em'), '0.5', 0, 250);
		opAnim($(this).children('span'), '0.8', 0, 250);
	});
	$('#art a').click(function() {
		opAnim($(this).prev('em'), '0.5', 250, 250);
		opAnim($(this).children('span'), '0.8', 250, 250);
	});
	$('h1 a').hover(function() {
		opAnim($(this).next('b'), '1', 0, 150);
	}, function() {
		opAnim($(this).next('b'), '0', 0, 250);
	});
	dEm($('h1 a'));
});

function opAnim(el, val, del, time) {
	$(el).stop().delay(del).animate({
		opacity: val
		}, time, 'linear'
	);
}

function dEm(anchor) {
	var proto = anchor.attr('href');
	var u = anchor.attr('rel');
	var em = proto + $.base64Decode(u) + document.domain;
	anchor.attr('href', em);
}
