/*
 * Event wrapper
 * for IE and Firefox compatibility
 */
function Event(evt)
{
	this.src = null;
	this.tgt = null;
	this.keyCode = null;

	this.stopPropagation = function() {};

	if(navigator.appName.indexOf("Microsoft") >= 0)
	{
		this.src = event.srcElement;
		this.tgt = event.toElement;
		this.keyCode = event.keyCode;
	}
	else
	{
		this.src = evt.target;
		this.tgt = evt.relatedTarget;
		this.keyCode = evt.keyCode;
		this.stopPropagation = evt.stopPropagation;
	}
}

function stopFlashClass(td) {
	clearTimeout(td.iFlashTimeout);
	td.className = td.getAttribute("initialClass");
	td.flashCount = 0;
}

function flashClass(td) {
	td.id = td.uniqueID;
	if(! td.flashCount ) td.flashCount = 0;
	td.flashCount ++;
	if(td.flashCount % 2) {
		td.setAttribute("initialClass", td.className);
		td.className = "TocHover";
	}
	else
		td.className = td.getAttribute("initialClass");
	if(td.flashCount < 5)
		td.iFlashTimeout = setTimeout(function() { flashClass(td); }, 50);
	else
		td.flashCount = 0;
}
