﻿function fixedIE(tl, n, el) {
    var sc = 'scroll' + tl, d = document, c = 'compatMode',
b = d[c] && d[c] == 'CSS1Compat' ? d.documentElement : d.body;
    n = n - 0; if (typeof n != 'number') return 0;
    if (/^(Top|Left)$/.test(tl))
        return b[sc] + n + 'px';
    if (/^(Bottom|Right)$/.test(tl) && typeof el == 'object') {
        tl = tl == 'Right' ? 'Left' : 'Top', sc = 'scroll' + tl;
        var dim = 'client' + (tl == 'Top' ? 'Height' : 'Width');
        return b[sc] + b[dim] - el[dim] - n + 'px';
    }
    return 0;
}

