zoom = function(width, height) {
    var factor = Math.min(1, (window.innerHeight - 60)/height, (window.innerWidth - 40)/width);
    width *= factor;
    height *= factor;
    var pos = window.innerWidth/2 - width/2 - 10;
    var elt = new Element('div');
    elt.setStyles({
        position: 'absolute',
        top: 10,
        left: pos,
        width: width + 18,
        height: height + 38,
        margin: 0,
        'background-color': '#373737',
        border: 'solid white 1px',
        'text-align': 'right',
    });
    img = new Element('img');
    img.src = $$('#content')[0].src;
    img.setStyles({
        width: width, 
        height: height,
        position: 'absolute',
        left: 10,
        top: 30,
    });
    img.inject(elt);
    link = new Element('span');
    link.appendText('Close ');
    link.setStyles({
        'font-weight': 'bold',
        padding: 3,
        cursor: 'pointer',
    });
    link.addEvent('click', function(){ elt.dispose(); });
    link.inject(elt);
    $$('body')[0].grab(elt);
}

show = function() {
    var elt = new Element('div');
    elt.setStyles({
        position: 'absolute',
        top: 10,
        left: 10,
        width: window.innerWidth-22,
        height: window.innerHeight-22,
        margin: 0,
        'background-color': '#373737',
        border: 'solid white 1px',
        'text-align': 'right',
    });
    var content = $$('div.highlight')[0].clone();
    content.setStyles({
        position: 'absolute',
        top: 30,
        left: 10,
        width: window.innerWidth-42,
        height: window.innerHeight-62,
        display: 'block',
        'text-align': 'left',
        overflow: 'auto',
    });
    elt.grab(content);
    link = new Element('span');
    link.appendText('Close ');
    link.setStyles({
        'font-weight': 'bold',
        padding: 3,
        cursor: 'pointer',
    });
    link.addEvent('click', function(){ elt.dispose(); });
    link.inject(elt);
    $$('body')[0].grab(elt);
}
