var backgroundId = "backgroundWin";
var modalWinId = "modalWin";

function showModalWindow()
{
    var backgroundLayer = document.createElement("div");
    backgroundLayer.id = backgroundId;
    document.body.appendChild(backgroundLayer);
  
    var modalWinLayer = document.createElement("div");
    modalWinLayer.id = modalWinId;
    document.body.appendChild(modalWinLayer);
    
    
    var backgroundLayerCss = "display:inline; position:absolute; z-index:10; left:0px; top:0px; width:100%; height:100%; filter:alpha(opacity=70); opacity:0.7; background-color: grey;";
	var modalWinLayerCss = "display:inline; position:absolute; z-index:20; background-color:white; color:black; width: 380; height: 200; top: 240; left: 470" // background-color:#EEF1F2
	
	modalWinLayer.innerHTML = "<p align='right'><span style='color:red;text-decoration:underline;' onclick='javascript:closeModalWindow();'>Close&nbsp;X</span>&nbsp;</p> <table cellspacing='0' cellpadding='0' width='100%' height='100'><tr><td><a href='misha/poems.htm'><img src='images/smonkey.gif' width='50' height='100' border='0'></a></td><td><a href='mycalendar.htm'> <img src='images/hmonkey.gif' width='50' height='100' border='0'></a></td><td><a href='MyVCD.htm'> <img src='images/vmonkey.gif' width='50' height='100' border='0'></a></td><td><a href='watch/default.htm'> <img src='images/gmonkey.jpg' width='50' height='100' border='0'></a></td><td><a href='howto/default.htm'> <img src='images/bmonkey.jpg' width='50' height='100' border='0'></a></td><td><a href='pictures/albums.htm'> <img src='images/ymonkey.jpg' width='50' height='100' border='0'></a></td></tr></table>";
	
	backgroundLayer.style.cssText = backgroundLayerCss;	
	modalWinLayer.style.cssText = modalWinLayerCss;	
}

function closeModalWindow() {

    var backgroundWin = document.all ? document.all[backgroundId] : document.getElementById(backgroundId);
    if(backgroundWin) 
        document.body.removeChild(backgroundWin);

    var modalWin = document.all ? document.all[modalWinId] : document.getElementById(modalWinId);
    if(modalWin ) 
        document.body.removeChild(modalWin);
}

