public function getTerritoryID($id)
	{
		// normalize id
		$id = $this->getCanonicalID($id);
		// find sub tags
		if (($underscorePosition=strpos($id, '_'))!== false)
		{
			$subTag = explode('_', $id);
			// territory sub tags can be distinguished from script sub tags by length
			if (isset($subTag[2]) && strlen($subTag[2])<4)
			{
				$id = $subTag[2];
			}
			elseif (strlen($subTag[1])<4)
			{
				$id = $subTag[1];
			}
			else
			{
				$id = null;
			}
		}
		else
		{
			$id = null;
		}
		return $id;
	}