/// <reference path="jQuery.intellisense.js" />








/********************************
* 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.style.visibility = "hidden";
    element.style.display = "none";
}
function ShowElement(sID)
{
    var element = getEl(sID);
    element.style.visibility = "visible";
    element.style.display = "block";
}
//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);
		}
		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"; 
                
            var parent = elPlaceHolder.parentNode;
		    parent.appendChild(span);
	    }
	    initImage(NameID);
    }
    else
    {	//Remove the element -- hoever we need to instead just hide it.
        window.setTimeout("fadeOut('"+NameID+"',99)",10);
    }
}


function initImage(sID) {
	imageId = sID;
	image = getEl(imageId);
	//setOpacity(image, 0); 
	image.style.visibility = "visible";
	fadeIn(imageId,0);
}
function fadeIn(objId,opacity) {
	if (getEl) {
		obj = getEl(objId);
		if (opacity <= 100) {
			//setOpacity(obj, opacity);
			//opacity += 15;
			window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 40);
		}
	}
}
function fadeOut(objId,opacity) {
	if (getEl) {
		obj = getEl(objId);
		HideElement(objId);
		if (opacity >= 1) {
			//setOpacity(obj, opacity);
			//opacity -= 15;
			//window.setTimeout("fadeOut('"+objId+"',"+opacity+")", 40);
		}
		else
		{
		    
		}
	}
}
function setOpacity(obj, opacity) {
	opacity = (opacity == 100)?99.999:opacity;
	// IE/Win
	obj.style.filter = "alpha(opacity:"+opacity+")";
	// Safari<1.2, Konqueror
	obj.style.KHTMLOpacity = opacity/100;
	// Older Mozilla and Firefox
	obj.style.MozOpacity = opacity/100;
	// Safari 1.2, newer Firefox and Mozilla, CSS3
	obj.style.opacity = opacity/100;
}

//END//



