var popupBgColor = "#000000" ;
var popupWindowColor = "#cccccc" ;
var popupWindowBorder = "2px solid #080990" ;

function popup(html) {
	wrapper = document.getElementById('site-wrapper') ;
	div1 = document.createElement('div') ;
	div1.id = 'popup-translucent' ;
	div1.style.width = '100%' ;
	div1.style.height = '2000px' ;
	div1.onclick = function() {closePopup()}
	div1.style.position = 'absolute' ;
	div1.style.display = 'block' ;
	div1.style.cssfloat = 'left' ;
	div1.style.top = '0' ;
	div1.style.left = '0' ;
	div1.style.backgroundColor = popupBgColor ;
	div1.style.padding = '25px' ;
	document.body.appendChild(div1) ;
	div2 = document.createElement('div') ;
	div2.id = 'popup-window' ;
	div2.style.width = '400px' ;
	div2.style.height = '200px' ;
	div2.style.border = popupWindowBorder ;
	div2.style.cssFloat = "left" ;
	div2.style.position = 'absolute' ;
	div2.style.display = 'block' ;
	div2.style.top = '200px' ;
	div2.style.left = '420px' ;
	div2.style.backgroundColor = popupWindowColor ;
	div2.style.padding = '15px' ;
	div2.style.fontSize = '18px' ;
	div2.innerHTML = html ;
	document.body.appendChild(div2) ;
	SetOpacity(div1, 80) ;
}
function closePopup() {
	document.getElementById('popup-window').style.display = 'none' ;
	document.getElementById('popup-translucent').style.display = 'none' ;
}
function SetOpacity(elem, opacityAsInt)
{
     var opacityAsDecimal = opacityAsInt;
     
     if (opacityAsInt > 100)
         opacityAsInt = opacityAsDecimal = 100; 
     else if (opacityAsInt < 0)
         opacityAsInt = opacityAsDecimal = 0; 
    
    opacityAsDecimal /= 100;
    if (opacityAsInt < 1)
        opacityAsInt = 1; // IE7 bug, text smoothing cuts out if 0
   
    elem.style.opacity = (opacityAsDecimal);
    elem.style.filter  = "alpha(opacity=" + opacityAsInt + ")";
}
