
	
	//function to show the given element and hide the rest
	function menu(element_id)
	{
		var menu_list	=	new Array("menu_prod", "menu_serv", "menu_abou");
		
		for (var index = 0; index < 3; index++)
		{
			var element_style 	= 	document.getElementById(menu_list[index]).style;
			
			if (element_id == menu_list[index])	element_style.display 	= 	'block';
			else								element_style.display 	= 	'none';
		}//end for
		
	}//function show
	
	function substr_count(hayStack, needle)
	{
		var needleLenght = needle.length;

		for (i=0; i < hayStack.length; i++)
		{
			//match the first character of the needle with the i'th character of the hayStack
			if (hayStack[i] == needle[0])
			{
				var chunkEnd	=	i + needleLenght;
				var chunk		=	hayStack.substring(i,chunkEnd);

				if (chunk == needle) return(true);		
			}//if (hayStack[i] == needle[0])
		
		}// for (i=0; i < hayStack.lenght; i++)
		
		return (false);
	} //function substr_count(hayStack, needle)s

	//loads the correct menu upon page load
	function menuLoad()
	{
		var hayStack	= 	location.pathname;
		
		if (substr_count(hayStack , '/affiliates/')) 	menu('menu_abou');
		else									menu('menu_serv');			
	}
	