var buttonbackgroundcolor = '#AC0C0C';



var ajax_pipes=new Array();
ajax_pipes[1]='sites';
ajax_pipes[2]='visits';
ajax_pipes[3]='sp';
ajax_pipes[4]='ssp';
ajax_pipes[5]='shownspages_to_search';
ajax_pipes[6]='wp';
ajax_pipes[7]='xpandtext';
ajax_pipes[8]='shownsresults';
ajax_pipes[9]='ttyuse4';
ajax_pipes[10]='56m243cxsd';
ajax_pipes[11]='asdfasr';
ajax_pipes[12]='votepost';
ajax_pipes[13]='6h5yh53dccch7';
ajax_pipes[14]='votemods_log';
ajax_pipes[15]='erase_sp';
ajax_pipes[16]='erase_page_to_search';
ajax_pipes[17]='add_page_to_search';

for (xol in ajax_pipes)
{
    var joystring = 'var req' + ajax_pipes[xol] + '; function loadXMLDoc' + ajax_pipes[xol] + '(url) {if (window.XMLHttpRequest) {req' + ajax_pipes[xol] + ' = new XMLHttpRequest(); req' + ajax_pipes[xol] + '.onreadystatechange = processReqChange' + ajax_pipes[xol] + '; req' + ajax_pipes[xol] + '.open("GET", url, true); req' + ajax_pipes[xol] + '.send(null);} else if (window.ActiveXObject){req' + ajax_pipes[xol] + ' = new ActiveXObject("Microsoft.XMLHTTP"); if (req' + ajax_pipes[xol] + ') {req' + ajax_pipes[xol] + '.onreadystatechange = processReqChange' + ajax_pipes[xol] + ';req' + ajax_pipes[xol] + '.open("GET", url, true);req' + ajax_pipes[xol] + '.send();}}}';
    eval(joystring);
}





