function forumscontrol (controlid,istopic,tid,cid,rurl,uid,aid,bid,page) {
   var showb = 0;
   var shtml = '[ ';
   var sbase = $('#internalbase').val();

   if (istopic == 1) {
      var eurl = sbase + '/edit/?topic=' + tid;
      var durl = sbase + '/delete/?topic=' + tid;
      var qurl = sbase + '/reply/' + tid + '/?option=quote';
   } else {
      var eurl = sbase + '/edit/?topic=' + tid + '&amp;reply=' + cid + '&amp;rp=' + page;
      var durl = sbase + '/delete/?topic=' + tid + '&amp;reply=' + cid;
      var qurl = sbase + '/reply/' + tid + '/?reply=' + cid + '&amp;option=quote';
   }

   if (uid == $('#internaluid').val() || $('#internalaid').val() >= aid) {
      showb = 1;
      shtml += '<a href="' + eurl + '">Edit</a> | ';
   }

   if ($('#internalaid').val() >= bid) {
      showb = 1;
      shtml += '<a href="' + durl + '">Delete</a> | ';
   }

   if ($('#internalaid').val() >= 5) {
      showb = 1;
      shtml += '<a href="' + qurl + '">Quote</a>';
   }

   shtml += ' ]';

   if (showb == 1) {
      $('#control' + controlid).html(shtml);
   }

   // Should eventually be changed to an ID instead of a class, as it rewrites every class each loading
   $('#replyto-' + controlid).html('[ <a href="#top">Top</a> | <a href="' + sbase + '/reply/' + tid + '/">Reply to Topic</a> ]');
}

function forumsshowxtopicdata() {
	// this function only runs in special mode anyway
	if ($('#internalnetid').val() == $('#internalxnetid').val()) {
		$('.xtopicnet-' + $('#internalnetid').val()).hide();
	} else {
		$('.topic-xtopic').show();
	}
}