// Browser Stuff var NavigatorUserAgent = navigator.userAgent.toLowerCase(); var Browser_Opera = (NavigatorUserAgent.indexOf('opera') != -1); // is opera var Browser_Opera8 = ((NavigatorUserAgent.indexOf('opera 8') != -1 || NavigatorUserAgent.indexOf('opera/8') != -1) ? 1 : 0); // is opera8 var Browser_NS4 = (document.layers) ? true : false; // is netscape 4 var Browser_IE4 = (document.all && !document.getElementById) ? true : false; // is IE 4 var Browser_IE5 = (document.all && document.getElementById) ? true : false; // is IE 5+ var Browser_NS6 = (!document.all && document.getElementById) ? true : false; // is netscape 6 var Browser_FireFox = (NavigatorUserAgent.indexOf("firefox/") != -1); // is firefox Browser = function () { }; /// detect a special case of "web browser" Browser.is_ie = ( /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent) ); Browser.is_ie5 = ( Browser.is_ie && /msie 5\.0/i.test(navigator.userAgent) ); /// detect Opera browser Browser.is_opera = /opera/i.test(navigator.userAgent); /// detect KHTML-based browsers Browser.is_khtml = /Konqueror|Safari|KHTML/i.test(navigator.userAgent); Browser.stopEvent = function(ev) { ev || (ev = window.event); if (Browser.is_ie) { ev.cancelBubble = true; ev.returnValue = false; } else { ev.preventDefault(); ev.stopPropagation(); } return false; }; Browser.addEvent = function(el, evname, func) { if (el.attachEvent) { // IE el.attachEvent("on" + evname, func); } else if (el.addEventListener) { // Gecko / W3C el.addEventListener(evname, func, true); } else { el["on" + evname] = func; } }; Browser.removeEvent = function(el, evname, func) { if (el.detachEvent) { // IE el.detachEvent("on" + evname, func); } else if (el.removeEventListener) { // Gecko / W3C el.removeEventListener(evname, func, true); } else { el["on" + evname] = null; } }; // If Push and pop is not implemented by the browser if (!Array.prototype.push) { Array.prototype.push = function array_push() { for(var i=0;i