//Javascript functions used across several HTML files.within the TGB Home Improvement Pros website.
//Search engines assign a higher relevancy score to HTML pages where content (keywords) appears "high" on the page.


// Open selected cascading menu.
// For Internet users with javascript disabled, the submenus must stay accessible.
// Hence they are not hidden with CSS, because that way they would stay hidden. 
// The Javascript code below calls the function "showMenu()" when the page is charging.
// Calling "showMenu" empty, all sub-menus that were apparent go in hiding as soon as the document loads up.

function showMenu(id)
{
	var d = document.getElementById(id);
	if ((d) && (d.style.display=='block'))
	{d.style.display='none';}
	else 
	{
		for (var i = 1; i<=10; i++)
		{
			if (document.getElementById('iSubMenu'+i)) 
			{document.getElementById('iSubMenu'+i).style.display='none';}
		}
		if (d) 
		{d.style.display='block';}
	}
}

//Open a new window and load source (for Word docs and PDF's)

function openNewWindow(source, windowName)
{
  if (document.all) 
  {
   popupWin = window.open(source, windowName, 
   'status,scrollbars,resizable,independent,width=900,height=500,left=25,top=125')
  }
}

