

  /*
  *
  * Naja.. droppen we log zooi hier =')
  *
  */

  function show_log( log_id )
  {

          var log_id = log_id; // Global var, needed for do_request_function on window scope.

          /*
          *
          * Update status
          *
          */

          var url      = ipb_var_base_url + 'autocom=log&CODE=read&lid=' + parseInt( log_id );

          /*
          *
          * Request (AJAX)
          *
          */

          do_request_function = function()
          {

                  /*
                  *
                  * Show update message
                  *
                  */

                  if ( ! xmlobj.readystate_ready_and_ok() )
                  {

                          xmlobj.show_loading( 'Informatie verzamelen..' );
                          return;

                  }

                  xmlobj.hide_loading();

                  /*
                  *
                  * Got response?
                  *
                  */

                  if( xmlobj.xmlhandler.responseText != '' )
                  {

                          var response = xmlobj.xmlhandler.responseText;

                          /*
                          *
                          * Update count and delete options
                          *
                          */

                          document.getElementById( 'log_paste_' + log_id ).innerHTML = response;

                  }

          }

          xmlobj = new ajax_request();
          xmlobj.onreadystatechange( do_request_function );

          /*
          *
          * Load URL
          *
          */

          xmlobj.process( url );

  }

  function rep_fix( pid )
  {

          /*
          *
          * Show divs, simple ha?
          *
          */

          document.getElementById( 'spam_post_' + pid ).style.display = document.getElementById( 'spam_info_' + pid ).style.display = 'block';
          document.getElementById( 'spam_post_message_' + pid ).style.display = 'none';

  }

  function get_rep_log( pid )
  {

          try{menu_action_close();}catch(e){}

          /*
          *
          * Update status
          *
          */

          var url      = ipb_var_base_url + 'autocom=rep&CODE=log&pid=' + parseInt( pid );

          /*
          *
          * Open popup
          *
          */

          PopUp( url, 'REPLOGSYS', 520, 500 );

  }

  function update_rep( pid, act )
  {

          var pid = pid;

          /*
          *
          * Update status
          *
          */

          var url      = ipb_var_base_url + 'autocom=rep&CODE=action&pid=' + parseInt( pid ) + '&vote=' + act;

          /*
          *
          * Request (AJAX)
          *
          */

          do_request_function = function()
          {

                  /*
                  *
                  * Show update message
                  *
                  */

                  if ( ! xmlobj.readystate_ready_and_ok() )
                  {

                          xmlobj.show_loading( 'Updating..' );
                          return;

                  }

                  xmlobj.hide_loading();

                  /*
                  *
                  * Got response?
                  *
                  */

                  if( xmlobj.xmlhandler.responseText != 'Already voted' )
                  {

                          var response = parseInt(xmlobj.xmlhandler.responseText);

                          /*
                          *
                          * Update count and delete options
                          *
                          */

                          var p_c = document.getElementById( 'rep_' + pid + '_count_middle' );
                          p_c.innerHTML = response.toString();
                          p_c.style.width = 'auto';
                          p_c.className = 'count_repu_middle' + ( response > 0 ? ' green_repu_middle' : ( response < 0 ? ' red_repu_middle' : '' ) );

                          document.getElementById( 'rep_' + pid + '_count_left' ).className = 'count_repu_left' + ( response > 0 ? ' green_repu_left' : ( response < 0 ? ' red_repu_left' : '' ) );
                          document.getElementById( 'rep_' + pid + '_count_right' ).className = 'count_repu_right' + ( response > 0 ? ' green_repu_right' : ( response < 0 ? ' red_repu_right' : '' ) );

                          var p_div = document.getElementById( 'rep_' + pid );
                          p_div.onmouseover = function(){};
                          p_div.onclick = function(){};
                          p_div.style.cursor = 'default';
                          p_div.parentNode.title = 'Beoordeling | Je hebt dit bericht al beoordeeld';

                  }

          }

          xmlobj = new ajax_request();
          xmlobj.onreadystatechange( do_request_function );

          /*
          *
          * Load URL
          *
          */

          xmlobj.process( url );

          try{menu_action_close();}catch(e){}

          return false;

  }

  function rep_delete( lid )
  {

          /*
          *
          * Confirm action..
          *
          */

          if( ! confirm( "Weet je zeker dat je deze beoordeling wilt verwijderen?\nDe gebruiker zal niet de mogelijkheid krijgen opnieuw te kunnen beoordelen!" ) )
                  return;

          var lid = lid; // Global scope

          /*
          *
          * Update status
          *
          */

          var url      = ipb_var_base_url + 'autocom=rep&CODE=delete&lid=' + parseInt( lid );

          /*
          *
          * Request (AJAX)
          *
          */

          do_request_function = function()
          {

                  /*
                  *
                  * Show update message
                  *
                  */

                  if ( ! xmlobj.readystate_ready_and_ok() )
                  {

                          xmlobj.show_loading( 'Deleting..' );
                          return;

                  }

                  xmlobj.hide_loading();

                  /*
                  *
                  * Got response?
                  *
                  */

                  if( xmlobj.xmlhandler.responseText != '' )
                          window.location = window.location.href;

          }

          xmlobj = new ajax_request();
          xmlobj.onreadystatechange( do_request_function );

          /*
          *
          * Load URL
          *
          */

          xmlobj.process( url );

          try{menu_action_close();}catch(e){}

  }

  function rep_compensate( lid )
  {

          /*
          *
          * How many?
          *
          */

          var tel;
          if( ! ( tel = prompt( "Vul je compensatie getal in (-1 max -100 of 1 max 100):" ) ) )
                  return;

          tel     = parseInt(tel);
          var lid = lid; // Global scope

          /*
          *
          * Update status
          *
          */

          var url      = ipb_var_base_url + 'autocom=rep&CODE=compensate&fix=' + tel + '&lid=' + parseInt( lid );

          /*
          *
          * Request (AJAX)
          *
          */

          do_request_function = function()
          {

                  /*
                  *
                  * Show update message
                  *
                  */

                  if ( ! xmlobj.readystate_ready_and_ok() )
                  {

                          xmlobj.show_loading( 'Verwerken..' );
                          return;

                  }

                  xmlobj.hide_loading();

                  /*
                  *
                  * Got response?
                  *
                  */

                  if( xmlobj.xmlhandler.responseText != '' )
                          window.location = window.location.href;

          }

          xmlobj = new ajax_request();
          xmlobj.onreadystatechange( do_request_function );

          /*
          *
          * Load URL
          *
          */

          xmlobj.process( url );

          try{menu_action_close();}catch(e){}

  }
