
   // ------------------------------------------------------------------------------------------------------------------------------------------------
   // KIRReal portlet debugging
   // ------------------------------------------------------------------------------------------------------------------------------------------------

    function displayPortletDebug ( webRoot, pageID, portletID, portletName, portletClass, portletDesc, names, values ) {

        width  = 700;
        height = 450;


        var text = '<html><head>' +
            '<LINK HREF="' + webRoot + '/resources/portletDebug.css" REL="stylesheet" TYPE="text/css">' +
            '</head><body>';


        text += '<center><font class=portletDebugHeadline>';
        text += portletName;
        text += '</font></center><br>';

        text += '<table cellpadding=2 cellspacing=0 border="0">';
        text += '<tr><td class=portletDebugAttrName>page id:        </td><td width=30><td class=portletDebugAttrValue>' + pageID        + '</td></tr>';
        text += '<tr><td class=portletDebugAttrName>portlet id:     </td><td width=30><td class=portletDebugAttrValue>' + portletID     + '</td></tr>';
        text += '<tr><td class=portletDebugAttrName>portlet class:  </td><td width=30><td class=portletDebugAttrValue>' + portletClass  + '</td></tr>';
        text += '<tr><td class=portletDebugAttrName>description:    </td><td width=30><td class=portletDebugAttrValue>' + portletDesc   + '</td></tr>';
        text += '</table><br>';

        text += '<table cellpadding=2 cellspacing=0 border=1 class=portletDebugLinkTABLE>';
        text += '<tr><td class=portletDebugAttrTH>attribute</td><td class=portletDebugAttrTH>value</td></tr>';
        for ( i=0; i < names.length; i++ ) {        
            val = values[i];
            if ( val.indexOf('http://') == 0 || val.indexOf('https://') == 0 ) {
                val = '<a href="' + val + '" target="_blank">' + val + '</a>';
            }
            text += '<tr><td class=portletDebugAttrName>' + names[i] + '</td><td class=portletDebugAttrValue>' + val + '</td></tr>';
        }
        text += '</table><br>';

        text += '<center>';
        text += '<a class=portletDebugButton href="JavaScript:self.close()">close</a>';
        text += '</center>';


        text += '</body></html>';

        var ref = window.open ( '', 'portletDebug', "height=" + height + ",width=" + width + ",resizable=yes,dependent=no,scrollbars=yes,menubar=no,status=yes,toolbar=no" );
        var table = ref.document.write( text );
    }
