var buttonURL = "http://i824.photobucket.com/albums/zz168/theartforums/i5JgfO.png"; // Put the URL of the UBBC button here

// Don't edit
var aTD = document.getElementsByTagName("td");
var flaHTML = '<embed allowScriptAccess="never" src="http://$3" type="application/x-shockwave-flash" width="$1" height="$2"></embed>';
var flaReg = /\[flash=(\d+),(\d+)\]http:\/\/(.+?)\[\/flash\]/gi;
if(location.href.match(/action=display/)){
    for(a=0;a<aTD.length;a++){
        if(aTD[a].colSpan == 3 && aTD[a].vAlign == "top" && aTD[a].firstChild.nodeName == "HR"){
            aTD[a].innerHTML = aTD[a].innerHTML.replace(flaReg, flaHTML);
            var n = aTD[a].parentNode.nextSibling;
            n.innerHTML = n.innerHTML.replace(flaReg, flaHTML);
        }
    }
} else if(location.href.match(/action=viewprofile/)){
    for(a=0;a<aTD.length;a++){
        if(aTD[a].colSpan == 2 && aTD[a-1].getElementsByTagName("b")[0] && aTD[a-1].getElementsByTagName("b")[0].innerHTML.match(/^Signature$/)){
            aTD[a].innerHTML = aTD[a].innerHTML.replace(flaReg, flaHTML);
            break;
        }
    }
} else if(document.postForm && document.postForm.message){
    if(location.href.match(/quote=/)){
        document.postForm.message.value = document.postForm.message.value.replace(flaReg, "");
    }
    var n = document.postForm.color;
    var s = document.createElement("span");
    s.innerHTML = "<a href='javascript:add(\"[flash=width,height]\", \"[/flash]\");'><img border='0' src='"+buttonURL+"' alt='Flash Video' /></a>";
    n.parentNode.insertBefore(s, n);
}