function advanceById(id) {
	var obj = document.getElementById(id);
	var sw = obj.stepWidth;
	var oright = parseInt(obj.style.right);
	var otop  = parseInt(obj.style.top );
	var nextStep = obj.currentStep + 2;
	if (nextStep >= obj.checkPoints.length) nextStep = 0;

	var diffx = obj.checkPoints[nextStep] - oright;
	var diffy = obj.checkPoints[nextStep+1] - otop;
	if (diffx > 0) obj.style.right = (oright + sw) + 'px';
	else if (diffx < 0) obj.style.right = (oright - sw) + 'px';
	if (diffy > 0) obj.style.top  = (otop  + sw) + 'px';
	else if (diffy < 0) obj.style.top  = (otop  - sw) + 'px';

	//status = (obj.style.right+"\n"+obj.style.top);

	if (obj.style.right == obj.checkPoints[nextStep] + 'px'
	 && obj.style.top  == obj.checkPoints[nextStep+1] + 'px') {
		obj.currentStep = nextStep;
		/*
	var nextStep = obj.currentStep + 2;
	if (nextStep >= obj.checkPoints.length) nextStep = 0;
alert("currStep:\n"+obj.checkPoints[obj.currentStep]+"\n"+obj.checkPoints[obj.currentStep+1]+"\nnextStep:\n"+obj.checkPoints[nextStep]+"\n"+obj.checkPoints[nextStep+1]);
		*/
	}
	
	if (obj.looping) {
		setTimeout('advanceById("'+id+'")',obj.refreshTime);
	}

}
function loopMsn() {
	var id = 'msn';
	var checkPoints = [
		10, 0,
		10, 550,
		10, 710,
		10, 0
	];
	var obj = document.getElementById(id);
	obj.checkPoints = checkPoints;
	obj.currentStep = 0;
	obj.style.right = checkPoints[obj.currentStep] + 'px';
	obj.style.top  = checkPoints[obj.currentStep+1] + 'px';
	obj.stepWidth = 2;
	obj.refreshTime = 35;
	obj.looping = true;
	advanceById(id);
}
function showMsn(img, hoverhref) {
	var msn = document.getElementById('msn');
	msn.looping = false;
	img.orig = img.src;
	img.src = hoverhref;
}
function hideMsn(img) {
	var msn = document.getElementById('msn');
	msn.looping = true;
	advanceById('msn');
	img.src = img.orig;
}