/** * File: DynamicHTML.js * Source: Professional JavaScript, 2nd Ed. * Modified by: Brian Borowski * Date created: November 15, 2002 * Date last modified: August 27, 2007 */ function clientSniffer() { var agent = navigator.appName; this.isIE = function() { return (agent == "Microsoft Internet Explorer" && document.all); } this.isNS = function() { return (agent == "Netscape"); } this.getVersion = function() { if (this.isNS()) { return parseInt(navigator.appVersion); } if (this.isIE()) { var vIdx = navigator.appVersion.indexOf("MSIE ") + "MSIE ".length; return parseInt(navigator.appVersion.substring(vIdx, vIdx + 3)); } return 0; } this.isDOM = function() { return document.getElementById ? true : false; } } function writeToLayer(lyrID, html) { var cs = new clientSniffer(); if (cs.isDOM()) { document.getElementById(lyrID).innerHTML = html; } else if (cs.isIE()) { document.all[lyrID].innerHTML = html; } else { with (document.layers[lyrID].document) { open(); write(html); close(); } } }