def LookForExternals(externalDemos, demoName):
    """
    Checks if a demo name is in any of the external packages (like AGW) or
    if the user clicked on one of the external packages parent items in the
    tree, in which case it returns the html overview for the package.
    """
    pkg = overview = None
    for key, package in externalDemos.items():
        treeName, treeDemos = package.GetDemos()
        treeOverview = package.GetOverview()
        if treeName == demoName:
            return pkg, treeOverview
        elif demoName in treeDemos:
            return key, overview
    return pkg, overview
