<!-- hide this script from non-javascript-enabled browsers
/*
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
* DO NOT MAKE ANY CHANGES TO THIS FILE!                                       
*	CONTACT Joe Frausto Jr. TO REQUEST A CHANGE TO THIS FILE                    
* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*
* ------------------------------------------------------------------------------------ 
*  All intellectual property rights relating to this code are owned by J Business Solutions 
* ------------------------------------------------------------------------------------ 
*  Title: Menu/Tab Controls
*  Purpose: Menu and Tab Controls
*  
*  Author: Joe Frausto Jr.
*  Created: 11/13/2002
*  History: 
*  08/10/2005 - Added Sub/Sub Menu
*  
* ------------------------------------------------------------------------------------ 
*/

/* MENU CONTROLS */
var timeout;
var POPUPTOP = 70;	//71
var POPUPOFFSET = 1;
var SUBMENU_OFFSET = 119;
var TIMEOUT_LENGTH = 400;
var MAX_LONG = 2147483647;
var MAX_MENUS = 7;
var MAX_SUB_MENUS = 10;
var MAX_SUB_SUB_MENUS = 10;
var COLOR_NAV_ON = "#8888FF";	//#02599e
var COLOR_NAV_OFF = "#E8E8FF";

function HighlightMenuItem(MenuNum, SubItem, SubSubItem)
{
	var i;
	if(!IE && !NS4 && !NS6)
	{
		var IE = document.all;
		var NS4 = document.layers;
		var NS6 = (!document.all && document.getElementById);
	}

	for (i = 0; i < MAX_MENUS; i++)
	{
		MenuIndex = parseInt(MenuNum);

		if (IE)
		{
			oSubDiv = document.all['menu' + i];
			// if no more menus, then exit
			if (!oSubDiv) break;

			if (MenuIndex == i)
				oSubDiv.style.backgroundColor = COLOR_NAV_ON;
			else
				oSubDiv.style.backgroundColor = COLOR_NAV_OFF;
		}
		else if (NS4)
		{
			oSubDiv = document.layers["menu" + i]
			if (!oSubDiv) break;

			if (MenuIndex == i)
				oSubDiv.backgroundColor = COLOR_NAV_ON;
			else
				oSubDiv.backgroundColor = COLOR_NAV_OFF;
		}
		else if (NS6)
		{
			oSubDiv = document.getElementById('menu' + i);
			if (!oSubDiv) break;

			if (MenuIndex == i)
				oSubDiv.style.backgroundColor = COLOR_NAV_ON;
			else
				oSubDiv.style.backgroundColor = COLOR_NAV_OFF;
		}
	}

	// Process Sub Menus
	for (i = 1; i < MAX_SUB_MENUS; i++)
	{
		CurrMenuIndex = MenuNum + "-" + SubItem;
		MenuIndex = MenuNum + "-" + i;
		if (IE)
		{
			oSubDiv = document.all['menu' + MenuIndex];
			// if no more menus, then exit
			if (!oSubDiv) break;

			if (MenuIndex == CurrMenuIndex)
				oSubDiv.style.backgroundColor = COLOR_NAV_ON;
			else
				oSubDiv.style.backgroundColor = COLOR_NAV_OFF;
		}
		else if (NS4)
		{
			oSubDiv = document.layers["menu" + MenuIndex]
			if (!oSubDiv) break;

			if (MenuIndex == CurrMenuIndex)
				oSubDiv.backgroundColor = COLOR_NAV_ON;
			else
				oSubDiv.backgroundColor = COLOR_NAV_OFF;
		}
		else if (NS6)
		{
			oSubDiv = document.getElementById('menu' + MenuIndex);
			if (!oSubDiv) break;	
			if (MenuIndex == CurrMenuIndex)
				oSubDiv.style.backgroundColor = COLOR_NAV_ON;
			else
				oSubDiv.style.backgroundColor = COLOR_NAV_OFF;
		}
	}

	// Process Sub Sub Menus
	for (i = 1; i < MAX_SUB_SUB_MENUS; i++)
	{
		CurrMenuIndex = MenuNum + "-" + SubItem + "-" + SubSubItem;
		MenuIndex = MenuNum + "-" + SubItem + "-" + i;
		if (IE)
		{
			oSubDiv = document.all['menu' + MenuIndex];
			// if no more menus, then exit
			if (!oSubDiv) break;

			if (MenuIndex == CurrMenuIndex)
				oSubDiv.style.backgroundColor = COLOR_NAV_ON;
			else
				oSubDiv.style.backgroundColor = COLOR_NAV_OFF;
		}
		else if (NS4)
		{
			oSubDiv = document.layers["menu" + MenuIndex]
			if (!oSubDiv) break;

			if (MenuIndex == CurrMenuIndex)
				oSubDiv.backgroundColor = COLOR_NAV_ON;
			else
				oSubDiv.backgroundColor = COLOR_NAV_OFF;
		}
		else if (NS6)
		{
			oSubDiv = document.getElementById('menu' + MenuIndex);
			if (!oSubDiv) break;	
			if (MenuIndex == CurrMenuIndex)
				oSubDiv.style.backgroundColor = COLOR_NAV_ON;
			else
				oSubDiv.style.backgroundColor = COLOR_NAV_OFF;
		}
	}
}