function shosites(movieorserie, order, page, rows, columns, shownuserID, alpha)
{
    var modthing = "";
    if(moderator_level>=1)
    {
        modthing = "&showall=yes";
    }
    var urlz = "xmlsites?movieorserie=" + movieorserie + "&order=" + order + "&page=" + page + "&rows=" + rows + "&columns=" + columns + "&shownuserID=" + shownuserID + "&alpha=" + alpha + modthing;
    loadXMLDocsites(urlz);
}
//read sites from xml
var keepitup = 0;
function processReqChangesites()
{
    if (reqsites.readyState == 4)
    {
        if (reqsites.status == 200)
        {
            var result_string = "";
            var response = reqsites.responseXML.documentElement;
            var result = response.getElementsByTagName("result")[0].firstChild.data;
            if(result == "ok")
            {
                var pagination_string = '';
                var totalsites = response.getElementsByTagName("totalsites")[0].firstChild.data;
                var totalpages = response.getElementsByTagName("totalpages")[0].firstChild.data;
                var thispage = response.getElementsByTagName("thispage")[0].firstChild.data;
                var order = response.getElementsByTagName("order")[0].firstChild.data;
                var rows = response.getElementsByTagName("rows")[0].firstChild.data;
                var columns = response.getElementsByTagName("columns")[0].firstChild.data;
                var movieorserie = response.getElementsByTagName("movieorserie")[0].firstChild.data;
                var shownuserID = response.getElementsByTagName("shownuserID")[0].firstChild.data;
                var alpha = response.getElementsByTagName("alpha")[0].firstChild.data;

                var alphazz=new Array()
                if(alpha=='all')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                alphazz[0] = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'all'" + ')" style="cursor:pointer;' + backgroundclause + '">&#160;all&#160;</a>';
                if(alpha=='boul')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                alphazz[1] = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'boul'" + ')" style="cursor:pointer;' + backgroundclause + '">&#160;#&#160;</a>';
                if(alpha=='A')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                alphazz[2] = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'A'" + ')" style="cursor:pointer;' + backgroundclause + '">&#160;A&#160;</a>';
                if(alpha=='B')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                alphazz[3] = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'B'" + ')" style="cursor:pointer;' + backgroundclause + '">&#160;B&#160;</a>';
                if(alpha=='C')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                alphazz[4] = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'C'" + ')" style="cursor:pointer;' + backgroundclause + '">&#160;C&#160;</a>';
                if(alpha=='D')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                alphazz[5] = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'D'" + ')" style="cursor:pointer;' + backgroundclause + '">&#160;D&#160;</a>';
                if(alpha=='E')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                alphazz[6] = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'E'" + ')" style="cursor:pointer;' + backgroundclause + '">&#160;E&#160;</a>';
                if(alpha=='F')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                alphazz[7] = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'F'" + ')" style="cursor:pointer;' + backgroundclause + '">&#160;F&#160;</a>';
                if(alpha=='G')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                alphazz[8] = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'G'" + ')" style="cursor:pointer;' + backgroundclause + '">&#160;G&#160;</a>';
                if(alpha=='H')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                alphazz[9] = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'H'" + ')" style="cursor:pointer;' + backgroundclause + '">&#160;H&#160;</a>';
                if(alpha=='I')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                alphazz[10] = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'I'" + ')" style="cursor:pointer;' + backgroundclause + '">&#160;I&#160;</a>';
                if(alpha=='J')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                alphazz[11] = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'J'" + ')" style="cursor:pointer;' + backgroundclause + '">&#160;J&#160;</a>';
                if(alpha=='K')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                alphazz[12] = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'K'" + ')" style="cursor:pointer;' + backgroundclause + '">&#160;K&#160;</a>';
                if(alpha=='L')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                alphazz[13] = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'L'" + ')" style="cursor:pointer;' + backgroundclause + '">&#160;L&#160;</a>';
                if(alpha=='M')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                alphazz[14] = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'M'" + ')" style="cursor:pointer;' + backgroundclause + '">&#160;M&#160;</a>';
                if(alpha=='N')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                alphazz[15] = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'N'" + ')" style="cursor:pointer;' + backgroundclause + '">&#160;N&#160;</a>';
                if(alpha=='O')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                alphazz[16] = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'O'" + ')" style="cursor:pointer;' + backgroundclause + '">&#160;O&#160;</a>';
                if(alpha=='P')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                alphazz[17] = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'P'" + ')" style="cursor:pointer;' + backgroundclause + '">&#160;P&#160;</a>';
                if(alpha=='Q')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                alphazz[18] = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'Q'" + ')" style="cursor:pointer;' + backgroundclause + '">&#160;Q&#160;</a>';
                if(alpha=='R')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                alphazz[19] = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'R'" + ')" style="cursor:pointer;' + backgroundclause + '">&#160;R&#160;</a>';
                if(alpha=='S')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                alphazz[20] = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'S'" + ')" style="cursor:pointer;' + backgroundclause + '">&#160;S&#160;</a>';
                if(alpha=='T')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                alphazz[21] = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'T'" + ')" style="cursor:pointer;' + backgroundclause + '">&#160;T&#160;</a>';
                if(alpha=='U')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                alphazz[22] = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'U'" + ')" style="cursor:pointer;' + backgroundclause + '">&#160;U&#160;</a>';
                if(alpha=='V')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                alphazz[23] = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'V'" + ')" style="cursor:pointer;' + backgroundclause + '">&#160;V&#160;</a>';
                if(alpha=='W')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                alphazz[24] = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'W'" + ')" style="cursor:pointer;' + backgroundclause + '">&#160;W&#160;</a>';
                if(alpha=='X')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                alphazz[25] = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'X'" + ')" style="cursor:pointer;' + backgroundclause + '">&#160;X&#160;</a>';
                if(alpha=='Y')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                alphazz[26] = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'Y'" + ')" style="cursor:pointer;' + backgroundclause + '">&#160;Y&#160;</a>';
                if(alpha=='Z')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                alphazz[27] = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'Z'" + ')" style="cursor:pointer;' + backgroundclause + '">&#160;Z&#160;</a>';
                var myalphastring = '';
                for (x in alphazz)
                {
                    myalphastring = myalphastring + alphazz[x] + ' ';
                }
                result_string = result_string + '<div class="effect" style="font-size:80%;">starting with: ' + myalphastring + '</div>';


                if(order=='creation_time')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                var orderbytimelink = ' -<a style="cursor:pointer;' + backgroundclause + '" onclick="shosites(' + movieorserie + ', ' + "'creation_time'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'" + alpha + "'" + ')">oldest</a>';
                if(order=='creation_time_DESC')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                var orderbytimerevlink = ' -<a style="cursor:pointer;' + backgroundclause + '" onclick="shosites(' + movieorserie + ', ' + "'creation_time_DESC'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'" + alpha + "'" + ')">most recent</a>';




                //all-time
                if(order=='rating')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                var orderbyratinglink = ' -<a style="cursor:pointer;' + backgroundclause + '" onclick="shosites(' + movieorserie + ', ' + "'rating'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'" + alpha + "'" + ')">worst all-time rating</a>';
                if(order=='rating_DESC')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                var orderbyratingrevlink = ' -<a style="cursor:pointer;' + backgroundclause + '" onclick="shosites(' + movieorserie + ', ' + "'rating_DESC'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'" + alpha + "'" + ')">best all-time rating</a>';

                //daily
                if(order=='dailyrating')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                var orderbydailyratinglink = ' -<a style="cursor:pointer;' + backgroundclause + '" onclick="shosites(' + movieorserie + ', ' + "'dailyrating'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'" + alpha + "'" + ')">worst rating today</a>';
                if(order=='dailyrating_DESC')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                var orderbydailyratingrevlink = ' -<a style="cursor:pointer;' + backgroundclause + '" onclick="shosites(' + movieorserie + ', ' + "'dailyrating_DESC'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'" + alpha + "'" + ')">best rating today</a>';

                //weekly
                if(order=='weeklyrating')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                var orderbyweeklyratinglink = ' -<a style="cursor:pointer;' + backgroundclause + '" onclick="shosites(' + movieorserie + ', ' + "'weeklyrating'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'" + alpha + "'" + ')">worst rating this week</a>';
                if(order=='weeklyrating_DESC')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                var orderbyweeklyratingrevlink = ' -<a style="cursor:pointer;' + backgroundclause + '" onclick="shosites(' + movieorserie + ', ' + "'weeklyrating_DESC'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'" + alpha + "'" + ')">best rating this week</a>';

                //monthly
                if(order=='monthlyrating')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                var orderbymonthlyratinglink = ' -<a style="cursor:pointer;' + backgroundclause + '" onclick="shosites(' + movieorserie + ', ' + "'monthlyrating'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'" + alpha + "'" + ')">worst rating this month</a>';
                if(order=='monthlyrating_DESC')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                var orderbymonthlyratingrevlink = ' -<a style="cursor:pointer;' + backgroundclause + '" onclick="shosites(' + movieorserie + ', ' + "'monthlyrating_DESC'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'" + alpha + "'" + ')">best rating this month</a>';

                //yearly
                if(order=='yearlyrating')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                var orderbyyearlyratinglink = ' -<a style="cursor:pointer;' + backgroundclause + '" onclick="shosites(' + movieorserie + ', ' + "'yearlyrating'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'" + alpha + "'" + ')">worst rating this year</a>';
                if(order=='yearlyrating_DESC')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                var orderbyyearlyratingrevlink = ' -<a style="cursor:pointer;' + backgroundclause + '" onclick="shosites(' + movieorserie + ', ' + "'yearlyrating_DESC'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'" + alpha + "'" + ')">best rating this year</a>';




                if(order=='clicks')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                var orderbyclickslink = ' -<a style="cursor:pointer;' + backgroundclause + '" onclick="shosites(' + movieorserie + ', ' + "'clicks'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'" + alpha + "'" + ')">least clicks</a>';
                if(order=='clicks_DESC')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                var orderbyclicksrevlink = ' -<a style="cursor:pointer;' + backgroundclause + '" onclick="shosites(' + movieorserie + ', ' + "'clicks_DESC'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'" + alpha + "'" + ')">most clicks</a>';
                if(order=='site_name')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                var orderbynamelink = ' -<a style="cursor:pointer;' + backgroundclause + '" onclick="shosites(' + movieorserie + ', ' + "'site_name'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'" + alpha + "'" + ')">name</a>';
                if(order=='site_name_DESC')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                var orderbynamerevlink = ' -<a style="cursor:pointer;' + backgroundclause + '" onclick="shosites(' + movieorserie + ', ' + "'site_name_DESC'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'" + alpha + "'" + ')">name reverse</a>';
                if(order=='votes')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                var orderbyvoteslink = ' -<a style="cursor:pointer;' + backgroundclause + '" onclick="shosites(' + movieorserie + ', ' + "'votes'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'" + alpha + "'" + ')">least votes</a>';
                if(order=='votes_DESC')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                var orderbyvotesrevlink = ' -<a style="cursor:pointer;' + backgroundclause + '" onclick="shosites(' + movieorserie + ', ' + "'votes_DESC'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'" + alpha + "'" + ')">most votes</a>';
                if(order=='RAND')
                {
                    var backgroundclause = 'background-color:' + buttonbackgroundcolor + ';';
                }
                else
                {
                    var backgroundclause = '';
                }
                var orderbyrandlink = ' -<a style="cursor:pointer;' + backgroundclause + '" onclick="shosites(' + movieorserie + ', ' + "'RAND'" + ', 1,' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'" + alpha + "'" + ')">random</a>';

                var reorderstring = orderbyratingrevlink + orderbyratinglink +
                orderbydailyratingrevlink + orderbydailyratinglink +
                orderbyweeklyratingrevlink + orderbyweeklyratinglink +
                orderbymonthlyratingrevlink + orderbymonthlyratinglink +
                orderbyyearlyratingrevlink + orderbyyearlyratinglink +
                '<br />' +
                orderbytimelink + orderbytimerevlink + orderbyclickslink + orderbyclicksrevlink + orderbynamelink + orderbynamerevlink + orderbyvoteslink + orderbyvotesrevlink + orderbyrandlink;

                var orderstring = '<div class="effect" style="font-size:80%;">order: ' + reorderstring + '</div>';
                if(totalsites==0)
                {
                    result_string = result_string + '<h3 style="text-align:center;">empty</h3>';
                    if(shownuserID!=0 && keepitup!=1)
                    {
                        document.getElementById('userpageblankorz').innerHTML = '';
                    }
                }
                else
                {
                    keepitup=1;
                    result_string = result_string + orderstring;
                }

                totalpages = Math.abs(totalpages);
                if(totalpages > 1)
                {



                    var minus100page = Math.abs(thispage)-100;
                    var minus10page = Math.abs(thispage)-10;
                    var previouspage = Math.abs(thispage)-1;
                    var nextpage = Math.abs(thispage)+1;
                    var plus10page = Math.abs(thispage)+10;
                    var plus100page = Math.abs(thispage)+100;

                    var minus100pagebutton = '';
                    var minus10pagebutton = '';
                    var previouspagebutton = '';
                    var nextpagebutton = '';
                    var plus10pagebutton = '';
                    var plus100pagebutton = '';

                    if(thispage>100)
                    {
                        minus100pagebutton = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', ' + minus100page + ',' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'" + alpha + "'" + ')" style="cursor:pointer;">-100</a> | ';
                    }
                    if(thispage>10)
                    {
                        minus10pagebutton = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', ' + minus10page + ',' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'" + alpha + "'" + ')" style="cursor:pointer;">-10</a> | ';
                    }
                    if(thispage>1)
                    {
                        previouspagebutton = '<a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', ' + previouspage + ',' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'" + alpha + "'" + ')" style="cursor:pointer;">previous</a> | ';
                    }
                    if(thispage<totalpages)
                    {
                        nextpagebutton = ' | <a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', ' + nextpage + ',' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'" + alpha + "'" + ')" style="cursor:pointer;">next</a>';
                    }
                    if(thispage<(totalpages-10))
                    {
                        plus10pagebutton = ' | <a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', ' + plus10page + ',' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'" + alpha + "'" + ')" style="cursor:pointer;">+10</a>';
                    }
                    if(thispage<(totalpages-100))
                    {
                        plus100pagebutton = ' | <a onclick="shosites(' + movieorserie + ', ' + "'" + order + "'" + ', ' + plus100page + ',' + "'" + rows + "'" + ',' + "'" + columns + "'" + ', ' + shownuserID + ', ' + "'" + alpha + "'" + ')" style="cursor:pointer;">+100</a>';
                    }


                    pagination_string = '<div class="effect" style="font-size:80%;">' + minus100pagebutton + minus10pagebutton + previouspagebutton + 'page ' + thispage + ' of ' + totalpages + nextpagebutton + plus10pagebutton + plus100pagebutton + '</div>';

                }
                result_string = result_string + pagination_string;
                var count = 0;
                result_string = result_string + '<table style="table-layout:fixed;width:100%;background-color:#444444;" class="togrey">';
                var countcolumns = 0;
                var willhavetoload=new Array();
                while (count < totalsites)
                {
                    count++;
                    countcolumns++;
                    var thissiteIDname = "siteID_" + count;
                    var thissite_namename = "site_name_" + count;
                    var thissite_URLname = "site_URL_" + count;
                    var thissite_picturename = "site_picture_" + count;
                    var thissite_descriptionname = "site_description_" + count;


                    var thisratingname = "rating_" + count;
                    var thisvotesname = "votes_" + count;
                                        
                    var thisdailyratingname = "dailyrating_" + count;
                    var thisdailyvotesname = "dailyvotes_" + count;
                    var thisweeklyratingname = "weeklyrating_" + count;
                    var thisweeklyvotesname = "weeklyvotes_" + count;
                    var thismonthlyratingname = "monthlyrating_" + count;
                    var thismonthlyvotesname = "monthlyvotes_" + count;
                    var thisyearlyratingname = "yearlyrating_" + count;
                    var thisyearlyvotesname = "yearlyvotes_" + count;



                    var thisclicksname = "clicks_" + count;
                    var thiscreation_timename = "creation_time_" + count;
                    var thishowmanypagesname = "howmanypages_" + count;
                    var thishowmanypages2name = "howmanypages2_" + count;
                    var thishowmanycrawledpagesname = "howmanycrawledpages_" + count;
                    var thishowmanycommentsname = "howmanycomments_" + count;
                    var thislastcomment_timename = "lastcomment_time_" + count;
                    var thislast_visitor_timename = "last_visitor_time_" + count;
                    var thisauditedname = "audited_" + count;
                    var thissiteID = response.getElementsByTagName(thissiteIDname)[0].firstChild.data;
                    var thissite_name = response.getElementsByTagName(thissite_namename)[0].firstChild.data;
                    var thissite_URL = response.getElementsByTagName(thissite_URLname)[0].firstChild.data;
                    var thissite_picture = response.getElementsByTagName(thissite_picturename)[0].firstChild.data;
                    var thissite_description = response.getElementsByTagName(thissite_descriptionname)[0].firstChild.data;


                    var thisrating = response.getElementsByTagName(thisratingname)[0].firstChild.data;
                    var thisvotes = response.getElementsByTagName(thisvotesname)[0].firstChild.data;

                    var thisdailyrating = response.getElementsByTagName(thisdailyratingname)[0].firstChild.data;
                    var thisdailyvotes = response.getElementsByTagName(thisdailyvotesname)[0].firstChild.data;
                    var thisweeklyrating = response.getElementsByTagName(thisweeklyratingname)[0].firstChild.data;
                    var thisweeklyvotes = response.getElementsByTagName(thisweeklyvotesname)[0].firstChild.data;
                    var thismonthlyrating = response.getElementsByTagName(thismonthlyratingname)[0].firstChild.data;
                    var thismonthlyvotes = response.getElementsByTagName(thismonthlyvotesname)[0].firstChild.data;
                    var thisyearlyrating = response.getElementsByTagName(thisyearlyratingname)[0].firstChild.data;
                    var thisyearlyvotes = response.getElementsByTagName(thisyearlyvotesname)[0].firstChild.data;



                    var thisclicks = response.getElementsByTagName(thisclicksname)[0].firstChild.data;
                    var thiscreation_time = response.getElementsByTagName(thiscreation_timename)[0].firstChild.data;
                    var thishowmanypages = response.getElementsByTagName(thishowmanypagesname)[0].firstChild.data;
                    var thishowmanypages2 = response.getElementsByTagName(thishowmanypages2name)[0].firstChild.data;
                    var thishowmanycrawledpages = response.getElementsByTagName(thishowmanycrawledpagesname)[0].firstChild.data;
                    var thishowmanycomments = response.getElementsByTagName(thishowmanycommentsname)[0].firstChild.data;
                    var thislastcomment_time = response.getElementsByTagName(thislastcomment_timename)[0].firstChild.data;
                    var thislast_visitor_time = response.getElementsByTagName(thislast_visitor_timename)[0].firstChild.data;
                    var thisaudited = response.getElementsByTagName(thisauditedname)[0].firstChild.data;
                    var notauditedmessage = "";
                    if(thisaudited != 1)
                    {
                        notauditedmessage = '<div style="width:100%;text-align:center;font-weight:bold;color:red;">THIS WEBSITE HAS NOT BEEN AUDITED YET</div>';
                    }
                    var picid = 'pic' + thissiteID;
                    if(countcolumns == 1)
                    {
                        result_string = result_string + '<tr>';
                    }
                    var pic_width = 90;
                    var pic_height = 60;
                    var detailslink = 'details?site=' + thissiteID + '&gobackmovieorserie=' + movieorserie + '&gobackpage=' + thispage + '&gobackalpha=' + alpha + '&gobackorder=' + order;
                    //var thispic = "<a href=" + '"' + detailslink + '"' + "><img src='" + thissite_picture + "' id='" + picid + "' style='width:11px;height:11px;' onload='resize_movi_thum(" + pic_width + ", " + pic_height + ", " + '"' + picid + '"' + ")' /></a>";
                    thissite_picture=thissite_picture.replace(/&amp;/gi,'&');
                    willhavetoload['pixz_' + thissiteID]=thissite_picture;
                    var thispic = "<a href=" + '"' + detailslink + '"' + "><img id='pixz_" + thissiteID + "' style='display:none;' /></a>";
                    var  thissite_name_treated = replacez(thissite_name,'.',' .');
                    var sitename = "<div style='height:40px;font-size:15px;font-weight:bold;'><a href=" + '"' + detailslink + '"' + ">" + wordwrap(thissite_name_treated, 18, '<br />', true) + "</a></div>";
                    var maxwantedlenghtfordescr = 120;
                    var gofordescription = thissite_description;
                    var descrlen = thissite_description.length;
                    //if(descrlen > maxwantedlenghtfordescr)
                    //{gofordescription = gofordescription.substr(0,maxwantedlenghtfordescr) + "..";}
                    //var sitedescr = "<div style='font-size:75%;'>" + wordwrap(gofordescription, 23, '<br />', true) + "</div>";
                    var sitedescr = "<div style='width:100%;height:70px;'><div style='width:100%;height:60px;font-size:75%;overflow:auto;' class='flexcroll'>" + gofordescription + "</div></div>";
                    var visitlink = "<div style='font-size:80%;'>" + makevisittring(thissiteID, thissite_URL, thisclicks, thiscreation_time, thislast_visitor_time) + "</div>";
                    var votedivid = 'votediv_' + thissiteID;
                    var votetlink = "<div style='font-size:80%;' id='" + votedivid + "'>" + makevotestring(thissiteID, thisrating, thisvotes, thisdailyrating, thisdailyvotes, thisweeklyrating, thisweeklyvotes, thismonthlyrating, thismonthlyvotes, thisyearlyrating, thisyearlyvotes, thissite_name) + "</div>";
                    if(thishowmanypages2==1)
                    {
                        var thishowmanypagesS = '';
                    }
                    else
                    {
                        var thishowmanypagesS = 's';
                    }
                    if(thishowmanycomments==1)
                    {
                        var thishowmanycommentsS = '';
                    }
                    else
                    {
                        var thishowmanycommentsS = 's';
                    }
                    if(thishowmanycomments==0)
                    {
                        var lastposttime = '';
                    }
                    else
                    {
                        var lastposttime = ', last on ' + maketimus(thislastcomment_time);
                    }
                    //var detailslink = '<div style="font-size:80%;">' + thishowmanycomments + ' comment' + thishowmanycommentsS + lastposttime + '. ' + thishowmanypages2 + ' indexed page' + thishowmanypagesS + '.</div>';

                    var shocomments = thishowmanycomments + ' comment' + thishowmanycommentsS + lastposttime;
                    if(thishowmanycomments==0)
                    {
                        shocomments = 'awaiting comments...';
                    }
                    var commentsdetails = '<div style="font-size:80%;">' + shocomments + '</div>';

                    
                    var indexedpages = '<tr><td  style="background-color:#444444;"><div style="font-size:80%;"><a href="' + detailslink + '#search_results"><img src="graphix/mg.gif" style="position:relative;top:2px;" /> ' + thishowmanypages2 + ' indexed page' + thishowmanypagesS + '</a></div></td></tr>';
                    if(thishowmanypages2==0)
                    {
                        indexedpages = '';
                    }

                    var thisdatarow = sitename + sitedescr + '<div style="padding:4px;"><table style="background-color:#000000;"><tr><td  style="background-color:#000000;">' + votetlink + '</td></tr><tr><td  style="background-color:#444444;">' + visitlink + '</td></tr><tr><td  style="background-color:#000000;">' + commentsdetails + '</td></tr>' + indexedpages + '</table></div>';


                    var cellwidth = Math.floor(100 / columns);
                    result_string = result_string + '<td style="width:' + cellwidth + '%;vertical-align:top;padding:6px;"><div class="effect" style="width:100%;text-align:center;background-color:#000000;"><table style="width:100%;table-layout:fixed;text-align:center;"><tr><td style="text-align:center;vertical-align:bottom;height:' + (pic_height + 8) + 'px;">' + thispic + '</td></tr><tr><td style="text-align:center;vertical-align:top;">' + notauditedmessage + thisdatarow + "</td></tr></table></div></td>";
                    if(countcolumns == columns)
                    {
                        result_string = result_string + '</tr>';
                        countcolumns = 0;
                    }
                }
                if(countcolumns!=0)
                {
                    while(countcolumns < columns)
                    {
                        countcolumns++
                        result_string = result_string + '<td>&#160;</td>';
                        if(countcolumns == columns)
                        {
                            result_string = result_string + '</tr>';
                        }
                    }
                }
                result_string = result_string + '</table>';
                result_string = result_string + pagination_string;
            }
            else
            {
                result_string = 'error connecting to database';
            }
            document.getElementById('sites').innerHTML = result_string;
            fleXenv.initByClass("flexcroll");
            for(x in willhavetoload)
            {
                put_pic(x,willhavetoload[x],'graphix/defaultpic.jpg',pic_width,pic_height);
            }
        }
        else
        {
            alert("There was a problem retrieving the XML data:\n" + reqsites.statusText);
        }
    }
}



