function changeto(highlightcolor){
source=event.srcElement
if (source.tagName=="TR"||source.tagName=="TABLE")
return
while(source.tagName!="TD")
source=source.parentElement
if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
source.style.backgroundColor=highlightcolor
}

function changeback(originalcolor){
if (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")
return
if (event.toElement!=source)
source.style.backgroundColor=originalcolor
}

var layerList = new Array("annai");
var layerLeftPos = new Array("113");
var layerTopPos = new Array("108");
var cmTimer = new Array();
var ready = null;

function init(){
	var obj;
	for(field in layerList){
		obj = objectFinder(layerList[field]);
		moveLayerTo(obj, layerLeftPos[field], layerTopPos[field]);
	}

	ready = true;

}

function objectFinder(nm, d){
	if(!d) d = document;

	var p;
	if((p = nm.indexOf("?")) > 0 && parent.frames.length){
		d = parent.frames[nm.substring(p + 1)].document;
		nm = nm.substring(0, p);
	}

	var i;
	var x;
	if(!(x = d[nm]) && d.all){
		x = d.all[nm];
	}else if(!(x = d[nm]) && d.getElementById){
		x = d.getElementById(nm);
	}
	for(i = 0; !x && i < d.forms.length; i++){
		x = d.forms[i][nm];
	}
	for(i = 0; !x && d.layers && i < d.layers.length; i++){
		x = objectFinder(nm, d.layers[i].document);
	}
	return x;
}

function openMenu(na){
	if(ready){
		if(cmTimer[na]){
			clearTimeout(cmTimer[na]);
			cmTimer[na] = null;
		}
		var obj;
		obj = objectFinder(na);
		layerVisible(obj, "visible");
	}
}

function clearMenu(na){
	if(ready){
		if(cmTimer[na]){
			var obj;
			obj = objectFinder(na);
			layerVisible(obj, "hidden");
			clearTimeout(cmTimer[na]);
			cmTimer[na] = null;
		}else{
			cmTimer[na] = setTimeout("clearMenu(" + "'" + na + "');", 20);
		}
	}
}

function moveLayerTo(obj, x, y){
	if(document.all || document.getElementById){
		obj.style.left = x;
		obj.style.top = y;
	}else if(document.layers){
		obj.moveTo(x, y);
	}
}

function moveLayerBy(obj, dx, dy){
	if(document.all || document.getElementById){
		obj.style.pixelLeft += dx;
		obj.style.pixelTop += dy;
	}else if(document.layers){
		obj.moveBy(dx, dy);
	}
}

function layerVisible(obj, option){
	if(option == "visible"){
		if(document.all || document.getElementById){
			obj.style.visibility = "visible";
		}else if(document.layers){
			obj.visibility = "show";
		}
	}else if(option == "hidden"){
		if(document.all || document.getElementById){
			obj.style.visibility = "hidden";
		}else if(document.layers){
			obj.visibility = "hide";
		}
	}
}

