function showLightWindow(link){
        t = document.getElementById("lightwindow");
        if (t){
		  jQuery('#tdlightbox').attr('src',link);
          jQuery('#lightwindow').show();
          jQuery('#behindlightwindow').show();
          return false;
        }
		
	ScrollTop = document.documentElement.scrollTop;
	if (ScrollTop == 0) ScrollTop = document.body.scrollTop;
	d = document.createElement("div");
        d.style.position="absolute";
        d.style.top= ScrollTop + "px";
        d.style.zIndex="1999";
		d.style.minWidth="990px";
        d.style.backgroundColor="black";
		/*d.style.backgroundImage = "url(/js/empty.png)";*/
		d.style.filter = "progid:DXImageTransform.Microsoft.Alpha(opacity=70)";
        d.style.opacity="0.7";
        d.border="0";
       	d.style.height="100%";
       	d.style.width="100%";
        d.id="behindlightwindow";
	document.body.appendChild(d);
		
	t = document.createElement("table");
        t.style.position="absolute";
        t.style.top=ScrollTop + "px";
        t.style.zIndex="2000";
        t.border="0";
       	t.style.height="800px";
       	t.style.width="100%";
        t.id="lightwindow";
	tb = document.createElement("tbody");
	tr = document.createElement("tr");
	td = document.createElement("td");
       	td.style.width="49%";
	tr.appendChild(td);
	td1 = document.createElement("td");
	td1.style.verticalAlign='middle';
	cl = document.createElement("img");
	/*cl.style.color="white";
	cl.style.textAlign='right';
	cl.style.marginBottom="5px";
	cl.innerHTML = '<b>[x]</b> Закрыть';*/
	cl.style.cursor='pointer';
	cl.src="/img/closebutton.png";
	cl.style.position="relative";
	cl.style.zIndex='10';
	cl.style.top='18px';
	cl.style.left='786px';
	td1.appendChild(cl);
	d = document.createElement("iframe");
	/*d.style.backgroundColor="white";*/
	d.id="tdlightbox";
    d.style.width="804px";
	d.style.height="421px";
	d.style.padding="0px";
	d.style.border="0px";
	d.style.paddingRight="0px";
	td1.appendChild(d);
	tr.appendChild(td1);
	td = document.createElement("td");
    td.style.width="49%";
	td.style.textAlign="center";
	tr.appendChild(td);
	tb.appendChild(tr);
	t.appendChild(tb);
	document.body.appendChild(t);
  jQuery('#tdlightbox').attr('src', link);
  jQuery(function() {
  jQuery('#lightwindow').click(closelightboxfunc);
 });
 return false;
}
var closelightboxfunc = function(){
	jQuery('#lightwindow').html('');
	jQuery('#lightwindow').hide();
	jQuery('#behindlightwindow').hide();
	document.body.removeChild(document.getElementById('lightwindow'));
	document.body.removeChild(document.getElementById('behindlightwindow'));
	return false;
}