function makevotestring(thissiteID, thisrating, thisvotes, thisdailyrating, thisdailyvotes, thisweeklyrating, thisweeklyvotes, thismonthlyrating, thismonthlyvotes, thisyearlyrating, thisyearlyvotes, thissite_name)
{
    var point_dexclama = '<img src="graphix/point_dexclama.gif" alt="!" />';

    if(thisvotes==1)
    {
        var votesS = '';
    }
    else
    {
        var votesS = 's';
    }

    if(thisdailyvotes==1)
    {
        var dailyvotesS = '';
    }
    else
    {
        var dailyvotesS = 's';
    }
    if(thisweeklyvotes==1)
    {
        var weeklyvotesS = '';
    }
    else
    {
        var weeklyvotesS = 's';
    }
    if(thismonthlyvotes==1)
    {
        var monthlyvotesS = '';
    }
    else
    {
        var monthlyvotesS = 's';
    }
    if(thisyearlyvotes==1)
    {
        var yearlyvotesS = '';
    }
    else
    {
        var yearlyvotesS = 's';
    }


    thisdailyrating = '<acronym title="' + thisdailyrating + '">' + Math.round(thisdailyrating * 100) / 100 + '</acronym>';
    thisweeklyrating = '<acronym title="' + thisweeklyrating + '">' + Math.round(thisweeklyrating * 100) / 100 + '</acronym>';
    thismonthlyrating = '<acronym title="' + thismonthlyrating + '">' + Math.round(thismonthlyrating * 100) / 100 + '</acronym>';
    thisyearlyrating = '<acronym title="' + thisyearlyrating + '">' + Math.round(thisyearlyrating * 100) / 100 + '</acronym>';
    thisrating = '<acronym title="' + thisrating + '">' + Math.round(thisrating * 100) / 100 + '</acronym>';

    if(thisdailyvotes==0)
    {
        thisdailyrating='?';
    }
    if(thisweeklyvotes==0)
    {
        thisweeklyrating='?';
    }
    if(thismonthlyvotes==0)
    {
        thismonthlyrating='?';
    }
    if(thisyearlyvotes==0)
    {
        thisyearlyrating='?';
    }
    if(thisvotes==0)
    {
        thisrating='?';
    }

    var shovotesstring = '<center>rating: (' +
    "<a onclick='vote(" + thissiteID + ", " + '"' + thissite_name + '"' + ")' style='cursor:pointer;' id='vote_link_" + thissiteID + "'>" + point_dexclama + " vote</a>" +
    ')<table style="font-size:12px;">' +
    '<tr><td style="text-align:right;">today:</td><td style="font-weight:bold;">' + thisdailyrating + '</td><td>' + thisdailyvotes + ' vote' + dailyvotesS + '</td></td>' +
    '<tr><td style="text-align:right;">this week:</td><td style="font-weight:bold;">' + thisweeklyrating + '</td><td>' + thisweeklyvotes + ' vote' + weeklyvotesS + '</td></td>' +
    '<tr><td style="text-align:right;">this month:</td><td style="font-weight:bold;">' + thismonthlyrating + '</td><td>' + thismonthlyvotes + ' vote' + monthlyvotesS + '</td></td>' +
    '<tr><td style="text-align:right;">this year:</td><td style="font-weight:bold;">' + thisyearlyrating + '</td><td>' + thisyearlyvotes + ' vote' + yearlyvotesS + '</td></td>' +
    '<tr><td style="text-align:right;">all-time:</td><td style="font-weight:bold;">' + thisrating + '</td><td>' + thisvotes + ' vote' + votesS + '</td></td>' +
    '</table></center>';

    return shovotesstring;
}
function updatevotestring(thissiteID, thisrating, thisvotes, thisdailyrating, thisdailyvotes, thisweeklyrating, thisweeklyvotes, thismonthlyrating, thismonthlyvotes, thisyearlyrating, thisyearlyvotes, thissite_name)
{
    var votedivid = 'votediv_' + thissiteID;
    document.getElementById(votedivid).innerHTML = makevotestring(thissiteID, thisrating, thisvotes, thisdailyrating, thisdailyvotes, thisweeklyrating, thisweeklyvotes, thismonthlyrating, thismonthlyvotes, thisyearlyrating, thisyearlyvotes, thissite_name);
}
function makevisittring(thissiteID, thissite_URL, thisclicks, thiscreation_time, thislast_visitor_time)
{
    if(thisclicks==1)
    {
        var clicksS = '';
    }
    else
    {
        var clicksS = 's';
    }
    if(thisclicks >= 1)
    {
        var lastvisitorinfo = ' last visitor <span id="lstvisitorspan_' + thissiteID + '">' + maketimus(thislast_visitor_time) + '</span>';
    }
    else
    {
        var lastvisitorinfo = '';
    }
    if(thiscreation_time == 0)
    {
        var thissincestring = '';
    }
    else
    {
        var thissincestring = ' since ' + maketimus(thiscreation_time);
    }
    var clicksinfo = '<span id="clicksspan_' + thissiteID + '">' + thisclicks + '</span> visitor<span id="clicksSspan_' + thissiteID + '">' + clicksS + '</span> sent' + thissincestring + '.' + lastvisitorinfo;
    var visitlink = clicksinfo;
    return visitlink;
}
function inc_clicks(thissiteID)
{
    var urlz = "xmlincclicks?site=" + thissiteID;
    loadXMLDocvisits(urlz);
}


function processReqChangevisits()
{
    if (reqvisits.readyState == 4)
    {
        if (reqvisits.status == 200)
        {
            var response = reqvisits.responseXML.documentElement;
            var result = response.getElementsByTagName("result")[0].firstChild.data;
            var site = response.getElementsByTagName("site")[0].firstChild.data;
            var clicks = response.getElementsByTagName("clicks")[0].firstChild.data;
            var last_visitor_time = response.getElementsByTagName("last_visitor_time")[0].firstChild.data;
            if(result=='ok')
            {
                var clicksspanid = "clicksspan_" + site;
                var clicksSspanid = "clicksSspan_" + site;
                var lstvisitorspanid = "lstvisitorspan_" + site;
                document.getElementById(clicksspanid).innerHTML = clicks;
                if(clicks == 1)
                {
                    document.getElementById(clicksSspanid).innerHTML = '';
                }
                else
                {
                    document.getElementById(clicksSspanid).innerHTML = 's';
                }
                document.getElementById(lstvisitorspanid).innerHTML = maketimus(last_visitor_time);
            }
            else if(result=='error')
            {
                var loginmessage = 'problems reaching database, please try reloading the page';
                alert(loginmessage);
            }
        }
        else
        {
            alert("There was a problem retrieving the XML data:\n" + reqsp.statusText);
        }
    }
}



function resize_movi_thum(maxwidth, maxheigth, thispicid, test)
{
    if(test == 'shiz')
    {
        var alertmess = 'iget dimens for pic ' + thispicid;
    //alert(alertmess);
    }
    var thepiconmypage = document.getElementById(thispicid);
    var image_source = thepiconmypage.src;
    var oImg = new Image();
    oImg.src = image_source;
    if (oImg.complete)
    {
        var width_of_this_pic_is_what_pr1_of_max = oImg.width / maxwidth;
        var height_of_this_pic_is_what_pr1_of_max = oImg.height / maxheigth;
        if(width_of_this_pic_is_what_pr1_of_max > 1 && width_of_this_pic_is_what_pr1_of_max >= height_of_this_pic_is_what_pr1_of_max)
        {
            var newwidth = Math.floor(oImg.width / width_of_this_pic_is_what_pr1_of_max);
            var newheigth = Math.floor(oImg.height / width_of_this_pic_is_what_pr1_of_max);
            thepiconmypage.style.width = newwidth + "px";
            thepiconmypage.style.height = newheigth + "px";
        }
        else if(height_of_this_pic_is_what_pr1_of_max > 1)
        {
            var newwidth = Math.floor(oImg.width / height_of_this_pic_is_what_pr1_of_max);
            var newheigth = Math.floor(oImg.height / height_of_this_pic_is_what_pr1_of_max);
            thepiconmypage.style.width = newwidth + "px";
            thepiconmypage.style.height = newheigth + "px";
        }
        else
        {
            thepiconmypage.style.width = oImg.width + "px";
            thepiconmypage.style.height = oImg.height + "px";
        }
    }
    else
    {
        var refunction = "resize_movi_thum(" + maxwidth + ", " + maxwidth + ", '" + thispicid + "', 'shiz')";
        var t=setTimeout(refunction,3000);
    }
}
function maketimus(timestampz)
{
    if(timestampz == 0)
    {
        return '<span style="font-style:italic;color:#CCCCCC;">N.A</span>';
    }
    else
    {
        var linktime = new Date(timestampz * 1000);
        var linkday = linktime.getDate();
        var freakingmonths=new Array();
        freakingmonths[0]="jan";
        freakingmonths[1]="feb";
        freakingmonths[2]="mar";
        freakingmonths[3]="apr";
        freakingmonths[4]="may";
        freakingmonths[5]="jun";
        freakingmonths[6]="jul";
        freakingmonths[7]="aug";
        freakingmonths[8]="sep";
        freakingmonths[9]="oct";
        freakingmonths[10]="nov";
        freakingmonths[11]="dec";
        var linkmonthnum = linktime.getMonth();
        var linkmonth = freakingmonths[linkmonthnum];
        var linkyear = linktime.getFullYear();
        var linkhour = linktime.getHours();
        var linkminute = linktime.getMinutes();
        if (linkminute < 10)
        {
            linkminute = "0" + linkminute;
        }
        var fomratedtime = linkday + linkmonth + linkyear + " " + linkhour + ":" + linkminute + "h";
        return fomratedtime;
    }
}


function wordwrap( str, int_width, str_break, cut ) {
    // http://kevin.vanzonneveld.net
    // +   original by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)
    // +   improved by: Nick Callen
    // +    revised by: Jonas Raoni Soares Silva (http://www.jsfromhell.com)
    // +   improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
    // +   improved by: Sakimori
    // *     example 1: wordwrap('Kevin van Zonneveld', 6, '|', true);
    // *     returns 1: 'Kevin |van |Zonnev|eld'
    // *     example 2: wordwrap('The quick brown fox jumped over the lazy dog.', 20, '<br />\n');
    // *     returns 2: 'The quick brown fox <br />\njumped over the lazy<br />\n dog.'
    // *     example 3: wordwrap('Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.');
    // *     returns 3: 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod \ntempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim \nveniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea \ncommodo consequat.'

    // PHP Defaults
    var m = ((arguments.length >= 2) ? arguments[1] : 75   );
    var b = ((arguments.length >= 3) ? arguments[2] : "\n" );
    var c = ((arguments.length >= 4) ? arguments[3] : false);

    var i, j, l, s, r;

    str += '';

    if (m < 1) {
        return str;
    }

    for (i = -1, l = (r = str.split("\n")).length; ++i < l; r[i] += s) {
        for(s = r[i], r[i] = ""; s.length > m; r[i] += s.slice(0, j) + ((s = s.slice(j)).length ? b : "")){
            j = c == 2 || (j = s.slice(0, m + 1).match(/\S*(\s)?$/))[1] ? m : j.input.length - j[0].length || c == 1 && m || j.input.length + (j = s.slice(m).match(/^\S*/)).input.length;
        }
    }

    return r.join("\n");
}


function replacez(string,text,by) {
    // Replaces text with by in string
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return string;

    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;
    if (i == -1) return string;

    var newstr = string.substring(0,i) + by;

    if (i+txtLength < strLength)
        newstr += replacez(string.substring(i+txtLength,strLength),text,by);

    return newstr;
}

function vote(siteID, thissite_name)
{
    var voteurl = "vote?site=" + siteID + "&site_name=" + escape(thissite_name);
    //var vote_window = window.open(voteurl, "vote", "width=550,height=200,scrollbars=yes,resizable=yes,");
    //vote_window.focus();
    var newdiv_id = 'vote_' + siteID;
    var newdiv_position = 'absolute';
    var newdiv_zIndex = 1000;
    //var newdiv_width = 650;
    var newdiv_height = 350;
    var vote_link_id = "vote_link_" + siteID;
    var vote_link = document.getElementById(vote_link_id);
    var newdiv_left = 100;
    var screen_width = screen.width;
    var newdiv_width = screen_width - 200;
    var ScrollTop = document.body.scrollTop;
    var newdiv_top = ScrollTop + 60;
    var makedraggable = 'yes';
    var newdiv_innerHTML = '<div style="background-color:#444444;padding:2px;"><div style="text-align:right;">[<acronym title="close this window"><a onclick="remove_element_by_id(' + "'" + newdiv_id + "'" + ')" style="cursor:pointer;">x</a></acronym>]</div><div style="text-align:center;">Vote for ' + thissite_name + '</div><iframe FRAMEBORDER=0 src="' + voteurl + '" style="width:' + newdiv_width + 'px;height:' + (newdiv_height - 60) + 'px;"></iframe></div>';
    pop_div(newdiv_id,newdiv_position,newdiv_zIndex,newdiv_width,newdiv_height,newdiv_innerHTML,newdiv_top,newdiv_left);
}



function remove_element_by_id(element_id)
{
    var oldelem = document.getElementById(element_id);
    oldelem.innerHTML = '';
    document.body.removeChild(oldelem);
}



function pop_div(newdiv_id,newdiv_position,newdiv_zIndex,newdiv_width,newdiv_height,newdiv_innerHTML,newdiv_top,newdiv_left,makedraggable)
{
    var newdiv = document.createElement("div");
    newdiv.setAttribute("id",newdiv_id);
    document.body.appendChild(newdiv);
    newdiv.style.position = newdiv_position;
    newdiv.style.zIndex = newdiv_zIndex;
    if(newdiv_width!='none')
    {
        newdiv.style.width = newdiv_width + "px";
    }
    if(newdiv_height!='none')
    {
        newdiv.style.height = newdiv_height + "px";
    }
    newdiv.innerHTML = newdiv_innerHTML;
    newdiv.style.top = newdiv_top + "px";
    newdiv.style.left = newdiv_left + "px";
}









