/*YouTube Mini Videos In A Post, Without DoHTML Tags, By PGV
Feel free to share this, just don't claim it*/

if(location.href.match("showtopic"))
{
var z = document.getElementsByTagName("div");
}
else if(location.href.match("Post&CODE"))
{
var z = document.getElementsByTagName("span");
}
for(x=0;x<z.length;x++)
{
if(z[x].className.match("postcolor") && z[x].innerHTML.match(/\[MINITUBE\](.*)\[\/MINITUBE\]/))
   {
z[x].innerHTML = z[x].innerHTML.split("[MINITUBE]").join("<embed src='").split("/watch?v=").join("/v/").split("[/MINITUBE]").join("' type='application/x-shockwave-flash' wmode='transparent' width='200' height='150'></embed>");
   }
}
var z = document.getElementsByTagName("td");
for(x=0;x<z.length;x++)
{
if(location.href.match("Post&CODE") && z[x].className.match("pformright") && z[x].innerHTML.match("Close all Tags"))
   {
z[x].innerHTML = z[x].innerHTML.split("Close all Tags").join("</a><input type='button' value='MINITUBE' onclick='addtheyttag()' onmouseover='giveythelp()' class='codebuttons'>&nbsp;<a href='javascript:closeall();'>Close all Tags</a>");
   }
}
function addtheyttag()
{
document.REPLIER.Post.value+="[MINITUBE][/MINITUBE]";
}
function giveythelp()
{
document.REPLIER.helpbox.size="100";
document.REPLIER.helpbox.value="Paste full URL of Youtube video between these tags";
}