/* 
 * Various jquery functions by jonesy
 */


$(".sid2 .block-content").addClass("blockright");

// reorders divs on match review page for author.
$(".sid14 .block-content:first, .sid31 .block-content:first").insertAfter(".sid14 .block-content:last");

// replaces author "Hucks" with image signature
$(".sid14 .block-content:last:contains('ucks'), .sid31 .block-content:last:contains('ucks')").html('<img src="/images/sig.gif" alt="Reported by Darren Huckerby" class="author" /><span class="author">Reported by Darren Huckerby</span>');

// Makes author bold
$(".sid14 .block-content:last:contains('eport'), .sid31 .block-content:last:contains('eport')").addClass("author");


/////////////// Functions to clear up spacing left by CMS -jonesy
/////// Remove &nbsp;
$('.sid14 .block-content p, .sid31 .block-content p').each(function() {
   var $this = $(this);
   var t = $this.text();
   $this.text(t.replace('\u00a0',''));
});
/////// Remove empty p
$('.sid14 .block-content p, .sid31 .block-content p').filter(function() {
        return $.trim($(this).text()) === ''
    })
    .remove()
/////// Remove &nbsp;
$('.sid14 .block-content div, .sid31 .block-content div').each(function() {
   var $this = $(this);
   var t = $this.text();
   $this.text(t.replace('\u00a0',''));
});
/////// Remove empty div
$('.sid14 .block-content div, .sid31 .block-content div').filter(function() {
        return $.trim($(this).text()) === ''
    })
    .remove()
///////////////////////////////////////////////////////////////////