function add_starting_point(siteID)
{
    var sp_URL = document.getElementById("sp_URL").value;
    var sp_levels_to_go = document.getElementById("sp_levels_to_go").value;
    var sp_containing_folder = document.getElementById("sp_containing_folder").value;
    var urlz = "xmlpostsp?site=" + siteID + "&sU=" + escape(sp_URL) + "&sl=" + escape(sp_levels_to_go) + "&sc=" + escape(sp_containing_folder);
    loadXMLDocsp(urlz);
}
function processReqChangesp()
{
    if (reqsp.readyState == 4)
    {
        if (reqsp.status == 200)
        {
            var response = reqsp.responseXML.documentElement;
            var result = response.getElementsByTagName("result")[0].firstChild.data;
            var site = response.getElementsByTagName("site")[0].firstChild.data;
            var userID = response.getElementsByTagName("userID")[0].firstChild.data;
            var moderator_level = response.getElementsByTagName("moderator_level")[0].firstChild.data;
            if(result=='ok')
            {
                showstartingpoints(site,'last',userID,moderator_level,'time',0);
            }
            else if(result=='login')
            {
                var loginmessage = 'please login to add a crawling starting point';
                alert(loginmessage);
            }
            else if(result=='error')
            {
                var loginmessage = 'problems reaching database, please try reloading the page';
                alert(loginmessage);
            }
            else if(result=='tooshort')
            {
                var loginmessage = 'this URL is too short';
                alert(loginmessage);
            }
            else if(result=='ctooshort')
            {
                var loginmessage = 'this containing folder is too short';
                alert(loginmessage);
            }
            else if(result=='exists')
            {
                var loginmessage = 'we already have this URL';
                alert(loginmessage);
            }
        }
        else
        {
            alert("There was a problem retrieving the XML data:\n" + reqsp.statusText);
        }
    }
}

var global_userID = 0;
var global_moderator_level = 0;
function showstartingpoints(site,page,userID,moderator_level,order,shownuserID)
{
    global_userID = userID;
    global_moderator_level = moderator_level;
    var urlz = "xmlsp?site=" + site + "&page=" + page + "&order=" + order + "&shownuserID=" + shownuserID;
    loadXMLDocssp(urlz);
}
//read crawling start points from xml
function processReqChangessp()
{
    if (reqssp.readyState == 4)
    {
        if (reqssp.status == 200)
        {
            var result_string = "";
            var response = reqssp.responseXML.documentElement;
            var result = response.getElementsByTagName("result")[0].firstChild.data;
            if(result == "ok")
            {
                var pagination_string = '';
                var totallinks = response.getElementsByTagName("totallinks")[0].firstChild.data;
                var totalpages = response.getElementsByTagName("totalpages")[0].firstChild.data;
                var thispage = response.getElementsByTagName("thispage")[0].firstChild.data;
                var siteID = response.getElementsByTagName("site")[0].firstChild.data;
                var order = response.getElementsByTagName("order")[0].firstChild.data;
                var shownuserID = response.getElementsByTagName("shownuserID")[0].firstChild.data;

                if(totallinks==0)
                {
                    result_string = result_string + 'empty<br />';
                    if(shownuserID!=0)
                    {
                        document.getElementById('userpageblankor').innerHTML = '';
                    }
                }

                totalpages = Math.abs(totalpages);
                if(totalpages > 1)
                {
                    var previouspage = Math.abs(thispage)-1;
                    var nextpage = Math.abs(thispage)+1;
                    if(thispage>1)
                    {
                        var previouspagebutton = '<a onclick="showstartingpoints(' + siteID + ', ' + previouspage + ', ' + "'" + global_userID + "'" + ', ' + global_moderator_level + ', ' + "'" + order + "'" + ', ' + shownuserID + ')" style="cursor:pointer;">previous</a> | ';
                    }
                    else
                    {
                        var previouspagebutton = '';
                    }
                    if(thispage<totalpages)
                    {
                        var nextpagebutton = ' | <a onclick="showstartingpoints(' + siteID + ', ' + nextpage + ', ' + "'" + global_userID + "'" + ', ' + global_moderator_level + ', ' + "'" + order + "'" + ', ' + shownuserID + ')" style="cursor:pointer;">next</a>';
                    }
                    else
                    {
                        var nextpagebutton = '';
                    }
                    pagination_string = '<div class="effect" style="font-size:80%;">' + previouspagebutton + 'page ' + thispage + ' of ' + totalpages + nextpagebutton + '</div>';
                }
                result_string = result_string + pagination_string;
                var count = 0;
                while (count < totallinks)
                {
                    count++;
                    var thiswebpageIDname = "webpageID_" + count;
                    var thisURLname = "URL_" + count;
                    var thislevels_to_goname = "levels_to_go_" + count;
                    var thiscontaining_foldername = "containing_folder_" + count;
                    var thisuserIDname = "userID_" + count;
                    var thistimename = "time_" + count;
                    var thislast_crawl_timename = "last_crawl_time_" + count;
                    var thislast_completed_crawl_timename = "last_completed_crawl_time_" + count;
                    var thiswebpageID = response.getElementsByTagName(thiswebpageIDname)[0].firstChild.data;
                    var thisURL = response.getElementsByTagName(thisURLname)[0].firstChild.data;
                    var thislevels_to_go = response.getElementsByTagName(thislevels_to_goname)[0].firstChild.data;
                    var thiscontaining_folder = response.getElementsByTagName(thiscontaining_foldername)[0].firstChild.data;
                    var thisuserID = response.getElementsByTagName(thisuserIDname)[0].firstChild.data;
                    var this_publicname_name = "public_name_" + thisuserID;
                    var this_publicname = response.getElementsByTagName(this_publicname_name)[0].firstChild.data;
                    var thistime = response.getElementsByTagName(thistimename)[0].firstChild.data;
                    var thislast_crawl_time = response.getElementsByTagName(thislast_crawl_timename)[0].firstChild.data;
                    var thislast_completed_crawl_time = response.getElementsByTagName(thislast_completed_crawl_timename)[0].firstChild.data;
                    if(thisuserID==global_userID || global_moderator_level>0)
                    {
                        var deletebutton = ' <a onclick="erase_sp(' + thiswebpageID + ', ' + siteID + ', ' + thispage + ', ' + global_userID + ', ' + global_moderator_level + ', ' + "'" + escape(this_publicname) + "'" + ', ' + "'" + order + "'" + ', ' + shownuserID + ')" style="cursor:pointer;color:red;">X</a>';
                    }
                    else
                    {
                        var deletebutton = '';
                    }
                    var showurl = 'URL: <a href="' + thisURL + '" target="_blank">' + thisURL + '</a>';
                    var showlevelstogo = thislevels_to_go + ' levels to go';
                    var showcontainingfolder = 'containing folder: ' + thiscontaining_folder;
                    if(siteID==0)
                    {
                        var thissiteIDname = "siteID_" + count;
                        var thissite_namename = "site_name_" + count;
                        var thissiteID = response.getElementsByTagName(thissiteIDname)[0].firstChild.data;
                        var thissite_name = response.getElementsByTagName(thissite_namename)[0].firstChild.data;
                        var dapage = '<a href="details?site=' + thissiteID + '">' + thissite_name + '</a>';
                        var onpagestring = ' on page ' + dapage;
                    }
                    else
                    {
                        var onpagestring = '';
                    }
                    if(this_publicname=='nabocode_is_deleted_user_is_nabocode')
                    {
                        var userlink = 'deleted user';
                    }
                    else
                    {
                        var userlink = '<a href="userpage?u=' + thisuserID + '">' + this_publicname + '</a>';
                    }
                    var postedbystring = 'posted by ' + userlink + onpagestring;
                    var timezstringus = '<div style="font-size:80%;">added on ' + maketimus(thistime) + ', last crawl attempt on ' + maketimus(thislast_crawl_time) + ', last successful crawl on ' + maketimus(thislast_completed_crawl_time) + '</div>';
                    var thisdatarow = showurl + deletebutton + '<br />' + showlevelstogo + '<br />' + showcontainingfolder + "<br />" + postedbystring + timezstringus;
                    result_string = result_string + "<p>" + thisdatarow + "</p>";
                }
                result_string = result_string + pagination_string;
            }
            else
            {
                result_string = 'error connecting to database';
            }
            document.getElementById('crstpo').innerHTML = result_string;
        }
        else
        {
            alert("There was a problem retrieving the XML data:\n" + reqssp.statusText);
        }
    }
}







function shownspages_to_search(site,page,userID,moderator_level,order,shownuserID)
{
    global_userID = userID;
    global_moderator_level = moderator_level;
    var urlz = "xmlshownspages_to_search?site=" + site + "&page=" + page + "&order=" + order + "&shownuserID=" + shownuserID;
    loadXMLDocshownspages_to_search(urlz);
}
//read pages_to_search from xml
function processReqChangeshownspages_to_search()
{
    if (reqshownspages_to_search.readyState == 4)
    {
        if (reqshownspages_to_search.status == 200)
        {
            var result_string = "";
            var response = reqshownspages_to_search.responseXML.documentElement;
            var result = response.getElementsByTagName("result")[0].firstChild.data;
            if(result == "ok")
            {
                var pagination_string = '';
                var totallinks = response.getElementsByTagName("totallinks")[0].firstChild.data;
                var totalpages = response.getElementsByTagName("totalpages")[0].firstChild.data;
                var thispage = response.getElementsByTagName("thispage")[0].firstChild.data;
                var siteID = response.getElementsByTagName("site")[0].firstChild.data;
                var order = response.getElementsByTagName("order")[0].firstChild.data;
                var shownuserID = response.getElementsByTagName("shownuserID")[0].firstChild.data;

                if(totallinks==0)
                {
                    result_string = result_string + 'empty<br />';
                    if(shownuserID!=0)
                    {
                        document.getElementById('userpageblankor').innerHTML = '';
                    }
                }

                totalpages = Math.abs(totalpages);
                if(totalpages > 1)
                {
                    var previouspage = Math.abs(thispage)-1;
                    var nextpage = Math.abs(thispage)+1;
                    if(thispage>1)
                    {
                        var previouspagebutton = '<a onclick="shownspages_to_search(' + siteID + ', ' + previouspage + ', ' + "'" + global_userID + "'" + ', ' + global_moderator_level + ', ' + "'" + order + "'" + ', ' + shownuserID + ')" style="cursor:pointer;">previous</a> | ';
                    }
                    else
                    {
                        var previouspagebutton = '';
                    }
                    if(thispage<totalpages)
                    {
                        var nextpagebutton = ' | <a onclick="shownspages_to_search(' + siteID + ', ' + nextpage + ', ' + "'" + global_userID + "'" + ', ' + global_moderator_level + ', ' + "'" + order + "'" + ', ' + shownuserID + ')" style="cursor:pointer;">next</a>';
                    }
                    else
                    {
                        var nextpagebutton = '';
                    }
                    pagination_string = '<div class="effect" style="font-size:80%;">' + previouspagebutton + 'page ' + thispage + ' of ' + totalpages + nextpagebutton + '</div>';
                }
                result_string = result_string + pagination_string;
                var count = 0;
                while (count < totallinks)
                {
                    count++;
                    var thispage_numbername = "page_number_" + count;
                    var thispages_to_searchIDname = "pages_to_searchID_" + count;
                    var thisurlname = "url_" + count;
                    var thismovieIDname = "movieID_" + count;
                    var thisscannername = "scanner_" + count;
                    var thisuserIDname = "userID_" + count;
                    var thistimename = "time_" + count;
                    var thisflagname = "flag_" + count;
                    var thissiteIDname = "movieID_" + count;
                    var thispage_number = response.getElementsByTagName(thispage_numbername)[0].firstChild.data;
                    var thispages_to_searchID = response.getElementsByTagName(thispages_to_searchIDname)[0].firstChild.data;
                    var thisurl = response.getElementsByTagName(thisurlname)[0].firstChild.data;
                    var thismovieID = response.getElementsByTagName(thismovieIDname)[0].firstChild.data;
                    var thisscanner = response.getElementsByTagName(thisscannername)[0].firstChild.data;
                    var thisuserID = response.getElementsByTagName(thisuserIDname)[0].firstChild.data;
                    var this_publicname_name = "public_name_" + thisuserID;
                    var this_publicname = response.getElementsByTagName(this_publicname_name)[0].firstChild.data;
                    var thistime = response.getElementsByTagName(thistimename)[0].firstChild.data;
                    var thisflag = response.getElementsByTagName(thisflagname)[0].firstChild.data;
                    var thissiteID = response.getElementsByTagName(thissiteIDname)[0].firstChild.data;
                    if(thisuserID==global_userID || global_moderator_level>0)
                    {
                        var deletebutton = ' <a onclick="erase_page_to_search(' + thispages_to_searchID + ', ' + siteID + ', ' + thispage + ', ' + global_userID + ', ' + global_moderator_level + ', ' + "'" + escape(this_publicname) + "'" + ', ' + "'" + order + "'" + ', ' + shownuserID + ')" style="cursor:pointer;color:red;">X</a>';
                        var scannowlink = ' (<a href="nabosearch?siteID=' + thissiteID + '&page=' + thispage_number + '" target="_blank">scan now</a>)';
                    }
                    else
                    {
                        var deletebutton = '';
                        var scannowlink = '';
                    }

                    var maxURLlen=240;
                    var lenofthisurl = thisurl.length;
                    if(lenofthisurl > maxURLlen)
                    {
                        var firsthalf = thisurl.substring(0,Math.floor(lenofthisurl/2));
                        var secondhalf = thisurl.substring(Math.floor(lenofthisurl/2));
                        if(firsthalf.length > maxURLlen/2)
                        {
                            firsthalf = firsthalf.substring(0,maxURLlen/2);
                        }
                        if(secondhalf.length > maxURLlen/2)
                        {
                            secondhalf = secondhalf.substring(secondhalf.length-maxURLlen/2);
                        }
                        var showurl = '<acronym title="' + thisurl + '">' + firsthalf + "..." + secondhalf + "</acronym>";
                    }
                    else
                    {
                        var showurl = thisurl;
                    }
                    var showurl = 'URL: <a href="' + thisurl + '" target="_blank">' + showurl + '</a>';
                    var showscanner = 'scanner: <b>' + thisscanner + '</b>';
                    var showflag = 'flag: <b>' + thisflag + '</b>';
                    if(siteID==0)
                    {
                        var thissite_namename = "site_name_" + count;
                        var thissite_name = response.getElementsByTagName(thissite_namename)[0].firstChild.data;
                        var dapage = '<a href="details?site=' + thissiteID + '">' + thissite_name + '</a>';
                        var onpagestring = ' on page ' + dapage;
                    }
                    else
                    {
                        var onpagestring = '';
                    }
                    if(this_publicname=='nabocode_is_deleted_user_is_nabocode')
                    {
                        var userlink = 'system';
                    }
                    else
                    {
                        var userlink = '<a href="userpage?u=' + thisuserID + '">' + this_publicname + '</a>';
                    }
                    var postedbystring = 'posted by ' + userlink + onpagestring;
                    var timezstringus = ' added on ' + maketimus(thistime);
                    var thisdatarow = showurl + deletebutton + ' ' + showscanner + ' ' + showflag + " " + postedbystring + timezstringus + scannowlink;
                    result_string = result_string + "<div>" + thisdatarow + "</div>";
                }
                result_string = result_string + pagination_string;
            }
            else
            {
                result_string = 'error connecting to database';
            }
            document.getElementById('crstpo2').innerHTML = result_string;
        }
        else
        {
            alert("There was a problem retrieving the XML data:\n" + reqshownspages_to_search.statusText);
        }
    }
}




















