var global = window.document;
global.fo_shadows = new Array;

function makeRectangularDropShadow(el, color, size)
{
var i;
for (i=size; i>0; i--)
{
var rect = document.createElement('div');
var rs = rect.style
rs.position = 'absolute';
rs.visibility = "hidden";
rs.left = (el.style.posLeft + i) + 'px';
rs.top = (el.style.posTop + i) + 'px';
//rs.width = el.offsetWidth + 'px';		当<script>标签对出现在<table>标签对中时
//rs.height = el.offsetHeight + 'px';	无法读出offsetWidth和offsetHeight属性的值
rs.width = el.style.width;				//所以使用.width和.height，或直接指定宽和高，才是正确的，
rs.height = el.style.height;			//使用.offsetWidth和.offsetHeight可能是原来代码中的错误。
//rs.width = 640 + 'px';
//rs.height = 360 + 'px';
//document.write("el.offsetWidth = "+el.offsetWidth +";"+" el.offsetHeight = " + el.offsetHeight +"; ");
//document.write(el.style.width);
rs.zIndex = el.style.zIndex - i;
rs.backgroundColor = color;
var opacity = 1 - i / (i + 1);
rs.filter = 'alpha(opacity=' + (100 * opacity) + ')';
el.insertAdjacentElement('afterEnd', rect);
global.fo_shadows[global.fo_shadows.length] = rect;
//document.write("global.fo_shadows.length = "+global.fo_shadows.length + '<br>');
}

}

function setVisibility(el)
{
	el.style.visibility = "visible";
	//var target = document.createElement('div');
	//target.id = el.id;
	//document.write(target.id);
	//setTimeout(clearVisibility(target), 2000);
	for (i=global.fo_shadows.length-1; i>=0; i--)
	{global.fo_shadows[i].style.visibility = "visible";}
}

function clearVisibility(el)
{
	el.style.visibility = "hidden";
	for(i=global.fo_shadows.length-1; i>=0; i--) global.fo_shadows[i].style.visibility = "hidden";	
}
