<!--

//Hide tag
mrwise=0

TD=document.getElementsByTagName('TD')
for (i=0;i<TD.length;i++){
if (TD[i].innerHTML.match("THE POST")){

hidden=false
firstpos=TD[i].innerHTML.lastIndexOf("[hide]")
lastpos=TD[i].innerHTML.lastIndexOf("[/hide]")
term=TD[i].innerHTML.substring(firstpos,lastpos).split("[/hide]").join("").split("[hide]").join("")
TD[i].innerHTML=TD[i].innerHTML.split("[hide]").join("<B>Hidden Text: </B><a href='javascript:hideShow("+mrwise+")'>[Show/Hide]</a><div style='display:none' id='tehhiddenz_"+mrwise+"'><table border=1>"+term+"</table></div>").split(term+"[/hide]").join("")
mrwise++
}}

function hideShow(ID){
t=document.getElementById("tehhiddenz_"+ID)
if (t.style.display!=''){
t.style.display=''}else{
t.style.display='none'}
}

function inTag(ins){
if (ins=="hide"){
var hiddentag=prompt("Enter text here")
if (hiddentag!='' && hiddentag!=null){
document.REPLIER.Post.value+="[hide]"+hiddentag+"[/hide]"}}
}

//You tag
var username, tds = document.getElementsByTagName('td');

for (i = 0; i < tds.length; i++) {

if (tds[i].innerHTML.match('Log In')) {

  username = "Guest";

} else if (tds[i].innerHTML.match('Logged in as:')) {

  username = tds[i].getElementsByTagName('a')[0].innerHTML;

}

}


//Tag
var Tags = new Array();



Tags[0] = new Array(

/\[hightlight\](.*)\[\/hightlight\]/,

/\[youtube\](.*)\[\/youtube\]/,

/\[videogoogle\](.*)\[\/videogoogle\]/,

/\[iframe\](.*)\[\/iframe\]/,

/\[flash\](.*)\[\/flash\]/,

/\[video\](.*)\[\/video\]/,

/\[nhac\](.*)\[\/nhac\]/,

/\[bgimage\](.*)\[\/bgimage\]/,

/\[center\](.*)\[\/center\]/,

/\[bgmusic\](.*)\[\/bgmusic\]/,

/\[you\]/); 



Tags[1] = new Array('<span style="background-color:yellow">$1</span>','<center><object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/$1"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/$1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object></center>','<center><object width="425" height="350"><param name="movie" value="http://video.google.com/googleplayer.swf?docId=$1"></param><param name="wmode" value="transparent"></param><embed src="http://video.google.com/googleplayer.swf?docId=$1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object></center>','<iframe src="$1" width=550 height=380 scrolling="yes" frameborder="1"></iframe>','<table border="2" width="424" cellspacing="5" cellpadding="0"><tr><td><embed height=400 src="$1" width=542 quality="high" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed></td></tr></table>','<center><table border="2" width="525" cellspacing="5" cellpadding="0"><tr><td><embed height=380 src="$1" width=525 autostart="true" loop="true" hidden="false"></td></tr></table></center>','<center><embed enableContextMenu=0 type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" src="$1" type="application/x-mplayer2" ShowStatusBar="1" AutoStart="true" loop="true" ShowControls="1" width=294 height=65></embed><br><br><a href="$1" target="_blank"><img src="http://img194.imageshack.us/img194/5012/1bb1.jpg" border="0"></a></center>','<div class="bushitaxvabg" style="background-image:url($1);">','<center>$1</center>','<embed src="$1" autostart="1" loop="true" hidden="true"</embed>',username);



if (location.href.match('showtopic=') || location.href.match('act=Msg')|| location.href.match('act=Post')|| location.href.match('act=ST')|| location.href.match('index.php?')) {

TDS = document.getElementsByTagName('TD');

for(i=0;i<TDS.length;i++){



if (TDS[i].className == "post1" || TDS[i].className == "post2" || TDS[i].className == "row1") {

for (p = 0; p < Tags[1].length; p++) {

TDS[i].innerHTML = TDS[i].innerHTML.replace(Tags[0][p], Tags[1][p]);

}

}

}

}

