﻿ function popupAlert(header, content, accountDesignPath)
 {    
    var htmlString = "<div id=\"myBackGroundDiv\" style=\"filter: alpha(opacity=50); opacity: 0.50;-moz-opacity: 0.50; position: absolute; top: 0px; left: 0px; width: 100%; z-index: 999;background-color:white;display:block\"></div>"+
    "<table id=\"myBackGroundMessageTable\" border=\"0\" style=\"top: 280px; position: absolute; left: 330px; z-index: 1000; width: 248px;\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" class=\"Portlet\" >"+
    "<tr><td height=\"18px\" colspan=\"1\" background=\""+accountDesignPath+"/images/box_header.png\" class=\"box_title\" style=\"padding:0 0 0 5px;\">" + header + "</td></tr>"+
    "<tr><td style=\"width:248px; font-family: Arial,Helvetica,sans-serif; height:50px; padding:5px; text-transform: none;\" background=\""+accountDesignPath+"/images/box_body.png\">"+
    content+
    "</td></tr><tr><td align='center' background=\""+accountDesignPath+"/images/box_body.png\" style=\"padding-left:5px;\"><input type=\"button\" id=\"btClose\" class=\"btnDestinationClose\" style=\"cursor: pointer;\" onclick=\"closeAlert();\" /></td></tr>"+
    "<tr><td background=\""+accountDesignPath+"/images/box_bottom.png\" height=\"9px\"></td></tr></table>";
    
    var myBackGroundDivContainer = document.createElement("div");
    
    myBackGroundDivContainer.innerHTML = htmlString;
    
    document.forms[0].appendChild(myBackGroundDivContainer);

    document.getElementById('myBackGroundDiv').style.height = document.body.clientHeight + document.body.scrollTop + "px";
    document.getElementById('myBackGroundDiv').style.width = document.body.clientWidth + document.body.scrollLeft + "px";
	
    return false;
}

function closeAlert()
{ 
     var divElem=document.getElementById('myBackGroundMessageTable');
     var divElem2=document.getElementById('myBackGroundDiv');
     if ( divElem.parentNode != null && divElem2.parentNode != null)
     {
        divElem.parentNode.removeChild(divElem);
        divElem2.parentNode.removeChild(divElem2);
     }
}


