overlay можно прописать в css. А дальше просто подключать в скрипте в нужном месте с определенной прозрачностью.
<style>
div.overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: #999;
	display: none;
	z-index: 30;
}
* html div.overlay {
	position: absolute;
	height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px');
}
</style>
<div class="overlay"></div>
<script>
$(function(){
    $('.any').bind('myCustomEvent', function(){
        $(".overlay").css('opacity', 0.3).show()
    });
});
</script>