Behaviour.addLoadEvent (
  function() {
  	if (document.getElementById('username')){
    	document.getElementById('username').focus();
	}
  }
);

var FadeSteps = new Array();
	FadeSteps[1] = "ff";
	FadeSteps[2] = "ee";
	FadeSteps[3] = "dd";
	FadeSteps[4] = "cc";
	FadeSteps[5] = "bb";
	FadeSteps[6] = "aa";
	FadeSteps[7] = "99";

function DoFade(colorId, targetId) {
	if (colorId >= 1) {
		document.getElementById(targetId).style.backgroundColor = "#ffff" + FadeSteps[colorId];
		
		// If it's the last color, set it to transparent
		if (colorId==1) {
			document.getElementById(targetId).style.backgroundColor = "transparent";
		}
		colorId--;
		
		// Wait a little bit and fade another shade
		setTimeout("DoFade("+colorId+",'"+targetId+"')", 600);
	}
}
Behaviour.addLoadEvent (
	function() {
		if (document.getElementById('sessionFlash')){
			DoFade(7,'sessionFlash');
		}
	}
);