/*
	The important things to remember when we add new menu item or change the menu id of the existing menu item
	----------------------------------------------------------------------------------------------------------
When we add an extra menu or change the menu Id in the menu bar, then the following steps should be performed
1. For Yellow color menu, the newly added menu id or the changed menu id should be added in "mainYellowMenus" Array.
2. For ordinary menu, the newly added menu id or the changed menu id should be added in "mainMenuIds" Array.

Only if the above two steps are performed, the color change of the of the menu on mouse over will work fine.
*/

var varTimerId;
var mainMenuIds = new Array("news", "healthAZ", "healthCeter", "healthTools", "directories", "services","Websites", "forum" , "blogs"  ); 
var mainYellowMenus = new Array("buy", "adWithUs");


function hideAllSubMenus(){

	for (i=1;i<13;i++){document.getElementById("subm"+i).style.display='none';}

	}

/*The "ReleaSeMouseOver" function is used to release the mouse over color from old to new */
function ReleaSeMouseOver(currentMenu)
{
	try
	{
		var menuLength = mainMenuIds.length;
		for(var i = 0 ; i < menuLength ; i++)
		{
			if( mainMenuIds[i] != currentMenu )
			{
				document.getElementById(mainMenuIds[i]).style.background="url(images/nav_bg.gif) repeat-x"; 	
			}	
		}

		var menuYellowLength = mainYellowMenus.length;
		{
			for(var i = 0 ; i < menuYellowLength ; i++)
			{
				document.getElementById(mainYellowMenus[i]).style.background="url(images/yelloTab_bg.gif) repeat-x";
			}	
		}
	}
	catch(e)
	{
	}
}


/*The "ReleaSeYellowMouseOver" function is used to release the mouse over color from old to new for Yellow menu */
function ReleaSeYellowMouseOver(currentMenu)
{
	try
	{
		var menuLength = mainYellowMenus.length;
		{
			for(var i = 0 ; i < menuLength ; i++)
			{
				if( mainYellowMenus[i] != currentMenu )
				{
					document.getElementById(mainYellowMenus[i]).style.background="url(images/yelloTab_bg.gif) repeat-x";
				}
			}	
		}

		var menuMainLength = mainMenuIds.length;
		for(var i = 0 ; i < menuMainLength ; i++)
		{
			document.getElementById(mainMenuIds[i]).style.background="url(images/nav_bg.gif) repeat-x"; 	
		}
	}
	catch(e)
	{
		
	}
}


	function showSubMenu(oveTab, smenu ){
		clearTimeout (varTimerId ); // this function is used to stop the timer
		hideAllSubMenus();
		document.getElementById(oveTab).style.background="url(images/nav_over_bg.gif) repeat-x";
		document.getElementById(smenu).style.display='';
		ReleaSeMouseOver(oveTab);// this function is used to remove  the mouse over effect from previous menu
	}
	
	
	
	function hideSubMenu(oveTab, actsmenu ){
 		varTimerId = setTimeout(function () {// this function is to start the timer
 			hideAllSubMenus();
			document.getElementById(oveTab).style.background="url(images/nav_bg.gif) repeat-x"; 
 			document.getElementById(actsmenu).style.display='';
			}, 1500);
	}
	
	function ShowHome(actsmenu)
	{
		document.getElementById(actsmenu).style.display='';
	}
	
	function showSubMenuYello(oveTab, smenu ){
		clearTimeout (varTimerId );// this function is to stop the timer
		document.getElementById(oveTab).style.background="url(images/nav_over_bg.gif) repeat-x";
		hideAllSubMenus();
		ReleaSeYellowMouseOver(oveTab);// this function is used to remove  the mouse over effect from previous menu
		document.getElementById(smenu).style.display='';
	}
	
	function hideSubMenuYello(oveTab, actsmenu ){
		varTimerId = setTimeout(function () {// this function is to  start the timer
			document.getElementById(oveTab).style.background="url(images/yelloTab_bg.gif) repeat-x";
 			hideAllSubMenus();
	 		document.getElementById(actsmenu).style.display='';
			}, 1500);
	}
	
	
	
	function showObj(obj){ 
		document.getElementById(obj).style.display='';
	}

	function hideObj(obj){ 
		document.getElementById(obj).style.display='none';
	}


function actTab(tabNem, tabCont, num, aTabCont){
	
	for (i=1;i<num;i++){
		document.getElementById(tabNem+i).className="dAct";
		document.getElementById(tabCont+i).style.display='none';
		}
	
	document.getElementById(tabCont+aTabCont).style.display='';
	document.getElementById(tabNem+aTabCont).className="active";
		
	    
	}
	