function showMenu(menu)
{
	hideMenus();
	var x, i;
	// clear the timeout if one is set
	clearTimeout(timeout);
   
	if(!IE && !NS4 && !NS6)
	{
		var IE = document.all;
		var NS4 = document.layers;
		var NS6 = (!document.all && document.getElementById);
	}
   
	HighlightMenuItem(menu, -1, -1);
	
	for (i = 0; i < MAX_MENUS; i++)
		if (IE)
		{
			o = document.all['popupMenu' + i];
			// if no more menus, then exit
			if (!o)	continue;
	     
			if (i == menu) {
				oDiv = document.all['menu' + i];
				if (!oDiv) return;
				o.style.zIndex = 20;
				o.style.visibility = 'visible';
				o.style.left = getLeft(oDiv.offsetParent) + POPUPOFFSET;
				o.style.top = POPUPTOP;
			}
			else
			{
				o.style.visibility = 'hidden';
			}
		}
		else if (NS4)
		{
			o = document.layers["popupMenu" + i];

			// if no more menus, then exit
			if (!o)	continue;
			if (i == menu)
			{
				o.zIndex = 20;
				o.visibility = 'visible';
				o.left = getImageLeft('img' + menu) - 4 + POPUPOFFSET;
				o.top = POPUPTOP
			}
			else if (o) 
			{
				o.visibility = 'hidden';
			}
		}
		else if (NS6)
		{
			o = document.getElementById('popupMenu' + i);

			// if no more menus, then exit
			if (!o)	continue;
	     
			if (i == menu)
			{
				oDiv = document.getElementById('menu' + i);
				o.style.zIndex = 20;
				o.style.left = getLeft(oDiv) + POPUPOFFSET;
				o.style.top = POPUPTOP;
				o.style.visibility = 'visible';
			}
			else
			{
				o.style.visibility = 'hidden';
			}
		}
}

function ShowSubMenu(menu, submenu)
{
	var x, i;
	// clear the timeout if one is set
	clearTimeout(timeout);
   
	if(!IE && !NS4 && !NS6)
	{
		var IE = document.all;
		var NS4 = document.layers;
		var NS6 = (!document.all && document.getElementById);
	}
   
	HighlightMenuItem(menu, submenu, -1);
	
	for (i = 1; i < MAX_SUB_MENUS; i++)
	{
		SubMenuIndex = menu + "-" + i;
		if (IE)
		{
			o = document.all['popupSubMenu' + SubMenuIndex];
			// if no more menus, then exit
			if (!o)	continue;
	     
			if (i == submenu)
			{
				oDiv = document.all['popupMenu' + menu];
				oMainDiv = document.all['menu' + menu];
				if (!oDiv) return;
				o.style.zIndex = 20;
				o.style.visibility = 'visible';
				o.style.left = getLeft(oMainDiv.offsetParent) + SUBMENU_OFFSET;
				o.style.top = (POPUPTOP + ((23 * (submenu - 1))));
			}
			else
			{
				o.style.visibility = 'hidden';
			}
		}
		else if (NS4)
		{
			o = document.layers["popupSubMenu" + SubMenuIndex];

			// if no more menus, then exit
			if (!o)	continue;
			if (i == menu)
			{
				o.zIndex = 20;
				o.visibility = 'visible';
				o.left = getImageLeft('img' + menu) - 4 + POPUPOFFSET;
				o.top = POPUPTOP
			}
			else if (o) 
			{
				o.visibility = 'hidden';
			}
		}
		else if (NS6)
		{
			o = document.getElementById('popupSubMenu' + SubMenuIndex);

			// if no more menus, then exit
			if (!o)	continue;
	     
			if (i == menu)
			{
				oDiv = document.getElementById('popupMenu' + i);
				o.style.zIndex = 20;
				o.style.left = getLeft(oDiv) + POPUPOFFSET;
				o.style.top = POPUPTOP;
				o.style.visibility = 'visible';
			}
			else
			{
				o.style.visibility = 'hidden';
			}
		}
	}
}

function hideMenus()
{
	HighlightMenuItem(-1, -1);
	var i;
	if(!IE && !NS4 && !NS6)
	{
		var IE = document.all;
		var NS4 = document.layers;
		var NS6 = (!document.all && document.getElementById);
	}
	
	for (i = 0; i < MAX_MENUS; i++)
	{
		if (IE)
		{
			o = document.all['popupMenu' + i];
			oDiv = document.all['menu' + i];
			// if no more menus, then exit
			
			if (!oDiv) return;
//	      if (!o) return;
			
			if (o)
				o.style.visibility = 'hidden';
			for (m = 0; m < MAX_SUB_SUB_MENUS; m++)
			{
				oSub = document.all['popupSubMenu' + m + '-' + i];
				if (oSub)
					oSub.style.visibility = 'hidden';
//			if (o)
//				o.style.visibility = 'hidden';
			}
		}
		else if (NS4)
		{
			o = document.layers["popupMenu" + i];
			
			// if no more menus, then exit
			if (!o) return;
			
			o.visibility = 'hidden';
			for (m = 0; m < MAX_SUB_SUB_MENUS; m++)
			{
				oSub = document.layers['popupSubMenu' + m + '-' + i];
				if (oSub)
					oSub.visibility = 'hidden';
			}
		}
		else if (NS6)
		{
			o = document.getElementById('popupMenu' + m + '-' + i);
			// if no more menus, then exit
			if (!o) return;
			
			o.style.visibility = 'hidden';
			for (m = 0; m < MAX_SUB_SUB_MENUS; m++)
			{
				oSub = document.getElementById['popupSubMenu' + m + '-' + i];
				if (oSub)
					oSub.style.visibility = 'hidden';
			}
		}
	}
}

