anicounter = 0;
colorvalue = 255;
function fadein() {
		if(anicounter<100){
				anicounter++;
				if(anicounter>10) colorvalue -= 5;
				// Sets the color value for the element.
				document.getElementById("lcd").style.color="rgb("+colorvalue+","+colorvalue+","+colorvalue+")";
				//Call fadein again
				setTimeout("fadein()",50);
			} else {
			  	   //After the 20 steps, reset values and call fadeout
				ge_valopacity=0;
			    anicounter=0;
			    colorvalue=0;
                setTimeout("fadeout()",20);
			}
		}
	//************************************************************************
	// Second step of animation -	Second loop
	// Fades out the text while increasing the font spacing and at the same time increasing the
	// text color value from white (0,0,0) to white (255,255,255). Since the background color
	// is white, the effect will be like moving from black to transparent.
	//
	// Everything is the same except that colorvalue increases.
	//

	function fadeout() {
		// 20 steps of animation.
	        if(anicounter<100) {
				// Increases anicounter.
				anicounter++;
				if(anicounter>10) colorvalue+=5;
				// Sets the color value for the "text"+el element.
				document.getElementById("lcd").style.color="rgb("+colorvalue+","+colorvalue+","+colorvalue+")";
				// Updates the left position.
				setTimeout("fadeout()",50);
	        } else {
			// Reset all animation parameters.
			anicounter=0;
			colorvalue=255;
			// Update the element index.
	        updatecount();
	        }
	}
function updatecount(){
	var currentTime = new Date()
	var offset = 0;
	var text = '';
	var month = currentTime.getMonth() + 1
	var day = currentTime.getDate()
	var year = currentTime.getFullYear()
	switch(currentTime.getDay())
	{
		case 0: //Sunday
		offset = 4;
		break;
		case 1: //Monday
		offset = 3;
		break;
		case 2: //Tuesday
		offset = 2;
		break;
		case 3: //Wednesday
		offset = 1;
		break;
		case 4: //Thursday
		if(currentTime.getHours() > 20)
		{
			offset = 7;
		}else
		{
			offset = 0;
			if(currentTime.getHours() == 20)
			{
				text = "Lost Is On Right Now!";
			}
		}
		break;
		case 5: //Friday
		offset = 6;
		break;
		case 6: //Saturday
		offset = 5;
		break;
	}
	var add = offset * 86400000;
	var wednesday = currentTime.valueOf() + add;
	var Wed = new Date(wednesday);
	Wed.setHours(20,0,0);
	if(document.getElementById){
		x=document.getElementById("lcd");
		var secs = (Wed.valueOf() - currentTime.valueOf()) /1000;
		var sec = secs % 60;
		secs = (secs - sec) / 60;
		var min = secs % 60;
		secs = (secs - min) / 60;
		var hour = secs % 24;
		secs = (secs - hour) /24;
		var day = secs % 7;
		var week = (secs - day) / 7 ;
		if(!text){
			text = day + " days " + hour + " hours " + min + " minutes " +  sec + " seconds";
		}
		x.innerHTML= text;
		fadein();
	}
}