function showwebpages(site,page,order)
{
    var urlz = "xmlwp?site=" + site + "&page=" + page + "&order=" + order;
    loadXMLDocwp(urlz);
}
//read indexed webpages from xml
function processReqChangewp()
{
    if (reqwp.readyState == 4)
    {
        if (reqwp.status == 200)
        {
            var result_string = "";
            var response = reqwp.responseXML.documentElement;
            var result = response.getElementsByTagName("result")[0].firstChild.data;
            if(result == "ok")
            {
                var pagination_string = '';
                var totallinks = response.getElementsByTagName("totallinks")[0].firstChild.data;
                var totalpages = response.getElementsByTagName("totalpages")[0].firstChild.data;
                var thispage = response.getElementsByTagName("thispage")[0].firstChild.data;
                var siteID = response.getElementsByTagName("site")[0].firstChild.data;
                var order = response.getElementsByTagName("order")[0].firstChild.data;

                //order by:
                var orderbytimelink = ' -<a style="cursor:pointer" onclick="showwebpages(' + siteID + ',1,' + "'time'" + ')">oldest</a>';
                var orderbytimerevlink = ' -<a style="cursor:pointer" onclick="showwebpages(' + siteID + ',1,' + "'time_DESC'" + ')">most recent</a>';
                var orderbylast_crawl_timelink = ' -<a style="cursor:pointer" onclick="showwebpages(' + siteID + ',1,' + "'last_crawl_time'" + ')">oldest crawl attempt</a>';
                var orderbylast_crawl_timerevlink = ' -<a style="cursor:pointer" onclick="showwebpages(' + siteID + ',1,' + "'last_crawl_time_DESC'" + ')">latest crawl attempt</a>';
                var orderbylast_completed_crawl_timelink = ' -<a style="cursor:pointer" onclick="showwebpages(' + siteID + ',1,' + "'last_completed_crawl_time'" + ')">oldest successful crawl</a>';
                var orderbylast_completed_crawl_timerevlink = ' -<a style="cursor:pointer" onclick="showwebpages(' + siteID + ',1,' + "'last_completed_crawl_time_DESC'" + ')">latest successful crawl</a>';
                var reorderstring = orderbytimelink + orderbytimerevlink + orderbylast_crawl_timelink + orderbylast_crawl_timerevlink + orderbylast_completed_crawl_timelink + orderbylast_completed_crawl_timerevlink;
                if(order=='time')
                {
                    var orderedby = 'oldest';
                }
                else if(order=='time_DESC')
                {
                    var orderedby = 'most recent';
                }
                else if(order=='last_crawl_time')
                {
                    var orderedby = 'oldest crawl attempt';
                }
                else if(order=='last_crawl_time_DESC')
                {
                    var orderedby = 'latest crawl attempt';
                }
                else if(order=='last_completed_crawl_time')
                {
                    var orderedby = 'oldest successful crawl';
                }
                else if(order=='last_completed_crawl_time_DESC')
                {
                    var orderedby = 'latest successful crawl';
                }
                var orderstring = '<div class="effect" style="font-size:80%;">currently ordered by: ' + orderedby + '<br /> re-order by: ' + reorderstring + '</div>';
                if(totallinks==0)
                {
                    result_string = result_string + 'empty<br />';
                }
                else
                {
                    result_string = result_string + orderstring;
                }

                totalpages = Math.abs(totalpages);
                if(totalpages > 1)
                {
                    var minus100page = Math.abs(thispage)-100;
                    var minus10page = Math.abs(thispage)-10;
                    var previouspage = Math.abs(thispage)-1;
                    var nextpage = Math.abs(thispage)+1;
                    var plus10page = Math.abs(thispage)+10;
                    var plus100page = Math.abs(thispage)+100;

                    var minus100pagebutton = '';
                    var minus10pagebutton = '';
                    var previouspagebutton = '';
                    var nextpagebutton = '';
                    var plus10pagebutton = '';
                    var plus100pagebutton = '';

                    if(thispage>100)
                    {
                        minus100pagebutton = '<a onclick="showwebpages(' + siteID + ', ' + minus100page + ', ' + "'" + order + "'" + ')" style="cursor:pointer;">-100</a> | ';
                    }
                    if(thispage>10)
                    {
                        minus10pagebutton = '<a onclick="showwebpages(' + siteID + ', ' + minus10page + ', ' + "'" + order + "'" + ')" style="cursor:pointer;">-10</a> | ';
                    }
                    if(thispage>1)
                    {
                        previouspagebutton = '<a onclick="showwebpages(' + siteID + ', ' + previouspage + ', ' + "'" + order + "'" + ')" style="cursor:pointer;">previous</a> | ';
                    }
                    if(thispage<totalpages)
                    {
                        nextpagebutton = ' | <a onclick="showwebpages(' + siteID + ', ' + nextpage + ', ' + "'" + order + "'" + ')" style="cursor:pointer;">next</a>';
                    }
                    if(thispage<(totalpages-10))
                    {
                        plus10pagebutton = ' | <a onclick="showwebpages(' + siteID + ', ' + plus10page + ', ' + "'" + order + "'" + ')" style="cursor:pointer;">+10</a>';
                    }
                    if(thispage<(totalpages-100))
                    {
                        plus100pagebutton = ' | <a onclick="showwebpages(' + siteID + ', ' + plus100page + ', ' + "'" + order + "'" + ')" style="cursor:pointer;">+100</a>';
                    }


                    pagination_string = '<div class="effect" style="font-size:80%;">' + minus100pagebutton + minus10pagebutton + previouspagebutton + 'page ' + thispage + ' of ' + totalpages + nextpagebutton + plus10pagebutton + plus100pagebutton + '</div>';
                }
                result_string = result_string + pagination_string;
                var count = 0;
                while (count < totallinks)
                {
                    count++;
                    var thiswebpageIDname = "webpageID_" + count;
                    var thisURLname = "URL_" + count;
                    var thistitlename = "title_" + count;
                    var thislevels_to_goname = "levels_to_go_" + count;
                    var thisuseraddedname = "useradded_" + count;
                    var thistimename = "time_" + count;
                    var thislast_crawl_timename = "last_crawl_time_" + count;
                    var thislast_completed_crawl_timename = "last_completed_crawl_time_" + count;
                    var thislinking_text_startname = "linking_text_start_" + count;
                    var thiswebpageID = response.getElementsByTagName(thiswebpageIDname)[0].firstChild.data;
                    var thisURL = response.getElementsByTagName(thisURLname)[0].firstChild.data;
                    var thisthistitle = response.getElementsByTagName(thistitlename)[0].firstChild.data;
                    var thislevels_to_go = response.getElementsByTagName(thislevels_to_goname)[0].firstChild.data;
                    var thisthisuseradded = response.getElementsByTagName(thisuseraddedname)[0].firstChild.data;
                    var thistime = response.getElementsByTagName(thistimename)[0].firstChild.data;
                    var thislast_crawl_time = response.getElementsByTagName(thislast_crawl_timename)[0].firstChild.data;
                    var thislast_completed_crawl_time = response.getElementsByTagName(thislast_completed_crawl_timename)[0].firstChild.data;
                    var thislinking_text_start = response.getElementsByTagName(thislinking_text_startname)[0].firstChild.data;
                    var shourl = thisURL;
                    var maxurllen = 50;
                    if(thisURL.length>maxurllen)
                    {
                        shourl = '<acronym title="' + thisURL + '">' + thisURL.substring(0,(maxurllen-2)) + '...</acronym>';
                    }
                    var showurl = '<a href="' + thisURL + '" target="_blank">' + shourl + '</a>';
                    var thistextdivid = "text" + thiswebpageID;
                    if(thislast_completed_crawl_time==0)
                    {
                        var lastcrawltime = '<span style="color:#AAAAAA;">never crawled</span>. ';
                    }
                    else
                    {
                        var lastcrawltime = 'last completed crawl: ' + maketimus(thislast_completed_crawl_time) + ', last crawl attempt: ' + maketimus(thislast_crawl_time) + '. ';
                    }
                    var showstats = '<div style="font-size:80%;">' + lastcrawltime + "added on " + maketimus(thistime) + ". " + thislevels_to_go + " levels to go</div>";
                    var showtext = '<div id="' + thistextdivid + '" style="font-size:70%;"><a onclick="xpand_text(' + thiswebpageID + ')" style="cursor:pointer;">show text</a></div>';
                    var thisdatarow = "<span style='font-weight:bold;'>" + thislinking_text_start + "</span> " + thisthistitle + "<br />" + showurl + "<br />" + showstats + showtext;
                    result_string = result_string + "<div>" + thisdatarow + "</div>";
                }
                result_string = result_string + pagination_string;
            }
            else
            {
                result_string = 'error connecting to database';
            }
            document.getElementById('inpa').innerHTML = result_string;
        }
        else
        {
            alert("There was a problem retrieving the XML data:\n" + reqwp.statusText);
        }
    }
}

function xpand_text(xpandwebpageID)
{
    var urlz = "xmlxpandtext?webpage=" + xpandwebpageID;
    loadXMLDocxpandtext(urlz);
}
//read indexed webpages from xml
function processReqChangexpandtext()
{
    if (reqxpandtext.readyState == 4)
    {
        if (reqxpandtext.status == 200)
        {
            var result_string = "";
            var response = reqxpandtext.responseXML.documentElement;
            var result = response.getElementsByTagName("result")[0].firstChild.data;
            if(result == "ok")
            {
                var thiswebpage = response.getElementsByTagName("webpage")[0].firstChild.data;
                result_string = result_string + "<a onclick='dexpandtext(" + thiswebpage + ")' style='cursor:pointer;'>hide text</a>";
                var thislinking_text = response.getElementsByTagName("linking_text")[0].firstChild.data;
                var thistext = response.getElementsByTagName("text")[0].firstChild.data;
                var thisdatarow = "<span style='font-weight:bold;'>linking text:</span><br />" + thislinking_text + "<br /><span style='font-weight:bold;'>text:</span><br />" + thistext;
                result_string = result_string + "<div>" + thisdatarow + "</div>";
            }
            else
            {
                result_string = 'error connecting to database';
            }
            var xpandtextboxidman = 'text' + thiswebpage;
            document.getElementById(xpandtextboxidman).innerHTML = result_string;
        }
        else
        {
            alert("There was a problem retrieving the XML data:\n" + reqxpandtext.statusText);
        }
    }
}
function dexpandtext(wpID)
{
    var boxidd = 'text' + wpID;
    var initedxmpandlink = '<a onclick="xpand_text(' + wpID + ')" style="cursor:pointer;">show text</a>';
    document.getElementById(boxidd).innerHTML = initedxmpandlink;
}








