function getRefByName(l, d) {
    var r = null, j

    d = (d || document)