if(location.href.match('act=Post') || location.href.match('act=Msg') || location.href.match('index.php?')){
function tagMusic()
{
col = prompt("Enter the complete URL for the hyperlink ", "http://");
document.getElementsByName('Post')[0].value += "[nhac]"+col+"[/nhac]"
}
function tagVideo()
{
col = prompt("Enter the complete URL for the hyperlink ", "http://");
document.getElementsByName('Post')[0].value += "[video]"+col+"[/video]"
}
function tagFlash()
{
col = prompt("Enter the complete URL for the hyperlink ", "http://");
document.getElementsByName('Post')[0].value += "[flash]"+col+"[/flash]"
}
function tagbgmusic()
{
col = prompt("Enter the complete URL for the background music ", "http://");
document.getElementsByName('Post')[0].value += "[bgmusic]"+col+"[/bgmusic]"
}
function tagbgimage()
{
col = prompt("Enter the complete URL for the background image ", "http://");
document.getElementsByName('Post')[0].value += "[bgimage]"+col+"[/bgimage]"
}
function taghightlight()
{
col = prompt("Enter text to hightlight ", "bushitaxva");
document.getElementsByName('Post')[0].value += "[hightlight]"+col+"[/hightlight]"
}
function tagyoutube()
{
col = prompt("Enter the complete ID ", "bushitaxva");
document.getElementsByName('Post')[0].value += "[youtube]"+col+"[/youtube]"
}
function taggoogle()
{
col = prompt("Enter the complete ID ", "bushitaxva");
document.getElementsByName('Post')[0].value += "[videogoogle]"+col+"[/videogoogle]"
}
function tagIframe()
{
col = prompt("Enter the complete URL for the hyperlink ", "http://");
document.getElementsByName('Post')[0].value += "[iframe]"+col+"[/iframe]"
}
function tagYou()
{
document.getElementsByName('Post')[0].value += "[you]"
}
function tagCenter()
{
col = prompt("Enter text to align center ", "");
document.getElementsByName('Post')[0].value += "[center]"+col+"[/center]"
}

function mota(text) {
document.REPLIER.helpbox.value = text;
}

var x = document.getElementsByTagName('td')
for(y=0;y<x.length;y++){
if(x[y].innerHTML.match(/Close all Tags/i) && x[y].className == "pformright"){
x[y].innerHTML +='<br>'
x[y].innerHTML +='<input type="button" accesskey="m" value="Music" onclick="tagMusic();" class="codebuttons" name="music" onmouseover="mota(\'Chèn nh&#7841;c vào bài vi&#7871;t (alt + m)\')">'
x[y].innerHTML +='&nbsp;<input type="button" accesskey="v" value="Video" onclick="tagVideo();" class="codebuttons" name="video" onmouseover="mota(\'Chèn phim &#7843;nh vào bài vi&#7871;t (alt + v)\')">'
x[y].innerHTML +='&nbsp;<input type="button" accesskey="f" value="Flash" onclick="tagFlash();" class="codebuttons" name="flash" onmouseover="mota(\'Chèn nh&#7841;c flash vào bài vi&#7871;t (alt + f)\')">'
x[y].innerHTML +='&nbsp;<input type="button" accesskey="b" value="Bgmusic" onclick="tagbgmusic();" class="codebuttons" name="Bgmusic" onmouseover="mota(\'Chèn nh&#7841;c n&#7873;n vào bài vi&#7871;t (alt + b)\')">'
x[y].innerHTML +='&nbsp;<input type="button" accesskey="t" value="Bgimage" onclick="tagbgimage();" class="codebuttons" name="Bgimage" onmouseover="mota(\'Chèn hình n&#7873;n vào bài vi&#7871;t (alt + t)\')">'
x[y].innerHTML +='&nbsp;<input type="button" accesskey="h" value="Hightlight" onclick="taghightlight();" class="codebuttons" name="Hightlight" onmouseover="mota(\'Hightlight text trong bài vi&#7871;t (alt + h)\')">'
x[y].innerHTML +='<br>'
x[y].innerHTML +='<input type="button" accesskey="a" value="Youtube" onclick="tagyoutube();" class="codebuttons" name="Youtube" onmouseover="mota(\'Chèn video Youtube vào bài vi&#7871;t (alt + a)\')">'
x[y].innerHTML +='&nbsp;<input type="button" accesskey="o" value="Google" onclick="taggoogle();" class="codebuttons" name="Google" onmouseover="mota(\'Chèn video Google vào bài vi&#7871;t (alt + o)\')">'
x[y].innerHTML +='&nbsp;<input type="button" accesskey="r" value="Frame" onclick="tagIframe();" class="codebuttons" name="iframe"  onmouseover="mota(\'Chèn 1 frame vào bài vi&#7871;t (alt + r)\')">'
x[y].innerHTML +='&nbsp;<input type="button" accesskey="c" value="Center" onclick="tagCenter();" class="codebuttons" name="center" onmouseover="mota(\'Chèn th&#7867; giúp ch&#7919; hi&#7879;n &#7903; gi&#7919;a (alt + c)\')">'
x[y].innerHTML +='&nbsp;<input type="button" accesskey="y" value="You" onclick="tagYou();" class="codebuttons" name="you" onmouseover="mota(\'Chèn th&#7867; [you] vào trong n&#7897;i dung (alt + y)\')">'
x[y].innerHTML +='&nbsp;<input  type="button" value="Hide" accesskey="s" onClick=inTag("hide") onmouseover="mota(\'D&#7845;u  n&#7897;i dung 1 &#273;o&#7841;n text (alt + s)\')">'
}}}

//-->

