/********************************
* Eltroway Menu Script v1.0
* And Common Scripts
* © 2004 EltroWay Corporation
*********************************/	
var menuTimer = 0;
var mm = null;
var item = null;

function MenuHideNOW()
{	
	if(item != null)
	{
		item.className="TopItem0";	
	}
		var m = document.getElementById(mm);
		if (m == null) return;
		m.style.visibility = "hidden";
		mm = null;
}

function MenuShow(menuID,Obj)
{	
	if(menuID == "M1" && document.getElementById(menuID) != null)
	{
		document.getElementById(menuID).style.left = document.getElementById("i1").offsetLeft;
		document.getElementById(menuID).style.top = document.getElementById("boot").offsetTop+1;
	}
	else if(menuID == "M2" && document.getElementById(menuID) != null)
	{
		document.getElementById(menuID).style.left = document.getElementById("i2").offsetLeft;
		document.getElementById(menuID).style.top = document.getElementById("boot").offsetTop+1;
	}
	else if(menuID == "M3" && document.getElementById(menuID) != null)
	{
		document.getElementById(menuID).style.left = document.getElementById("i3").offsetLeft;
		document.getElementById(menuID).style.top = document.getElementById("boot").offsetTop+1;
	}
	else if(menuID == "M4" && document.getElementById(menuID) != null)
	{
		document.getElementById(menuID).style.left = document.getElementById("i4").offsetLeft;
		document.getElementById(menuID).style.top = document.getElementById("boot").offsetTop+1;
	}
	else if(menuID == "M5" && document.getElementById(menuID) != null)
	{
		document.getElementById(menuID).style.left = document.getElementById("i5").offsetLeft;
		document.getElementById(menuID).style.top = document.getElementById("boot").offsetTop+1;
	}
	else if(menuID == "M6" && document.getElementById(menuID) != null)
	{
		document.getElementById(menuID).style.left = document.getElementById("i6").offsetLeft;
		document.getElementById(menuID).style.top = document.getElementById("boot").offsetTop+1;
	}

	var ccc = mm;
	if(mm != null)
	{
		clearT();
		MenuHideNOW();
	}
	if(item != null)
	{
		item.className="TopItem1";
		if(ccc != menuID )
		{
			item.className="TopItem0";
			item = null;
		}
	}	
	if(item == null && Obj != null)
	{	
		Obj.className="TopItem1";
		item = Obj;
	}
	
	var m = document.getElementById(menuID);
	if (m == null) return;
	m.style.visibility = "visible";
	mm = menuID;
}

function MenuHide(menuID,Obj) 
{ 
	if(menuID == mm)
	{
		menuTimer = setTimeout("MenuHideNOW()",350);
	}
	
	var m = document.getElementById(menuID);
	if (m == null)
	{
		if(Obj != null)
		{
			Obj.className="TopItem0";
		}
	}
}

function clearT() 
{
	clearTimeout(menuTimer);
}
/**************************
* Common Scripts
***************************/

function LaunchToolTips(popurl,intWidth,intHeight)
{
	if ("" != popurl) {
	window.open(popurl,'winTip','toolbar=no,minimize=no;location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+intWidth+',height='+intHeight);
	}
}


function getEl(sID)
{
    try{return document.getElementById(sID)}catch(e){};
}

function HideElement(sID)
{
    var element = getEl(sID);
    $(element).fadeOut(300);

   
}
function ShowElement(sID)
{
    var element = getEl(sID);
    
    //element.style.display = "block";
    $(element).fadeIn(300);
    element.style.visibility = "visible";
}
//this is the code javascript to create that popup area
function displayToolTip(sID, NameID, showOrHide,text)
{
    var elPlaceHolder = getEl(sID);

    if(showOrHide)
    {      
		//here lets check to see if the element already exists...then UNhide
		if(getEl(NameID) != null)
		{
			//un hide and SHOW

			    ShowElement(NameID);//initImage(NameID);
			
		}
		else
		{
            //Create a new Span tag and set the class name to "ToolTip".
            var span = document.createElement("div");
            span.id = NameID;
            span.className = "ToolTip";
            span.innerHTML = text;
            span.style.zIndex = "99";
            span.style.display = "block";
            span.style.visibility = "hidden"; 
                
            var parent = elPlaceHolder.parentNode;
            parent.appendChild(span); //initImage(NameID);
		    ShowElement(NameID);
	    }
	    
    }
    else
    {	//Remove the element -- hoever we need to instead just hide it.
        
			
                //startFadeOut(NameID);
                HideElement(NameID);

        
    }
}


//END//