function shownsresults(site,page,order,alpha)
{
    var urlz = "xmlshownsresults?site=" + site + "&page=" + page + "&order=" + order + "&alpha=" + alpha;
    loadXMLDocshownsresults(urlz);
}
//read search results from xml
function processReqChangeshownsresults()
{
    if (reqshownsresults.readyState == 4)
    {
        if (reqshownsresults.status == 200)
        {
            var result_string = "";
            var response = reqshownsresults.responseXML.documentElement;
            var result = response.getElementsByTagName("result")[0].firstChild.data;
            if(result == "ok")
            {
                var pagination_string = '';
                var totallinks = response.getElementsByTagName("totallinks")[0].firstChild.data;
                var totalpages = response.getElementsByTagName("totalpages")[0].firstChild.data;
                var thispage = response.getElementsByTagName("thispage")[0].firstChild.data;
                var siteID = response.getElementsByTagName("site")[0].firstChild.data;
                var order = response.getElementsByTagName("order")[0].firstChild.data;
                var alpha = response.getElementsByTagName("alpha")[0].firstChild.data;




                //alpha
                var alphanner_string = '-<a style="cursor:pointer" onclick="shownsresults(' + siteID + ',1, ' + "'" + order + "'" + ',' + "'all'" + ')">all</a> -<a style="cursor:pointer" onclick="shownsresults(' + siteID + ',1, ' + "'" + order + "'" + ',' + "'num'" + ')">#</a>';

                var i=0;
                for (i=65;i<=90;i++)
                {
                    var thisletter = String.fromCharCode(i);
                    var alphanner_string = alphanner_string + ' -<a style="cursor:pointer" onclick="shownsresults(' + siteID + ',1, ' + "'" + order + "'" + ',' + "'" + thisletter + "'" + ')">' + thisletter + '</a>';
                }


                if(alpha=='num')
                {
                    var alphaded = '#';
                }
                else
                {
                    var alphaded = alpha;
                }

                var alphastring = '<div class="effect" style="font-size:80%;">currently showing links starting with: ' + alphaded + '<br /> show links starting with: ' + alphanner_string + '</div>';


                result_string = result_string + alphastring;

                //order by:
                var orderbytimelink = ' -<a style="cursor:pointer" onclick="shownsresults(' + siteID + ',1,' + "'time'" + ',' + "'" + alpha + "'" + ')">oldest</a>';
                var orderbytimerevlink = ' -<a style="cursor:pointer" onclick="shownsresults(' + siteID + ',1,' + "'time_DESC'" + ',' + "'" + alpha + "'" + ')">most recent</a>';
                var orderbytextlink = ' -<a style="cursor:pointer" onclick="shownsresults(' + siteID + ',1,' + "'text'" + ',' + "'" + alpha + "'" + ')">alphabetical order</a>';
                var orderbytextrevlink = ' -<a style="cursor:pointer" onclick="shownsresults(' + siteID + ',1,' + "'text_DESC'" + ',' + "'" + alpha + "'" + ')">reverse alphabetical order</a>';
                var reorderstring = orderbytimelink + orderbytimerevlink + orderbytextlink + orderbytextrevlink;
                if(order=='time')
                {
                    var orderedby = 'oldest';
                }
                else if(order=='time_DESC')
                {
                    var orderedby = 'most recent';
                }
                else if(order=='text')
                {
                    var orderedby = 'alphabetical order';
                }
                else if(order=='text_DESC')
                {
                    var orderedby = 'reverse alphabetical order';
                }
                var orderstring = '<div class="effect" style="font-size:80%;">currently ordered by: ' + orderedby + '<br /> re-order by: ' + reorderstring + '</div>';



                if(totallinks==0)
                {
                    result_string = result_string + 'empty<br />';
                }
                else
                {
                    result_string = result_string + orderstring;
                }

                totalpages = Math.abs(totalpages);
                if(totalpages > 1)
                {



                    var minus100page = Math.abs(thispage)-100;
                    var minus10page = Math.abs(thispage)-10;
                    var previouspage = Math.abs(thispage)-1;
                    var nextpage = Math.abs(thispage)+1;
                    var plus10page = Math.abs(thispage)+10;
                    var plus100page = Math.abs(thispage)+100;

                    var minus100pagebutton = '';
                    var minus10pagebutton = '';
                    var previouspagebutton = '';
                    var nextpagebutton = '';
                    var plus10pagebutton = '';
                    var plus100pagebutton = '';

                    if(thispage>100)
                    {
                        minus100pagebutton = '<a onclick="shownsresults(' + siteID + ', ' + minus100page + ', ' + "'" + order + "'" + ',' + "'" + alpha + "'" + ')" style="cursor:pointer;">-100</a> | ';
                    }
                    if(thispage>10)
                    {
                        minus10pagebutton = '<a onclick="shownsresults(' + siteID + ', ' + minus10page + ', ' + "'" + order + "'" + ',' + "'" + alpha + "'" + ')" style="cursor:pointer;">-10</a> | ';
                    }
                    if(thispage>1)
                    {
                        previouspagebutton = '<a onclick="shownsresults(' + siteID + ', ' + previouspage + ', ' + "'" + order + "'" + ',' + "'" + alpha + "'" + ')" style="cursor:pointer;">previous</a> | ';
                    }
                    if(thispage<totalpages)
                    {
                        nextpagebutton = ' | <a onclick="shownsresults(' + siteID + ', ' + nextpage + ', ' + "'" + order + "'" + ',' + "'" + alpha + "'" + ')" style="cursor:pointer;">next</a>';
                    }
                    if(thispage<(totalpages-10))
                    {
                        plus10pagebutton = ' | <a onclick="shownsresults(' + siteID + ', ' + plus10page + ', ' + "'" + order + "'" + ',' + "'" + alpha + "'" + ')" style="cursor:pointer;">+10</a>';
                    }
                    if(thispage<(totalpages-100))
                    {
                        plus100pagebutton = ' | <a onclick="shownsresults(' + siteID + ', ' + plus100page + ', ' + "'" + order + "'" + ',' + "'" + alpha + "'" + ')" style="cursor:pointer;">+100</a>';
                    }


                    pagination_string = '<div class="effect" style="font-size:80%;">' + minus100pagebutton + minus10pagebutton + previouspagebutton + 'page ' + thispage + ' of ' + totalpages + nextpagebutton + plus10pagebutton + plus100pagebutton + '</div>';
                }
                result_string = result_string + pagination_string;
                var count = 0;
                while (count < totallinks)
                {
                    count++;
                    var thisresultIDname = "resultID_" + count;
                    var thistextname = "text_" + count;
                    var thisurlname = "url_" + count;
                    var thisdomainname = "domain_" + count;
                    var thislasttimename = "lasttime_" + count;
                    var thisresultID = response.getElementsByTagName(thisresultIDname)[0].firstChild.data;
                    var thistext = response.getElementsByTagName(thistextname)[0].firstChild.data;
                    var thisurl = response.getElementsByTagName(thisurlname)[0].firstChild.data;
                    var thisdomain = response.getElementsByTagName(thisdomainname)[0].firstChild.data;
                    var thislasttime = response.getElementsByTagName(thislasttimename)[0].firstChild.data;
                    var showurl = '<a href="' + thisurl + '" target="_blank">' + thistext + '</a>';
                    var showtime = maketimus(thislasttime);
                    var thisdatarow = showurl + " (" + showtime + ")<br />";
                    result_string = result_string + "<div>" + thisdatarow + "</div>";
                }
                result_string = result_string + pagination_string;
            }
            else
            {
                result_string = 'error connecting to database';
            }
            document.getElementById('inpa2').innerHTML = result_string;
        }
        else
        {
            alert("There was a problem retrieving the XML data:\n" + reqshownsresults.statusText);
        }
    }
}











var global_userID = 0;
var global_moderator_level = 0;
function shochat(section, subsection, poster_userID, order, page, visitor_userID, moderator_level)
{
    global_userID = visitor_userID;
    global_moderator_level = moderator_level;
    var urlz = "xmlchat?section=" + section + "&subsection=" + subsection + "&userID=" + poster_userID + "&order=" + order + "&page=" + page;
    loadXMLDocttyuse4(urlz);
}
function erase_post(droppi, section, subsection, userID, order, page, poster, visitor_userID, moderator_level)
{
    global_userID = visitor_userID;
    global_moderator_level = moderator_level;
    var urlz = "xmlerase_post?droppi=" + droppi + "&section=" + section + "&subsection=" + subsection + "&userID=" + userID + "&order=" + order + "&page=" + page;
    var eraseconfmessage = 'are you sure you want to erase this post from: ' + poster;
    var r=confirm(eraseconfmessage);
    if(r==true)
    {
        loadXMLDoc56m243cxsd(urlz);
    }
}



//read chitchat from xml and shit it out!
function processReqChangettyuse4()
{
    if (reqttyuse4.readyState == 4)
    {
        if (reqttyuse4.status == 200)
        {
            var result_string = "<h4>comments:</h4>";
            var response = reqttyuse4.responseXML.documentElement;
            var result = response.getElementsByTagName("result")[0].firstChild.data;
            if(result == "ok")
            {
                var pagination_string = '';
                var totalboxes = response.getElementsByTagName("totalboxes")[0].firstChild.data;
                var totalpages = response.getElementsByTagName("totalpages")[0].firstChild.data;
                var thispage = response.getElementsByTagName("thispage")[0].firstChild.data;
                var section = response.getElementsByTagName("section")[0].firstChild.data;
                var subsection = response.getElementsByTagName("subsection")[0].firstChild.data;
                var userID = response.getElementsByTagName("userID")[0].firstChild.data;
                var order = response.getElementsByTagName("order")[0].firstChild.data;
                var orderbytimelink = ' -<a style="cursor:pointer" onclick="shochat(' + "'" + section + "'" + ', ' + "'" + subsection + "'" + ', ' + userID + ', ' + "'posting_time'" + ', 1, ' + global_userID + ', ' + global_moderator_level + ')">oldest</a>';
                var orderbytimerevlink = ' -<a style="cursor:pointer" onclick="shochat(' + "'" + section + "'" + ', ' + "'" + subsection + "'" + ', ' + userID + ', ' + "'posting_time_DESC'" + ', 1, ' + global_userID + ', ' + global_moderator_level + ')">most recent</a>';
                var orderbyratinglink = ' -<a style="cursor:pointer" onclick="shochat(' + "'" + section + "'" + ', ' + "'" + subsection + "'" + ', ' + userID + ', ' + "'rating'" + ', 1, ' + global_userID + ', ' + global_moderator_level + ')">best rating</a>';
                var orderbyratingrevlink = ' -<a style="cursor:pointer" onclick="shochat(' + "'" + section + "'" + ', ' + "'" + subsection + "'" + ', ' + userID + ', ' + "'rating_DESC'" + ', 1, ' + global_userID + ', ' + global_moderator_level + ')">worst rating</a>';
                var reorderstring = orderbytimelink + orderbytimerevlink + orderbyratinglink + orderbyratingrevlink;
                if(order=='posting_time')
                {
                    var orderedby = 'oldest';
                }
                else if(order=='posting_time_DESC')
                {
                    var orderedby = 'most recent';
                }
                else if(order=='rating')
                {
                    var orderedby = 'best rating';
                }
                else if(order=='rating_DESC')
                {
                    var orderedby = 'worst rating';
                }
                var orderstring = '<div class="effect" style="font-size:80%;">currently ordered by: ' + orderedby + '<br /> re-order by: ' + reorderstring + '</div>';
                if(totalboxes==0)
                {
                    result_string = result_string + 'no comments posted yet. be the first to comment. use the box below to write a comment:<br /><br />';
                }
                else
                {
                    result_string = result_string + orderstring;
                }
                totalpages = Math.abs(totalpages);
                if(totalpages > 1)
                {
                    var previouspage = Math.abs(thispage)-1;
                    var nextpage = Math.abs(thispage)+1;
                    if(thispage>1)
                    {
                        var previouspagebutton = '<a onclick="shochat(' + "'" + section + "'" + ', ' + "'" + subsection + "'" + ', ' + userID + ', ' + "'" + order + "'" + ', ' + previouspage + ', ' + global_userID + ', ' + global_moderator_level + ')" style="cursor:pointer;">previous</a> | ';
                    }
                    else
                    {
                        var previouspagebutton = '';
                    }
                    if(thispage<totalpages)
                    {
                        var nextpagebutton = ' | <a onclick="shochat(' + "'" + section + "'" + ', ' + "'" + subsection + "'" + ', ' + userID + ', ' + "'" + order + "'" + ', ' + nextpage + ', ' + global_userID + ', ' + global_moderator_level + ')" style="cursor:pointer;">next</a>';
                    }
                    else
                    {
                        var nextpagebutton = '';
                    }
                    pagination_string = '<div class="effect" style="font-size:80%;">' + previouspagebutton + 'page ' + thispage + ' of ' + totalpages + nextpagebutton + '</div>';
                }
                result_string = result_string + pagination_string;
                var count = 0;
                while (count < totalboxes)
                {
                    count++;
                    var thispostIDname = "postID_" + count;
                    var thissectionname = "section_" + count;
                    var thissubsectionname = "subsection_" + count;
                    var thisuserIDname = "userID_" + count;
                    var thisposting_timename = "posting_time_" + count;
                    var thisratingname = "rating_" + count;
                    var thisvotesname = "votes_" + count;
                    var thispostname = "post_" + count;
                    var thispostID = response.getElementsByTagName(thispostIDname)[0].firstChild.data;
                    var thissection = response.getElementsByTagName(thissectionname)[0].firstChild.data;
                    var thissubsection = response.getElementsByTagName(thissubsectionname)[0].firstChild.data;
                    var thisuserID = response.getElementsByTagName(thisuserIDname)[0].firstChild.data;
                    var thisposting_time = response.getElementsByTagName(thisposting_timename)[0].firstChild.data;
                    var thisrating = response.getElementsByTagName(thisratingname)[0].firstChild.data;
                    var thisvotes = response.getElementsByTagName(thisvotesname)[0].firstChild.data;
                    var thispost = response.getElementsByTagName(thispostname)[0].firstChild.data;
                    if(thisuserID==0)
                    {
                        var posterlink = 'a guest';
                        var usernameforbuttons = 'a guest';
                    }
                    else
                    {
                        var thispublicnamename = "public_name_" + thisuserID;
                        var thispublicname = response.getElementsByTagName(thispublicnamename)[0].firstChild.data;
                        var posterlink = "<a href='userpage?u=" + thisuserID + "'>" + thispublicname + "</a> ";
                        var usernameforbuttons = thispublicname;
                    }
                    if((thisuserID==global_userID && thisuserID!=0) || global_moderator_level>0)
                    {
                        var deletebutton = '<a onclick="erase_post(' + thispostID + ",'" + section + "'" + ', ' + "'" + subsection + "'" + ', ' + userID + ', ' + "'" + order + "'" + ', ' + thispage + ', ' + "'" + usernameforbuttons + "'" + ', ' + global_userID + ', ' + global_moderator_level + ')" style="cursor:pointer;color:red;">X</a>';
                    }
                    else
                    {
                        var deletebutton = '';
                    }
                    var thisdatarow = "<span style='background-color:#1A1A1A;font-size:110%;'>" + thispost + "</span> by " + posterlink + " " + maketimus(thisposting_time) + " <span id='postvotesstring" + thispostID + "'>" + makevotesstring(thisrating, thisvotes, thispostID, 'post') + "</span>  " + deletebutton;
                    result_string = result_string + "<hr />" + thisdatarow;
                }
                result_string = result_string + pagination_string;
                if(global_userID==0)
                {
                    var randomnumber=Math.floor(Math.random()*100001)
                    var imagever = '<br /><input type="hidden" id="random" value="' + randomnumber + '" /><img src="image_verification?name=' + randomnumber + '" style="vertical-align:text-bottom;" /> -> retype this number -> <input type="text" id="numba" />';
                }
                else
                {
                    var imagever = '<input type="hidden" id="random" value="0" /><input type="hidden" id="numba" value="0" />';
                }
                var adsrc = "squaread?ad=2";
                var onloader = ' onload="rotatad(' + "'" + 'squaro' + "'" + ')"';
                if(safeforgoogle=="yes")
                {
                    adsrc = "squaread?ad=1";
                    var onloader = "";
                }
                var joyous_ad = '<IFRAME FRAMEBORDER=0 MARGINWIDTH=0 MARGINHEIGHT=0 SCROLLING=NO WIDTH=300 HEIGHT=250 SRC="' + adsrc + '" id="squaro"' + onloader + '></IFRAME>';
                var postform = '<div class="togrey" style="background-color:#444444;"><br /><center><table class="effect" style="background-color:#000000;"><tr><td>&#160;</td><td style="vertical-align:top;"><br /><textarea id="chit" style="width:420px;height:220px;"></textarea>' + imagever + '<br /><center><input type="submit" onclick="post_chat(' + section + ', ' + subsection + ', ' + global_userID + ', ' + global_moderator_level + ')" value="post comment" /></center></td><td  style="vertical-align:top;"><br />' + joyous_ad + '</td><td>&#160;</td></tr></table></center></div>';
                result_string = result_string + postform;
            }
            else
            {
                result_string = 'error connecting to database';
            }
            document.getElementById("chat").innerHTML = result_string;
        }
        else
        {
            alert("There was a problem retrieving the XML data:\n" + reqttyuse4.statusText);
        }
    }
}
function processReqChange56m243cxsd()
{
    if (req56m243cxsd.readyState == 4)
    {
        if (req56m243cxsd.status == 200)
        {
            var response = req56m243cxsd.responseXML.documentElement;
            var result = response.getElementsByTagName("result")[0].firstChild.data;
            var thispage = response.getElementsByTagName("page")[0].firstChild.data;
            var section = response.getElementsByTagName("section")[0].firstChild.data;
            var subsection = response.getElementsByTagName("subsection")[0].firstChild.data;
            var userID = response.getElementsByTagName("userID")[0].firstChild.data;
            var order = response.getElementsByTagName("order")[0].firstChild.data;
            if(result=='ok')
            {
                shochat(section, subsection, userID, order, thispage, global_userID, global_moderator_level);
            }
            else if(result=='error')
            {
                var loginmessage = 'problems reaching database, please try reloading the page';
                alert(loginmessage);
            }
        }
        else
        {
            alert("There was a problem retrieving the XML data:\n" + req56m243cxsd.statusText);
        }
    }
}

