function grayOut(isVisible,options){
	var options=options || {};
	var opacity=options.opacity || 80;
	var opaque=(opacity/100);
	var zindex=options.zindex || 50;
	var bgcolor=options.bgcolor || "#000000";
	
	var winWidth=getWindowLength("width");
	var winHeight=getWindowLength("height");

	var grayOutBG=document.getElementById("grayOutBG");
	if (!grayOutBG){
		var pbody=document.body;
		var pnode=document.createElement("div");
			pnode.style.position="fixed";
			pnode.style.top="0px";
			pnode.style.bottom="0px";
			pnode.style.width=winWidth+"px";
			pnode.style.height=winHeight+"px";
			pnode.style.overflow="hidden";
			pnode.style.display="none";
			pnode.id="grayOutBG";
		pbody.appendChild(pnode);
		grayOutBG=document.getElementById("grayOutBG");
		}
	
	if(isVisible){
		grayOutBG.style.opacity=opaque;
		grayOutBG.style.MozOpacity=opaque;
		grayOutBG.style.filter="alpha(opacity="+opacity+")";
		grayOutBG.style.zIndex=zindex;
		grayOutBG.style.backgroundColor=bgcolor;
		grayOutBG.style.display="block";
		} else {
		grayOutBG.style.display="none";
		}
	}
