Fix bug ie

since ie10, the condition "document.all" still true for ie, but the
first condition was false for it.