function bindEventHandler(elem, eventName, handler) {
    // Firefox
    if (elem.addEventListener) {
        elem.addEventListener(eventName, handler, false);
    } 
    else if (elem.attachEvent) { // IE
        elem.attachEvent("on" + eventName, handler);
    }
}
// jquery bind is too slow, so we add events natively in js
jquery bind is too slow, so we add events natively in js
jquery bind is too slow so we add events natively in js
function bindEventHandler(elem, eventName, handler) {
    if (elem.addEventListener) {
        elem.addEventListener(eventName, handler, false);
    } 
    else if (elem.attachEvent) { 
        elem.attachEvent("on" + eventName, handler);
    }
}
function bindEventHandler ( elem , eventName , handler ) { if ( elem . addEventListener ) { elem . addEventListener ( eventName , handler , false ) ; } else if ( elem . attachEvent ) { elem . attachEvent ( "on" + eventName , handler ) ; } }
jquery bind is too slow, so we add events natively in js
jquery bind is too slow so we add events natively in js
// Firefox // IE