function reflect(div, max, intensity, margin, url) {
    div.childNodes[0].src = url;
    var width = div.childNodes[0].offsetWidth;
    var height = div.childNodes[0].offsetHeight;
    max = height * max / 100;
    intensity /= 100;
    div.childNodes[0].style.marginBottom = margin + 'px';
    var lines = document.createElement('div');
    lines.id = 'lines';
    div.appendChild(lines);
    for (var i = max; i > 0; i -= 1) {
        var line = document.createElement('div');
        line.style.width = width + 'px';
        line.style.height = '1px';
        line.style.backgroundImage = 'url(' + div.childNodes[0].src + ')';
        line.style.backgroundPosition = '0px ' + (1 - i + max) + 'px';
        if (line.style.opacity != undefined) {
            line.style.opacity = i / max * intensity;
        } else {
            line.style.filter = 'alpha(opacity=' + i / max * 100 * intensity + ')';
        }
        lines.appendChild(line);
    }
}
