michael@0: // The appearance of XUL elements is platform-specific, so we set the michael@0: // style of the root element according to the platform, so that the michael@0: // CSS code inside input.css can select the correct styles for each michael@0: // platform. michael@0: michael@0: var id; michael@0: var ua = navigator.userAgent; michael@0: michael@0: if (/Windows/.test(ua)) { michael@0: id = "win"; michael@0: if (/NT 5\.1/.test(ua) || /NT 5\.2; Win64/.test(ua)) michael@0: var classname = "winxp"; michael@0: } michael@0: else if (/Linux/.test(ua)) michael@0: id = "linux"; michael@0: else if (/SunOS/.test(ua)) michael@0: id = "linux"; michael@0: else if (/Mac OS X/.test(ua)) michael@0: id = "mac"; michael@0: michael@0: if (id) michael@0: document.documentElement.setAttribute("id", id); michael@0: else michael@0: document.documentElement.appendChild( michael@0: document.createTextNode("Unrecognized platform") michael@0: ); michael@0: if (classname) michael@0: document.documentElement.setAttribute("class", classname);