var global_userID = 0;
var global_moderator_level = 0;
function post_chat(section, subsection, visitor_userID, moderator_level)
{
    global_userID = visitor_userID;
    global_moderator_level = moderator_level;
    var dipost = document.getElementById("chit").value;
    var numba = document.getElementById("numba").value;
    var random = document.getElementById("random").value;
    var urlz = "xmlpost_chat?section=" + section + "&subsection=" + subsection + "&numba=" + numba + "&random=" + random + "&post=" + encodeURIComponent(dipost);
    loadXMLDocasdfasr(urlz);
}
function processReqChangeasdfasr()
{
    if (reqasdfasr.readyState == 4)
    {
        if (reqasdfasr.status == 200)
        {
            var result_string = "";
            var response = reqasdfasr.responseXML.documentElement;
            var result = response.getElementsByTagName("result")[0].firstChild.data;
            var section = response.getElementsByTagName("section")[0].firstChild.data;
            var subsection = response.getElementsByTagName("subsection")[0].firstChild.data;
            if(result=='ok')
            {
                shochat(section, subsection, 0, 'posting_time_DESC', 1, global_userID, global_moderator_level);
            }
            else if(result=='error')
            {
                var loginmessage = 'problems reaching database, please try reloading the page';
                alert(loginmessage);
            }
            else if(result=='tooshort')
            {
                var loginmessage = 'this post is too short';
                alert(loginmessage);
            }
            else if(result=='badcode')
            {
                var loginmessage = 'the number that you have entered in the box did not match the number in the picture next to it, please try again or reload this page if the problem persists';
                alert(loginmessage);
            }
            else if(result=='bannedfromcomments')
            {
                var loginmessage = 'this ip address has been temporarily banned from posting comments. please try again later';
                alert(loginmessage);
            }
        }
        else
        {
            alert("There was a problem retrieving the XML data:\n" + reqasdfasr.statusText);
        }
    }
}

function makevotesstring(rating, votes, linkID, thinger)
{
    if(votes==1)
    {
        var votesS = '';
    }
    else
    {
        var votesS = 's';
    }
    var votesstring = "rating: " + rating + ", " + votes + " vote" + votesS + ".";
    if(thinger!='pagelist')
    {
        votesstring = votesstring + "<span style='font-size:75%;'>vote: <a onclick='vote" + thinger + "(" + linkID + ", 0)' style='cursor:pointer;'>0</a>, <a onclick='vote" + thinger + "(" + linkID + ", 1)' style='cursor:pointer;'>1</a>, <a onclick='vote" + thinger + "(" + linkID + ", 2)' style='cursor:pointer;'>2</a>, <a onclick='vote" + thinger + "(" + linkID + ", 3)' style='cursor:pointer;'>3</a>, <a onclick='vote" + thinger + "(" + linkID + ", 4)' style='cursor:pointer;'>4</a>, <a onclick='vote" + thinger + "(" + linkID + ", 5)' style='cursor:pointer;'>5</a>, <a onclick='vote" + thinger + "(" + linkID + ", 6)' style='cursor:pointer;'>6</a>, <a onclick='vote" + thinger + "(" + linkID + ", 7)' style='cursor:pointer;'>7</a>, <a onclick='vote" + thinger + "(" + linkID + ", 8)' style='cursor:pointer;'>8</a>, <a onclick='vote" + thinger + "(" + linkID + ", 9)' style='cursor:pointer;'>9</a>, <a onclick='vote" + thinger + "(" + linkID + ", 10)' style='cursor:pointer;'>10</a></span>";
    }
    return votesstring;
}

function votepost(postID, note)
{
    var votesbox = 'postvotesstring' + postID;
    document.getElementById(votesbox).innerHTML = '...Loading...';
    var urlz = "xmlvoteposts?postID=" + postID + "&note=" + note;
    loadXMLDocvotepost(urlz);
}
function processReqChangevotepost()
{
    if (reqvotepost.readyState == 4)
    {
        if (reqvotepost.status == 200)
        {
            var response = reqvotepost.responseXML.documentElement;
            var result = response.getElementsByTagName("result")[0].firstChild.data;
            var rating = response.getElementsByTagName("rating")[0].firstChild.data;
            var votes = response.getElementsByTagName("votes")[0].firstChild.data;
            var postID = response.getElementsByTagName("postID")[0].firstChild.data;
            if(result=='ok')
            {
                var votesbox = 'postvotesstring' + postID;
                var redonevotesbox = makevotesstring(rating, votes, postID, 'post');
                document.getElementById(votesbox).innerHTML = redonevotesbox;
            }
        }
        else
        {
            alert("There was a problem retrieving the XML data:\n" + reqvotepost.statusText);
        }
    }
}


function shomods_log(siteID, mod_userID, moded_userID, action_code, order, page)
{
    var urlz = "xmlmods_log?siteID=" + siteID + "&mod_userID=" + mod_userID + "&moded_userID=" + moded_userID + "&action_code=" + action_code + "&order=" + order + "&page=" + page;
    loadXMLDoc6h5yh53dccch7(urlz);
}
//read mods_log from xml
function processReqChange6h5yh53dccch7()
{
    if (req6h5yh53dccch7.readyState == 4)
    {
        if (req6h5yh53dccch7.status == 200)
        {
            var result_string = "";
            var response = req6h5yh53dccch7.responseXML.documentElement;
            var result = response.getElementsByTagName("result")[0].firstChild.data;
            if(result == "ok")
            {
                var pagination_string = '';
                var totallinks = response.getElementsByTagName("totallinks")[0].firstChild.data;
                var totalpages = response.getElementsByTagName("totalpages")[0].firstChild.data;
                var thispage = response.getElementsByTagName("thispage")[0].firstChild.data;
                var siteID = response.getElementsByTagName("siteID")[0].firstChild.data;
                var mod_userID = response.getElementsByTagName("mod_userID")[0].firstChild.data;
                var moded_userID = response.getElementsByTagName("moded_userID")[0].firstChild.data;
                var action_code = response.getElementsByTagName("action_code")[0].firstChild.data;
                var order = response.getElementsByTagName("order")[0].firstChild.data;
                var orderbytimelink = ' -<a style="cursor:pointer;" onclick="shomods_log(' + "'" + siteID + "'" + ', ' + "'" + mod_userID + "'" + ', ' + "'" + moded_userID + "'" + ', ' + "'" + action_code + "'" + ', ' + "'posting_time'" + ', ' + "'1'" + ')">oldest</a>';
                var orderbytimerevlink = ' -<a style="cursor:pointer" onclick="shomods_log(' + "'" + siteID + "'" + ', ' + "'" + mod_userID + "'" + ', ' + "'" + moded_userID + "'" + ', ' + "'" + action_code + "'" + ', ' + "'posting_time_DESC'" + ', ' + "'1'" + ')">most recent</a>';
                var orderbyratinglink = ' -<a style="cursor:pointer;" onclick="shomods_log(' + "'" + siteID + "'" + ', ' + "'" + mod_userID + "'" + ', ' + "'" + moded_userID + "'" + ', ' + "'" + action_code + "'" + ', ' + "'rating'" + ', ' + "'1'" + ')">best rating</a>';
                var orderbyratingrevlink = ' -<a style="cursor:pointer" onclick="shomods_log(' + "'" + siteID + "'" + ', ' + "'" + mod_userID + "'" + ', ' + "'" + moded_userID + "'" + ', ' + "'" + action_code + "'" + ', ' + "'rating_DESC'" + ', ' + "'1'" + ')">worst rating</a>';
                var reorderstring = orderbytimelink + orderbytimerevlink + orderbyratinglink + orderbyratingrevlink;
                if(order=='posting_time')
                {
                    var orderedby = 'oldest';
                }
                else if(order=='posting_time_DESC')
                {
                    var orderedby = 'most recent';
                }
                else if(order=='rating')
                {
                    var orderedby = 'best rating';
                }
                else if(order=='rating_DESC')
                {
                    var orderedby = 'worst rating';
                }
                var orderstring = '<div class="effect" style="font-size:80%;">currently ordered by: ' + orderedby + '<br /> re-order by: ' + reorderstring + '</div>';
                totalpages = Math.abs(totalpages);
                if(totallinks==0)
                {
                    result_string = result_string + 'empty<br />';
                }
                else
                {
                    result_string = result_string + orderstring;
                }
                if(totalpages > 1)
                {
                    var previouspage = Math.abs(thispage)-1;
                    var nextpage = Math.abs(thispage)+1;
                    if(thispage>1)
                    {
                        var previouspagebutton = '<a onclick="shomods_log(' + "'" + siteID + "'" + ', ' + "'" + mod_userID + "'" + ', ' + "'" + moded_userID + "'" + ', ' + "'" + action_code + "'" + ', ' + "'" + order + "'" + ', ' + "'" + previouspage + "'" + ')" style="cursor:pointer;">previous</a> | ';
                    }
                    else
                    {
                        var previouspagebutton = '';
                    }
                    if(thispage<totalpages)
                    {
                        var nextpagebutton = ' | <a onclick="shomods_log(' + "'" + siteID + "'" + ', ' + "'" + mod_userID + "'" + ', ' + "'" + moded_userID + "'" + ', ' + "'" + action_code + "'" + ', ' + "'" + order + "'" + ', ' + "'" + nextpage + "'" + ')" style="cursor:pointer;">next</a>';
                    }
                    else
                    {
                        var nextpagebutton = '';
                    }
                    pagination_string = '<div class="effect" style="font-size:80%;">' + previouspagebutton + 'page ' + thispage + ' of ' + totalpages + nextpagebutton + '</div>';
                }
                result_string = result_string + pagination_string;
                var count = 0;
                if(totallinks>0)
                {
                    result_string = result_string + "<table><tr><th>page</th><th>mod</th><th>moded</th><th>code</th><th>description</th><th>time</th><th>votes</th></tr>";
                }
                while (count < totallinks)
                {
                    count++;
                    var thislogIDname = "logID_" + count;
                    var thissiteIDname = "siteID_" + count;
                    var thismod_userIDname = "mod_userID_" + count;
                    var thismoded_userIDname = "moded_userID_" + count;
                    var thisaction_codename = "action_code_" + count;
                    var thisdescriptionname = "description_" + count;
                    var thistimename = "time_" + count;
                    var thisratingname = "rating_" + count;
                    var thisvotesname = "votes_" + count;
                    var thislogID = response.getElementsByTagName(thislogIDname)[0].firstChild.data;
                    var thissiteID = response.getElementsByTagName(thissiteIDname)[0].firstChild.data;
                    var thismod_userID = response.getElementsByTagName(thismod_userIDname)[0].firstChild.data;
                    var thismoded_userID = response.getElementsByTagName(thismoded_userIDname)[0].firstChild.data;
                    var thisaction_code = response.getElementsByTagName(thisaction_codename)[0].firstChild.data;
                    var thisdescription = response.getElementsByTagName(thisdescriptionname)[0].firstChild.data;
                    var thistime = response.getElementsByTagName(thistimename)[0].firstChild.data;
                    var thisrating = response.getElementsByTagName(thisratingname)[0].firstChild.data;
                    var thisvotes = response.getElementsByTagName(thisvotesname)[0].firstChild.data;
                    if(thissiteID == 0)
                    {
                        var thispage_title = "N.A";
                        var bougras = "none";
                    }
                    else
                    {
                        var thispage_titlename = "site_name_" + thissiteID;
                        var thispage_title = response.getElementsByTagName(thispage_titlename)[0].firstChild.data;
                        var bougras = "<a onclick='shomods_log(" + thissiteID + ", 0, 0, 0, " + '"' + order + '"' + ", 1)' style='cursor:pointer;'>" + thispage_title + "</a>(<a onclick='shomods_log(" + thissiteID + ", " + mod_userID + ", " + moded_userID + ", " + '"' + action_code + '"' + ", " + '"' + order + '"' + ", " + thispage + ")' style='cursor:pointer;'>+</a>) (<a href='details?site=" + thissiteID + "'>p</a>)";
                    }
                    var thismod_usernamename = "public_name_" + thismod_userID;
                    var thismod_username = response.getElementsByTagName(thismod_usernamename)[0].firstChild.data;
                    if(thismoded_userID != 0)
                    {
                        var thismoded_usernamename = "public_name_" + thismoded_userID;
                        var thismoded_username = response.getElementsByTagName(thismoded_usernamename)[0].firstChild.data;
                    }
                    var pagetd = "<td>" + bougras + "</td>";
                    var modtd = "<td><a onclick='shomods_log(0, " + thismod_userID + ", 0, 0, " + '"' + order + '"' + ", 1)' style='cursor:pointer;'>" + thismod_username + "</a>(<a onclick='shomods_log(" + siteID + ", " + thismod_userID + ", " + moded_userID + ", " + '"' + action_code + '"' + ", " + '"' + order + '"' + ", " + thispage + ")' style='cursor:pointer;'>+</a>)(<a href='userpage?u=" + thismod_userID + "'>p</a>)</td>";
                    if(thismoded_userID==0)
                    {
                        var modedtd = "<td>a guest</td>";
                    }
                    else
                    {
                        var modedtd = "<td><a onclick='shomods_log(0, 0, " + thismoded_userID + ", 0, " + '"' + order + '"' + ", 1)' style='cursor:pointer;'>" + thismoded_username + "</a>(<a onclick='shomods_log(" + siteID + ", " + mod_userID + ", " + thismoded_userID + ", " + '"' + action_code + '"' + ", " + '"' + order + '"' + ", " + thispage + ")' style='cursor:pointer;'>+</a>)(<a href='userpage?u=" + thismoded_userID + "'>p</a>)</td>";
                    }
                    var codetd = "<td><a onclick='shomods_log(0, 0, 0, " + '"' + thisaction_code + '"' + ", " + '"' + order + '"' + ", 1)' style='cursor:pointer;'>" + thisaction_code + "</a>(<a onclick='shomods_log(" + siteID + ", " + mod_userID + ", " + moded_userID + ", " + '"' + thisaction_code + '"' + ", " + '"' + order + '"' + ", " + thispage + ")' style='cursor:pointer;'>+</a>)</td>";
                    var thisdatarow = "<tr>" + pagetd + modtd + modedtd + codetd + "<td>" + thisdescription + "</td><td>" + maketimus(thistime) + "</td><td><span id='mods_logvotesstring" + thislogID + "'>" + makevotesstring(thisrating, thisvotes, thislogID, 'mods_log') + "</span></td></tr>";
                    result_string = result_string + thisdatarow;
                }
                if(totallinks>0)
                {
                    result_string = result_string + "</table>";
                }
                result_string = result_string + pagination_string;
            }
            else
            {
                result_string = 'error connecting to database';
            }
            document.getElementById("mods_log").innerHTML = result_string;
        }
        else
        {
            alert("There was a problem retrieving the XML data:\n" + req6h5yh53dccch7.statusText);
        }
    }
}


