function wrapBlockQuotes(element)
{
    var el = (typeof element == 'undefined') || document;
    var blockquotes = el.getElementsByTagName('blockquote');
    for (var i = 0; i < blockquotes.length; i++)
    {
        var div = document.createElement('div');
        var childNodeLength = blockquotes[i].childNodes.length;

        for (var j = 0; j < childNodeLength; j++)
        {
            div.appendChild(blockquotes[i].childNodes[0])
        }

        blockquotes[i].appendChild(div);
    }
}

function popUp(imgurl,imgwidth,imgheight,scroll) {
        /*begin configuration*/
            var url = imgurl;
            var w = imgwidth;
            var h = imgheight;
            var menu = "no";
             if (!scroll){
             var scroll = "no";
              }
           else {var scroll="yes";}
            var tool = "no";
            var location = "no";
            var resize = "no";
          /* end configuration */
            var winl = (screen.width - w) / 2;
            var wint = (screen.height - h) / 2;
            winprops = 'width='+w+', height='+h+', top='+wint+', left='+winl+', menubar='+menu+', scrollbars='+scroll+', toolbar='+tool+', location='+location+', resizable='+resize+''
            window.open(url, 'popup', winprops);
   }

function colorAltTableRows() {
    var tables = document.getElementsByTagName('table');
    for (var i = 0; i < tables.length; i++)
    {
        if (tables[i].className != 'grey_table') {
            continue;
        }
        var tableRows = tables[i].getElementsByTagName('tr');
        for (var j = 0; j < tableRows.length; j++)
        {
            var rowInner = tableRows[j].childNodes;
            var addClass = false;
            for (var k = 0; k < rowInner.length; k++) {
                if (rowInner[j].nodeType == 1 && rowInner[j].tagName == 'TD') {
                    addClass = true;
                }
            }
            if (j % 2 == 0) {
                tableRows[j].className = 'evenrow';
            }
            else {
                tableRows[j].className = 'oddrow';
            }
        }
    }
}

ToolMan.events().register(window, "load", wrapBlockQuotes.bindAsEventListener());
ToolMan.events().register(window, "load", colorAltTableRows.bindAsEventListener());
