2010-02-03 09:59:46 +01:00
|
|
|
// For discussion and comments, see: http://remysharp.com/2009/01/07/html5-enabling-script/
|
|
|
|
(function(){if(!/*@cc_on!@*/0)return;var e = "abbr,article,aside,audio,canvas,datalist,details,eventsource,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video".split(','),i=e.length;while (i--){document.createElement(e[i])}})();
|
|
|
|
|
|
|
|
var addEvent = (function () {
|
|
|
|
if (document.addEventListener) {
|
|
|
|
return function (el, type, fn) {
|
2010-02-10 09:10:21 +01:00
|
|
|
if (el && el.nodeName || el === window) {
|
2010-02-03 09:59:46 +01:00
|
|
|
el.addEventListener(type, fn, false);
|
|
|
|
} else if (el && el.length) {
|
|
|
|
for (var i = 0; i < el.length; i++) {
|
|
|
|
addEvent(el[i], type, fn);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
} else {
|
|
|
|
return function (el, type, fn) {
|
2010-02-10 09:10:21 +01:00
|
|
|
if (el && el.nodeName || el === window) {
|
2010-02-03 09:59:46 +01:00
|
|
|
el.attachEvent('on' + type, function () { return fn.call(el, window.event); });
|
|
|
|
} else if (el && el.length) {
|
|
|
|
for (var i = 0; i < el.length; i++) {
|
|
|
|
addEvent(el[i], type, fn);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
})();
|
|
|
|
|