def strbool(val):
    """
    Create bool object from string.  None is returned if input is not 
    derterminable.

    @param val: the string to check.
    @type val: str
    @return: True/False/None.
    @rtype: bool
    """
    try:
        return bool(int(val))
    except:
        val = val.lower()
        if val == 'true' or val == 'on':
            return True
        elif val == 'false' or val == 'off':
            return False
    else:
        return None