// This javascript module requires the dab_common.js module

var helpTabList = new Array();
helpTabList[helpTabList.length] = "helpTab::Galleries";
helpTabList[helpTabList.length] = "helpTab::Products";
helpTabList[helpTabList.length] = "helpTab::Services";
helpTabList[helpTabList.length] = "helpTab::ResolvingProblems";
helpTabList[helpTabList.length] = "helpTab::MonitorCalibration";

function enableHelpTab (tabId, resetHash)
{
  for ( var i=0; i < helpTabList.length; i++ )
  {
	switchTabs( tabId, helpTabList[i] );
  }
  if (resetHash)
  {
  	setHash( tabId );
  }
}


function setHash (tabId)
{
	var hash = tabId.substr(tabId.lastIndexOf(":")+1);
	if (typeof hash != "undefined" && hash != "")
	{
		if (hash == "Galleries")
		{
			location.hash = "";
		}
		else
		{
			location.hash = hash;
		}
	}
}


function selectInitialTab()
{
	var hash = location.hash;
	if (typeof hash != "undefined" && hash != "")
	{
		if (hash == "#Products")
		{
			enableHelpTab( "helpTab::Products", false );
		}
		else if (hash == "#Services")
		{
			enableHelpTab( "helpTab::Services", false );
		}
		else if (hash == "#ResolvingProblems")
		{
			enableHelpTab( "helpTab::ResolvingProblems", false );
		}
		else if (hash == "#MonitorCalibration")
		{
			enableHelpTab( "helpTab::MonitorCalibration", false );
		}
	}
}


