function LoadMenu()
{
	LoadTopMenu();
}

function LoadTopMenu()
{
	window.menuProduct = new Menu("root",130,20,"Arial, Helvetica, sans-serif",11,"#080841","#99ccff","#F6CFD0","#080841");
	menuProduct.addMenuItem("Sensors","location='Sensors.aspx'");
	menuProduct.addMenuItem("Systems","location='Systems.aspx'");
	menuProduct.hideOnMouseOut=true;

	window.menuRequests = new Menu("root",150,20,"Arial, Helvetica, sans-serif",11,"#080841","#99ccff","#F6CFD0","#080841");
	menuRequests.addMenuItem("Free Quotation","location='Quotation.aspx'");
	menuRequests.addMenuItem("Contact Request","location='ContactRequest.aspx'");
	menuRequests.addMenuItem("Service Request","location='ServiceRequest.aspx'");
	menuRequests.hideOnMouseOut=true;
	
	writeMenus();
}

//var g_obj, g_alpha1, g_alpha2, g_step, g_fadeTimerID;
//function Fade(obj, alpha1, alpha2, step, interval)
//{
//	g_alpha1 = alpha1;
//	g_alpha2 = alpha2;
//	g_step = step;
//	g_obj = obj;
//	g_fadeTimerID = setInterval("doFade();", interval);
//}

//function doFade()
//{
//	if(g_alpha1 < g_alpha2)
//	{
//		g_alpha1 += g_step;
//		if(g_alpha1 > g_alpha2)
//			g_alpha1 = g_alpha2;
//	}
//	else
//	{
//		g_alpha1 -= g_step;
//		if(g_alpha1 < g_alpha2)
//			g_alpha1 = g_alpha2;
//	}

//	g_obj.filters.alpha.opacity = g_alpha1;
//	
//	if( (g_alpha1 >= g_alpha2) &&
//		(g_fadeTimerID != null) )
//	{
//		clearInterval(g_fadeTimerID);
//		g_fadeTimerID = null;
//	}
//}

//function Unfade(alpha)
//{
//	if(g_fadeTimerID != null)
//	{
//		clearInterval(g_fadeTimerID);
//		g_fadeTimerID = null;
//	}

//	if(g_obj != null)
//	{
//		g_obj.filters.alpha.opacity = alpha;
//		g_obj = null;
//	}
//}

function getAbsoluteLeft(obj)
{
    var pos = 0;
    
    while(obj != null)
    {
        // ignore TR
        if(obj.tagName.toLowerCase() != "tr")
        {
            pos += obj.offsetLeft;
        }
        
        obj = obj.parentElement;
    }

    return pos;
}

function getAbsoluteTop(obj)
{
    var pos = 0;
    
    while(obj != null)
    {
        // ignore TR
        if(obj.tagName.toLowerCase() != "tr")
        {
            pos += obj.offsetTop;
        }
        
        obj = obj.parentElement;
    }

    return pos;
}

function showMenu(menu, element)
{
	FW_showMenu(menu, getAbsoluteLeft(element), getAbsoluteTop(element) + 40);
}

function menubar_onmouseover()
{
	switch(event.srcElement.id)
	{
	case "popupProduct":
		//FW_showMenu(window.menuProduct, getAbsoluteLeft(popupProduct), getAbsoluteTop(popupProduct) + 40);
		break;
	case "popupRequests":
		//FW_showMenu(window.menuRequests, getAbsoluteLeft(popupRequests), getAbsoluteTop(popupRequests) + 40);
		break;
	}
}

function menubar_onmouseout()
{
	switch(event.srcElement.id)
	{
	case "popupProduct":
		break;
	case "popupDownloads":
		break;
	case "popupRequests":
		break;
	}
}

function menubar_onclick()
{
//	switch(event.srcElement.id)
//	{
//	case "imgContact":
//		location = "Home.aspx";
//		break;
//	case "imgAlbum":
//		location = "Photos.aspx";
//		break;
//	case "imgHome":
//		location = "Home.aspx";
//		break;
//	}
}

//function OnMouseOverDocument()
//{
//	if(event.srcElement.className == "fadeimg")
//		Fade(event.srcElement, 50, 100, 10, 100);
//}

//function OnMouseOutDocument()
//{
//	if(event.srcElement.className == "fadeimg")
//		Unfade(50);
//}
