// This javascript module requires the dab_common.js module

var servicesTabList = new Array();
servicesTabList[servicesTabList.length] = "servicesTab::Portraits";
servicesTabList[servicesTabList.length] = "servicesTab::CustomPrints";
servicesTabList[servicesTabList.length] = "servicesTab::CustomImageEditing";
servicesTabList[servicesTabList.length] = "servicesTab::FilmScanning";

function enableServicesTab (tabId, resetHash)
{
  for ( var i=0; i < servicesTabList.length; i++ )
  {
	switchTabs( tabId, servicesTabList[i] );
  }
  if (resetHash)
  {
  	setHash( tabId );
  }
}


function setHash (tabId)
{
	var hash = tabId.substr(tabId.lastIndexOf(":")+1);
	if (typeof hash != "undefined" && hash != "")
	{
		if (hash == "Portraits")
		{
			location.hash = "";
		}
		else
		{
			location.hash = hash;
		}
	}
}


function selectInitialTab()
{
	var hash = location.hash;
	if (typeof hash != "undefined" && hash != "")
	{
		if (hash == "#CustomPrints")
		{
			enableServicesTab( "servicesTab::CustomPrints", false );
		}
		else if (hash == "#CustomImageEditing")
		{
			enableServicesTab( "servicesTab::CustomImageEditing", false );
		}
		else if (hash == "#FilmScanning")
		{
			enableServicesTab( "servicesTab::FilmScanning", false );
		}
	}
}


