FIX: exit script if Document object does not exist (chokes on IE8 and lower)