var transition = false, x1, x2, y1, y2, step, timer;
var steps = document.all? 10 : 50

function effect(o) {
	if(transition == true) return;
	transition = true;
	$kk('mover').style.left = getX(o)+"px";
	$kk('mover').style.top = getY(o)+"px";
	$kk('mover').style.visibility = 'visible';
	x1 = $kk('mover').offsetLeft;
	y1 = $kk('mover').offsetTop;
	x2 = x1 + getX($kk('destination')) - getX(o);
	y2 = y1 + getY($kk('destination')) - getY(o);
	step = 0;
	timer = setInterval("animation()", 10);
}


function animation() {
	step++;
	if(step >= steps) {
		clearInterval(timer);
		$kk('mover').style.visibility = 'hidden';
		transition = false;
	}
	x = x1 + (x2-x1) * (step/steps);
	y = y1 + (y2-y1) * (step/steps);
	$kk('mover').style.left = x+"px";
	$kk('mover').style.top = y+"px";
}

function $kk(s) {
	return document.getElementById(s);
}

function getX(o) {
	var t = 0;
	while(o != null) {
		t += o.offsetLeft;
		o = o.offsetParent;
	}
	return t;
}

function getY(o) {
	var t = 0;
	while(o != null) {
		t += o.offsetTop;
		o = o.offsetParent;
	}
	return t;
}





