﻿function showLightBox(link, lightboxWidth, lightboxHeight)
{  
    var width = document.documentElement.clientWidth + document.documentElement.scrollLeft;  
    var layer = document.createElement('div');  
    layer.style.zIndex = 2;  
    layer.id = 'layer';  
    layer.style.position = 'absolute';  
    layer.style.top = '0px';  
    layer.style.left = '0px';  
    layer.style.height = document.documentElement.scrollHeight + 'px';  
    layer.style.width = width + 'px';  
    layer.style.backgroundColor = 'black';  
    layer.style.opacity = '.6';  
    layer.style.filter += ("progid:DXImageTransform.Microsoft.Alpha(opacity=40)");  
    document.body.appendChild(layer);  
    
    var frame = document.createElement('iframe');
    frame.src = link;
    frame.style.zIndex = 300;
    frame.id = 'lightBox';
    frame.style.position = 'absolute';
    frame.style.top = '765px';  
    frame.style.left = (width / 2) - (lightboxWidth / 2) + 'px';   
    frame.style.height = lightboxHeight + 'px';  
    frame.style.width = lightboxWidth + 'px';  
    frame.style.backgroundColor = 'white'; 
    document.body.appendChild(frame);
}

function closeLightBox()
{
    parent.document.body.removeChild(parent.document.getElementById('layer'));
    parent.document.body.removeChild(parent.document.getElementById('lightBox'));           
}
