/*YouTube Videos In A Post, Without DoHTML Tags, By Trini_Gangsta
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(/\[YOUTUBE\](.*)\[\/YOUTUBE\]/))
   {
z[x].innerHTML = z[x].innerHTML.split("[YOUTUBE]").join("<embed src='").split("/watch?v=").join("/v/").split("[/YOUTUBE]").join("' type='application/x-shockwave-flash' wmode='transparent' width='425' height='355'></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='YOUTUBE' onclick='addtheyttag()' onmouseover='giveythelp()' class='codebuttons'>&nbsp;<a href='javascript:closeall();'>Close all Tags</a>");
   }
}
function addtheyttag()
{
document.REPLIER.Post.value+="[YOUTUBE][/YOUTUBE]";
}
function giveythelp()
{
document.REPLIER.helpbox.size="100";
document.REPLIER.helpbox.value="Paste full URL of Youtube video between these tags";
}