function WaitForObjectToDisappear(/**objectId*/ xpathOrObjId, /**number*/ timeout)
{
    var _result = false;
    timeout = timeout||10000;
    var _start = new Date();
    do
    {
        var _visible = Navigator.CheckObjectVisible(xpathOrObjId);
        if(_visible == false)
        {
            _result = true;
            break;
        }
        Global.DoSleep(100);
    } 
    while((new Date() - _start) < timeout);
    return _result;
}