


function fade(obj,turnOff) { 

	function setOp(howMuch) {
		var opVar = (howMuch/100);
		document.getElementById(this.id).style.MozOpacity=opVar;
		document.getElementById(this.id).style.filter = 'alpha(opacity='+howMuch+')';
	}
	
	function blinkLoop() {
		if (this.dir=="down") {this.bright-=10;if (this.bright<20) this.dir="up";}
		else if (this.dir=="up") {this.bright+=10;if (this.bright>90) this.dir="down";}
		this.setOp(this.bright);
	}
	
	function blinkObj(id) {
		this.id = id;
		this.bright = 100;
		this.dir = "down";
		this.blinkLoop = blinkLoop;	
		this.setOp = setOp;	
	}
	
	function blinkOff(obj) { eval(' clearInterval('+obj.id+'_blink); '); }
	
	if (turnOff) { blinkOff(obj);blinkObject.setOp(100); } else {
		blinkObject = new blinkObj(obj.id);
		eval(obj.id+'_blink = setInterval("blinkObject.blinkLoop();",60);  ');
	}
}




