steps=20;
speedup=15;
speeddown=30;

ahex1=255;
ahex2=162;
ahex3=0;

bhex1=255;
bhex2=255;
bhex3=255;

/* ------------------------------------------------ */

calcFactors();

function calcFactors() {
	if((ahex1+ahex2+ahex3)>(bhex1+bhex2+bhex3)) {
		chex1=ahex1;	chex2=ahex2;	chex3=ahex3;
		ahex1=bhex1;	ahex2=bhex2;	ahex3=bhex3;
		bhex1=chex1;	bhex2=chex2;	bhex3=chex3;
	}

	fhex1 = Math.floor((bhex1-ahex1)/steps);
	fhex2 = Math.floor((bhex2-ahex2)/steps);
	fhex3 = Math.floor((bhex3-ahex3)/steps);
}



hex1=ahex1;
hex2=ahex2;
hex3=ahex3;
up = true
speed = speedup

fadetext()

function fadetext(){ 
	done=0;

	if (up) {
		if((hex1+hex2+hex3)<(bhex1+bhex2+bhex3)) {
			hex1+=fhex1;
			hex2+=fhex2;
			hex3+=fhex3;
			document.getElementById("fadingNavi").style.color="rgb("+hex1+","+hex2+","+hex3+")";
		} else {
			up = false
			speed = speeddown
		}
	} else {
		if((hex1+hex2+hex3)>(ahex1+ahex2+ahex3)) {
			hex1-=fhex1;
			hex2-=fhex2;
			hex3-=fhex3;
			document.getElementById("fadingNavi").style.color="rgb("+hex1+","+hex2+","+hex3+")";
		} else {
			up = true
			speed = speedup
		}
	}

	setTimeout("fadetext()",speed); 
}