function hideTimeout()
{
	timeout = setTimeout("hideMenus()", TIMEOUT_LENGTH);
}

function getLeft(obj)
{
	var x;
	
	if (!obj) return(0);
	
	x=0;
	while (obj)
	{
		x += obj.offsetLeft;
		obj = obj.offsetParent;
	}
	return(x-1);
}

function getTop(obj)
{
	var y;
	
	if (!obj) return(0);
	
	y=0;
	while (obj)
	{
		y += obj.offsetTop;
		obj = obj.offsetParent;
	}
	return(y);

}

function getBottom(obj)
{
	var y;
	
	if (!obj) return(0);
	
	y=0;
	while (obj)
	{
		y += obj.offsetTop;
		oldObj = obj;
		obj = obj.offsetParent;
	}
	y += 25;
	return(y);

}

function getImageLeft(str)
{
	var img = document.images[str];
	
	if (!img)
	{
		 return 0;
	}
	
	if (img.container != null)
	{
		alert("img" + img.x);
       return img.container.pageX + img.x;
    }
    else
       return img.x;
}

function getImageTop(str)
{
	var img = document.images[str];
	
	if (!img)
	{
		return 0;
	}
	
	if (img.container != null)
	{
      return img.container.pageY + img.y;
    }
    else
    {
      return img.y;
    }
}	

function getImageBottom(str)
{
	y = getImageTop(str) + 25;
	return y;
}

function doNothing()
{

}


/* MENU TAB CONTROLS */
function MM_reloadPage(init)
{//reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage;}}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function pviiW3Cbg(obj, pviiColor)
{//v1.1 by Project VII
 	obj.style.backgroundColor = pviiColor;
}
 
function MM_preloadImages()
{//v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d)
{//v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage()
{//v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers()
{//v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function P7_autoLayers()
{//v1.1 PVII
  var g,b,k,f,args = P7_autoLayers.arguments;
  if(!document.p7setc) {p7c = new Array(); document.p7setc = true;}
  for(k = 0; k < p7c.length; k++) {
   if((g = MM_findObj(p7c[k])) != null) {
    b = (document.layers) ? g : g.style; b.visibility="hidden";}}
  for(k = 0; k < args.length; k++) {
   if((g = MM_findObj(args[k])) != null) {
    b = (document.layers) ? g : g.style; b.visibility = "visible"; f = false;
    for(j = 0; j < p7c.length; j++) {
     if(args[k] == p7c[j]) {f = true;}}
   if(!f) {p7c[p7c.length++] = args[k];}}}
}
 
function quickMenuMove(menuName)
{
	if (menuName != '') {
		var g,b,k,f,args = quickMenuMove.arguments;
		newTop = 64;
		for(k = 0; k < MenuArea.length; k++) {
			if((g = MM_findObj(MenuArea[k])) != null)	{
				b = (document.layers) ? g : g.style; b.top = newTop; 
				if (menuName == MenuArea[k]) newTop += 289;
				else newTop += 22;
	     f = false;}}
		for(j = 0; j < MenuArea.length - 1; j++) {
			if((g = MM_findObj(MenuArea[j])) != null) {
				s = MM_findObj(MenuSubArea[j]);
				if (menuName == MenuArea[j]) { b = (document.layers) ? s : s.style; b.visibility = "visible";}
				else { b = (document.layers) ? s : s.style; b.visibility="hidden";}}}}
 }

function ShowProcessing(isProcessing, FrameName, iTries)
{
	if (iTries == '')
		iTries = 1;

	if (isProcessing)
	{
		sLogo = "none";
		sProc = "block";
	}
	else
	{
		sLogo = "block";
		sProc = "none";
	}
	if (typeof(FrameName) == "undefined" || FrameName == "")
	{
		document.all.processing.style.display = sProc;
		document.all.applogo.style.display = sLogo;
	}
	else
	{
		oFrmProc = eval("top." + FrameName + ".document.all.processing")
		oFrmLogo = eval("top." + FrameName + ".document.all.applogo")

		if (typeof(oFrmLogo) == "object")
		{
			oFrmProc.style.display = sProc;
			oFrmLogo.style.display = sLogo;
		}
		else
		{
			if (iTries < 10)
				ShowProcessing(isProcessing, FrameName, iTries++);
		}
	}
}

// stop hiding -->
