
(function () {
    var locJS,
        brow,
        a,
        t,
        a2,
        t2,
        t3,
        locYear,
        text,
        textNode,
        today;

    if (!document.getElementById) {
        return;
    }

    function getInternetExplorerVersion() {
        // Returns the version of Internet Explorer or a -1
        // (indicating the use of another browser).

        var rv = -1, // Return value assumes failure
            ua,
            re;
        if (navigator.appName === 'Microsoft Internet Explorer') {
            ua = navigator.userAgent;
            re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
            if (re.exec(ua) !== null) {
                rv = parseFloat(RegExp.$1);
            }
        }
        return rv;
    }

	locJS = document.getElementById("jsEnabled");
	if (locJS) {
	    locJS.removeChild(locJS.childNodes[0]);
		textNode = document.createTextNode("It is OK, I have detected that you have Javascript enabled.");
	    locJS.appendChild(textNode);
	}
    brow = document.getElementById("browserDetect");
	if (brow) {
        if (getInternetExplorerVersion() !== -1) {
            t = document.createTextNode("Best viewed in ");
            a = document.createElement("a");
            a.href = 'http://getfirefox.com/';
            a.innerHTML = "Firefox";
            brow.appendChild(t);
            brow.appendChild(a);

            t2 = document.createTextNode(". See the following  ");
            a2 = document.createElement("a");
            a2.href = './what-IE-cannot-do.php';
            a2.innerHTML = "page";
            t3 = document.createTextNode(" to see just why I recommend that you should use a more advanced browser if you possibly can.");
            brow.appendChild(t2);
            brow.appendChild(a2);
            brow.appendChild(t3);
	    }
	}

	locYear = document.getElementById("curYear");
	if (locYear) {
	    locYear.removeChild(locYear.childNodes[0]);
		text = today.getFullYear() + " ";
		textNode = document.createTextNode(text);
		locYear.appendChild(textNode);
	}
}());


