var chg = 0
var val = 0
var moo = 0
var back = ""

function change(inp){

	chg = 128 + 128 * Math.cos(val);
	
	if(chg > 255){
		chg=255;
	}
	if(chg < 0){
		chg=0;
	}

	if(inp=="list"){
		var invert = 255 - chg;
		var tt = 2 * chg;
		if(invert > 255){
			invert = 255;
		}
		if(invert < 0){
			invert=0;
		}
		if(tt > 255){
			tt=255;
		}
		if(tt < 0){
			tt=0;
		}
		document.getElementById("list").style.color = "#"+RGB(invert, 0, chg);
	}

	val = val + 0.3;

}

function RGB(r,g,b){
	var moo = "";
	moo = moo + toHex(r);
	moo = moo + toHex(g);
	moo = moo + toHex(b);
	return moo;
}

hexValues = new Array("0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F");

function toHex(integer) {
	hexDigit1 = Math.floor(integer / 16);
	hexDigit2 = Math.floor(integer % 16);
	return hexValues[hexDigit1] + hexValues[hexDigit2];
}

function m(inp,inp2,inp3){

	if(inp2 == "list"){
		if(inp==1){
			back = document.getElementById("list"+inp3).style.color;
			document.getElementById("list"+inp3).style.color = RGB(255,255,0);
			moo = setInterval("change('list')",50);
		}else{
			clearInterval(moo);
			document.getElementById("list"+inp3).style.color = back;
			val = 0;
		}
	}

}