function votemods_log(logID, note)
{
    var votesbox = 'mods_logvotesstring' + logID;
    document.getElementById(votesbox).innerHTML = '...Loading...';
    var urlz = "xmlvotemods_log?logID=" + logID + "&note=" + note;
    loadXMLDocvotemods_log(urlz);
}
function processReqChangevotemods_log()
{
    if (reqvotemods_log.readyState == 4)
    {
        if (reqvotemods_log.status == 200)
        {
            var response = reqvotemods_log.responseXML.documentElement;
            var result = response.getElementsByTagName("result")[0].firstChild.data;
            var rating = response.getElementsByTagName("rating")[0].firstChild.data;
            var votes = response.getElementsByTagName("votes")[0].firstChild.data;
            var logID = response.getElementsByTagName("logID")[0].firstChild.data;
            if(result=='ok')
            {
                var votesbox = 'mods_logvotesstring' + logID;
                var redonevotesbox = makevotesstring(rating, votes, logID, 'mods_log');
                document.getElementById(votesbox).innerHTML = redonevotesbox;
            }
        }
        else
        {
            alert("There was a problem retrieving the XML data:\n" + reqvotemods_log.statusText);
        }
    }
}


var global_userID = 0;
var global_moderator_level = 0;
function erase_sp(webpageID, site, page, esp_userID, esp_moderator_level, publicname, order, shownuserID)
{
    var areyousuremessage = 'are you sure you want to delete this crawling start point posted by ' + unescape(publicname);
    var r_esp=confirm(areyousuremessage);
    if(r_esp==true)
    {
        exec_erase_sp(webpageID, site, page, esp_userID, esp_moderator_level, order, shownuserID);
    }
}
function exec_erase_sp(webpageID, site, page, esp_userID, esp_moderator_level, order, shownuserID)
{
    global_userID = esp_userID;
    global_moderator_level = esp_moderator_level;
    var urlz = "xmlerase_sp?droppi=" + webpageID + "&site=" + site + "&page=" + page + "&order=" + order + "&shownuserID=" + shownuserID;
    loadXMLDocerase_sp(urlz);
}
function processReqChangeerase_sp()
{
    if (reqerase_sp.readyState == 4)
    {
        if (reqerase_sp.status == 200)
        {
            var response = reqerase_sp.responseXML.documentElement;
            var result = response.getElementsByTagName("result")[0].firstChild.data;
            var site = response.getElementsByTagName("site")[0].firstChild.data;
            var page = response.getElementsByTagName("page")[0].firstChild.data;
            var order = response.getElementsByTagName("order")[0].firstChild.data;
            var shownuserID = response.getElementsByTagName("shownuserID")[0].firstChild.data;
            if(result=='ok')
            {
                showstartingpoints(site,page,global_userID,global_moderator_level, order, shownuserID);
            }
        }
        else
        {
            alert("There was a problem retrieving the XML data:\n" + reqerase_sp.statusText);
        }
    }
}






function erase_page_to_search(webpageID, site, page, esp_userID, esp_moderator_level, publicname, order, shownuserID)
{
    var areyousuremessage = 'are you sure you want to delete this "page to search" posted by ' + unescape(publicname);
    var r_esp=confirm(areyousuremessage);
    if(r_esp==true)
    {
        exec_erase_page_to_search(webpageID, site, page, esp_userID, esp_moderator_level, order, shownuserID);
    }
}
function exec_erase_page_to_search(webpageID, site, page, esp_userID, esp_moderator_level, order, shownuserID)
{
    global_userID = esp_userID;
    global_moderator_level = esp_moderator_level;
    var urlz = "xmlerase_page_to_search?droppi=" + webpageID + "&site=" + site + "&page=" + page + "&order=" + order + "&shownuserID=" + shownuserID;
    loadXMLDocerase_page_to_search(urlz);
}
function processReqChangeerase_page_to_search()
{
    if (reqerase_page_to_search.readyState == 4)
    {
        if (reqerase_page_to_search.status == 200)
        {
            var response = reqerase_page_to_search.responseXML.documentElement;
            var result = response.getElementsByTagName("result")[0].firstChild.data;
            var site = response.getElementsByTagName("site")[0].firstChild.data;
            var page = response.getElementsByTagName("page")[0].firstChild.data;
            var order = response.getElementsByTagName("order")[0].firstChild.data;
            var shownuserID = response.getElementsByTagName("shownuserID")[0].firstChild.data;
            if(result=='ok')
            {
                shownspages_to_search(site,page,global_userID,global_moderator_level, order, shownuserID);
            }
        }
        else
        {
            alert("There was a problem retrieving the XML data:\n" + reqerase_page_to_search.statusText);
        }
    }
}






function displayunicode(e)
{
    var unicode=e.keyCode? e.keyCode : e.charCode
    if(unicode==13)
    {
        add_page_to_search();
    }
}
function add_page_to_search()
{
    var ps_siteID = document.getElementById("siteID").value;
    var ps_URL = document.getElementById("ps_URL").value;
    var ps_scanner = document.getElementById("ps_scanner").value;
    var ps_flag = document.getElementById("ps_flag").value;
    var urlz = "xmladd_page_to_search?site=" + ps_siteID + "&sU=" + escape(ps_URL) + "&ss=" + escape(ps_scanner) + "&sf=" + escape(ps_flag);
    loadXMLDocadd_page_to_search(urlz);
}
function processReqChangeadd_page_to_search()
{
    if (reqadd_page_to_search.readyState == 4)
    {
        if (reqadd_page_to_search.status == 200)
        {
            var response = reqadd_page_to_search.responseXML.documentElement;
            var result = response.getElementsByTagName("result")[0].firstChild.data;
            var site = response.getElementsByTagName("site")[0].firstChild.data;
            var userID = response.getElementsByTagName("userID")[0].firstChild.data;
            var moderator_level = response.getElementsByTagName("moderator_level")[0].firstChild.data;
            if(result=='ok')
            {
                shownspages_to_search(site,'last',userID,moderator_level,'time',0);
            }
            else if(result=='login')
            {
                var loginmessage = 'please login to add a crawling starting point';
                alert(loginmessage);
            }
            else if(result=='error')
            {
                var loginmessage = 'problems reaching database, please try reloading the page';
                alert(loginmessage);
            }
            else if(result=='tooshort')
            {
                var loginmessage = 'this URL is too short';
                alert(loginmessage);
            }
            else if(result=='ctooshort')
            {
                var loginmessage = 'this flag is too short';
                alert(loginmessage);
            }
            else if(result=='exists')
            {
                var loginmessage = 'we already have this URL';
                alert(loginmessage);
            }
        }
        else
        {
            alert("There was a problem retrieving the XML data:\n" + reqadd_page_to_search.statusText);
        }
    }
}


function rotatad(iframe_id)
{
    var random_time = (Math.random())*240000;
    random_time = Math.floor(random_time);
    var fixed_time = 60000;
    var waiting_time = random_time + fixed_time;
    var javascrexpr = "exec_rotatad('" + iframe_id + "')";
    var t = setTimeout(javascrexpr,waiting_time);
}
function exec_rotatad(iframe_id)
{
    var thecurrent_src = document.getElementById(iframe_id).src;
    //reassign source
    document.getElementById(iframe_id).src = thecurrent_src;
//call another turn
//rotatad(iframe_id);
}



function setCookie(c_name,value,expiredays)
{
    var exdate=new Date();
    exdate.setDate(exdate.getDate()+expiredays);
    document.cookie=c_name+ "=" +escape(value)+
    ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}
function getCookie(c_name)
{
    if (document.cookie.length>0)
    {
        c_start=document.cookie.indexOf(c_name + "=");
        if (c_start!=-1)
        {
            c_start=c_start + c_name.length+1;
            c_end=document.cookie.indexOf(";",c_start);
            if (c_end==-1) c_end=document.cookie.length;
            return unescape(document.cookie.substring(c_start,c_end));
        }
    }
    return "";
}


function close_chatroo()
{
    document.getElementById("my_chatroo").innerHTML = '';
    document.getElementById("chatroo_toggl").innerHTML = 'open chat';
    document.getElementById("chatroo_toggl").onclick = open_chatroo;
    setCookie('remember_chatroo_close','clozed',365)
}
function open_chatroo()
{
    document.getElementById("my_chatroo").innerHTML = '<iframe src="http://2meet4free.com/chat?lobbyID=1250725470973428&lobby_name=Globolister&embed=1&nowtheme=nabolister" style="width:800px;height:540px;" frameBorder="0"></iframe>';
    document.getElementById("chatroo_toggl").innerHTML = 'close chat';
    document.getElementById("chatroo_toggl").onclick = close_chatroo;
    setCookie('remember_chatroo_close','open',-1)
}

