function PortalX_Modules_Shared_DoPrint(strPageTitle, strStyleSheets, strElementId, strBodyCssClass)
{
    var elementToPrint = document.getElementById(strElementId);
    if (!elementToPrint)
        return true;
    
    var cWidth = elementToPrint.clientWidth;
    var cHeight = elementToPrint.clientHeight;
    var wTop = ((screen.availHeight) - cHeight) / 2;
    var wLeft = ((screen.availWidth) - cWidth) / 2;
    
    var prtWnd = window.open('', '_blank', 'scrollbars=yes,resizable=1,top=' + wTop + ',left=' + wLeft + ',width=' + cWidth + ',height=' + cHeight);
    
    if (!prtWnd)
        return true;
        
   prtWnd.document.write(
    '<html>\n' +
    '<head>\n' +
    '<base href="http://' + document.domain + '" \/>\n' +
    '<title>' + strPageTitle + '<\/title>\n' +
    strStyleSheets +
    '<\/head>\n' +
    '<body class="' + strBodyCssClass + '">' +
    elementToPrint.innerHTML +
    '<\/body>' +
    '<\/html>\n'
   );
  
   prtWnd.document.close();
   prtWnd.focus();
   prtWnd.print();
   //prtWnd.close();
   
   return true;
} // end PortalX_Modules_Shared_DoPrint
