window.onscroll = scroll;

function scroll()
{
 lightbox = document.getElementById('light');
 overlay = document.getElementById('fade');
 //shad = document.getElementById('shadow');

 if (navigator.appName != 'Netscape' && lightbox.style.display == "inline")
 {
	lbRender();
 }
 
}

function openLB(url)
{
 var strFlag = url.substring(url.lastIndexOf('?') + 1);
 url = url.replace("!@&", "#");
 if (strFlag != null && strFlag == "newWin")
 {
	document.getElementById('discexturl').href = "javascript:closeLB();window.open('" + url.substring(0,url.lastIndexOf('?')) + "','mywindow','location=1,status=1,scrollbars=1,width=800,height=600');if (navigator.appName != 'Netscape'){window.opener='self';window.open('','_parent','');window.close();}else{self.close();}";
 }
 else if (strFlag != null && strFlag == "oldWin")
 {
	document.getElementById('discexturl').href = url.substring(0,url.lastIndexOf('?'));
 }
 else
 {
 	document.getElementById('discexturl').href = url;
 }

 lightbox = document.getElementById('light');
 overlay = document.getElementById('fade');
 //shad = document.getElementById('shadow');
 lbRender(); 
 } 

function lbRender()
{
 if (navigator.appName == 'Netscape')
 {
	lightbox.style.position = "fixed";
	lightbox.style.top = "30%";
	lightbox.style.left = "30%";
	lightbox.style.display = "block";

	overlay.style.position = "fixed";
	overlay.style.top = "0";
	overlay.style.left = "0";
 }
 else
 {	
	lightbox.style.position = "absolute";
	lightbox.style.top = lightbox.offsetParent.scrollTop + lightbox.offsetParent.offsetHeight - 570;
	lightbox.style.left = "380";
	lightbox.style.styleFloat="left";
	lightbox.style.display = "inline";

	overlay.style.position = "absolute";	
	overlay.style.top = overlay.offsetParent.scrollTop;
	overlay.style.left = overlay.offsetParent.scrollLeft;

 } 
 lightbox.style.width = "500";
 lightbox.style.height = "275";
 lightbox.style.background = "#FDFCE9";
 lightbox.style.zIndex = "70003";
 lightbox.style.border="5px solid #666666";

 overlay.style.width = "100%";
 overlay.style.height = "100%"; 
 overlay.style.background = "#dedede"; 
 overlay.style.filter = "alpha(opacity=70)";
 overlay.style.opacity = "0.7";
 overlay.style.mozOpacity = "0.7"; 
 overlay.style.display = 'inline';
 overlay.style.styleFloat="left";
 overlay.style.zIndex = "70001";
 document.getElementsByTagName("body")[0].appendChild(overlay);
}

function closeLB()
{
 document.getElementById('light').style.display = 'none';
 document.getElementById('fade').style.display='none';
// document.getElementById('shadow').style.display='none';
}

