// Browser safe opacity handling function

function setOpacity(value, xID) {
	
 window.document.getElementById(xID).style.opacity = value / 10;
 //window.document.getElementById(xID).style.filter = 'alpha(opacity=' + value * 10 + ')';
}

function fadeInMyPopup(x) {
 for( var i = 0 ; i <= 200 ; i++ )
   setTimeout( 'setOpacity(' + (i / 10) + ',"' + x + '")' , 8 * i );
}

function fadeOutMyPopup(x) {
 for( var i = 0 ; i <= 100 ; i++ ) {
   setTimeout( 'setOpacity(' + (10 - i / 10) + ',"' + x + '")' , 8 * i );
 }

 setTimeout('closeMyPopup(x)', 800 );
}

function closeMyPopup(x) {
 document.getElementById(x).style.display = "none"
}

function fireMyPopup(x) {
setOpacity(5, x);
 document.getElementById(x).style.display = "block";
 fadeInMyPopup(x);
}