window.addEvent('load', function() {
	var m = $$('.muadib');
	
	for(var i = 0; i < m.length; i++) {
		update_shadow(m[i]);
	}
});

function update_shadow(el) {
	var height = el.getStyle('height').toInt() + 36;
	var shadow = el.getNext();
	shadow.setStyle('height', height + 'px');
	shadow.show();
}

var cur_post = false;
function on_post_rollover() {
	cur_post = this.post;
	$('permalinky_' + this.id).show();
	update_shadow($('muadib_' + this.id));
	show_tag(cur_post, true, this.date, this.timeago);
}

function show_tag(el, tween, date, timeago) {
	var y = el.getPosition().y - window.getScrollTop() + 40;
	y = y < 0 ? 40 : y;
	document.getElementById('cpu').showTag(y, tween, date, timeago);
}

function on_post_rollout() {
	$('permalinky_' + this.id).hide();
	update_shadow($('muadib_' + this.id));
	cur_post = false;
	document.getElementById('cpu').hideTag();
}

var Tagz = new Class({
	initialize: function(id, post, date, timeago) {
		this.id   = id;
		this.post = post;
		this.date = date;
		this.timeago = timeago;
	}
});