var commonXHR;
if (window.XMLHttpRequest)     // Object of the current windows
{
    commonXHR = new XMLHttpRequest();     // Firefox, Safari, ...
}
else if (window.ActiveXObject)   // ActiveX version
{
    commonXHR = new ActiveXObject("MSXML2.XMLHTTP");  // Internet Explorer
}

function closeMe(pDevID) {
    var targetToClose = 'boxFrame' + pDevID;
    document.getElementById(targetToClose).src = '';
    closeMyPopup(pDevID)

}

function setOpacity(value, xID) {

 window.parent.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) {
 window.parent.document.getElementById(x).style.display = "none"
}

function fireMyPopup(x) {
 setOpacity(0, x);
  window.parent.document.getElementById(x).style.display = "block";
 fadeInMyPopup(x);
}
