Made isPM function more compatible with IE8 Quirks Mode and IE7 Standard Mode