/*jslint browser */
/*global window, document */
function fn() {
    "use strict";
    document.body.innerHTML += "<p>" + window.navigator.userAgent + "<\/p><p>JSON: false<\/p>";
}
var ua = window.navigator.userAgent;
var js = "JSON: " + (window.JSON
    ? "true"
    : "false");
if (document.getElementById) { // IE5–11
    document.getElementById("P1").innerHTML = ua;
    document.getElementById("P2").innerHTML = js;
} else if (document.all) { // IE4
    window.onload = fn;
} else { // IE3
    document.open();
    document.write("<p>" + ua + "<\/p><p>JSON: false<\/p>");
    document.close();
}