
var MOL=new Array();

function MenuObj(_A,_B,_C,_D,_E,_F,_G,_H,_I){
	this.name=_A;
	this.bOn=_E;
	this.bOf=_F;
	this.bA=_G;
	this.SBS=SBS;
	this.showing=false;
	this.TM=TM;
	document.onclick=dropMenu;
	this.Direction=_I;
	MOL[MOL.length]=this;
	if (document.all) {
		this.divObj=eval('document.all.' + _B);
		this.divStyleObj=eval('document.all.' + _B + '.style');
		this.refTDObj=eval('document.all.' + _C);
		if (_D)
		this.DdTDObj=eval('document.all.' +  _D);
		this.frmObj=eval('document.all.' +  _H);
	}
	else if (document.layers) {
		this.divObj=eval('document.layers.' + _B);
		this.divStyleObj=eval('document.layers.' + _B + '.style');
		this.refTDObj=eval('document.layers.' + _C);
		if (_D)
		this.DdTDObj=eval('document.layers.' +  _D);
		this.frmObj=eval('document.layers.' +  _H);
	}
	else if (document.getElementById) {
		this.divObj=eval("document.getElementById('" + _B + "');");
		this.divStyleObj=eval("document.getElementById('" + _B + "').style;");
		this.refTDObj=eval("document.getElementById('" + _C + "');");
		if (_D)
		this.DdTDObj=eval("document.getElementById('" + _D + "');");
		this.frmObj=eval("document.getElementById('" + _H + "');");
	}
	this.strShow='visible';
	this.strHide='hidden';
}

function getXY(Obj){
	for (var sumTop=0,sumLeft=0;Obj!=document.body;sumTop+=Obj.offsetTop,sumLeft+=Obj.offsetLeft, Obj=Obj.offsetParent);
		return {left:sumLeft,top:sumTop}
}
function TM() {
	if (!this.showing) {
		var RelObjCords=getXY(this.refTDObj);
		if (this.Direction) {
			this.divStyleObj.top =  RelObjCords.top + -this.divObj.offsetHeight + "px";
			this.divStyleObj.left =  RelObjCords.left + "px";
		}
		else {
			this.divStyleObj.top =  RelObjCords.top + 28 + "px";
			this.divStyleObj.left =  RelObjCords.left + "px";
			
		}
		var pCurrMenuObj=ROP(this);
		CM(this);
		this.SBS('clicked');
		this.divStyleObj.visibility =  this.strShow;
		this.showing=true;
	}
	else {
		this.divStyleObj.visibility =  this.strHide;
		this.showing=false;
		this.SBS();
	}
}
function SBS(wS){
	if (typeof this.refTDObj != "undefined"){
		if (wS == 'on'){
			if (this.bOn){
				if (typeof this.DdTDObj != "undefined")
					this.DdTDObj.className=this.bOn;
					this.refTDObj.className=this.bOn;
			}
		}else if (wS == 'clicked'){
			if (this.bA){
				if (typeof this.DdTDObj != "undefined")
					this.DdTDObj.className=this.bA;
					this.refTDObj.className=this.bA;
			}
		}else{
			if (this.bOf){
				if (typeof this.DdTDObj != "undefined")
					this.DdTDObj.className=this.bOf;
					this.refTDObj.className=this.bOf;
			}
		}
	}
}

function CM(callerObj){
	for (aIndex=0;aIndex < MOL.length; aIndex++){
		if ((callerObj) && (callerObj.name != MOL[aIndex].name)){	
			if (MOL[aIndex].showing){
				MOL[aIndex].TM();
				MOL[aIndex].SBS();
			}
		}else{
			if (MOL[aIndex].showing){
				MOL[aIndex].TM();
				MOL[aIndex].SBS();
			}
		}
	}
}

function dropMenu(e, srcObj, srcIsMenuDiv) {
var srcElem;
	if (!e)
		var e=window.event;
		e.cancelBubble=true;
		if (srcObj) {
			var pCurrMenuObj=ROP(srcObj); 
			if (!srcIsMenuDiv && pCurrMenuObj.divObj)
				pCurrMenuObj.divObj.onclick="dropMenu(event,"+srcObj+",true)";
			pCurrMenuObj.TM();
		}
	else {
		CM();
	}
}

function ROP(ObjRef){
	var theObj=null;
	if (ObjRef){
		if (typeof ObjRef != 'object')
			theObj=eval(ObjRef);
		else
			theObj=ObjRef;
		return theObj;
	}else
		return false;
}
function dropMouseOver(e) {
	// I can't get this to work in Firefox so just disable highlighting
	if (window.event) e = window.event; 
	if (e) var S = e.srcElement? e.srcElement : e.target; 
	if (S) S.className = "drop_cell_hover";
}
function dropMouseOut(e) {
	// I can't get this to work in Firefox so just disable highlighting
	if (window.event) e = window.event; 
	if (e) var S = e.srcElement? e.srcElement : e.target; 
	if (S) S.className = "drop_cell";
}
function CM(callerObj) {
	for (aIndex=0;aIndex < MOL.length; aIndex++) {
		if ((callerObj) && (callerObj.name != MOL[aIndex].name)) {
			if (MOL[aIndex].showing) {
				MOL[aIndex].TM();
				MOL[aIndex].SBS();
			}
		}
		else {
			if (MOL[aIndex].showing) {
				MOL[aIndex].TM();
				MOL[aIndex].SBS();
			}
		}
	}
}

