function rules()
{
var xmlhttp = getXmlHttp()
xmlhttp.open('GET', '/rules.php', true);
xmlhttp.onreadystatechange = function()
{
if (xmlhttp.readyState == 4)
{
if(xmlhttp.status == 200)
{
document.getElementById('rul').innerHTML=xmlhttp.responseText;
document.getElementById('rules').checked=true;
}
}
}
xmlhttp.send(null);
}
function howtoimg()
{
var xmlhttp = getXmlHttp()
xmlhttp.open('GET', '/howtoimg.php', true);
xmlhttp.onreadystatechange = function()
{
if (xmlhttp.readyState == 4)
{
if(xmlhttp.status == 200)
{
document.getElementById('howtoi').innerHTML=xmlhttp.responseText;
}
}
}
xmlhttp.send(null);
}
function howtoimg2()
{
var xmlhttp = getXmlHttp()
xmlhttp.open('GET', '/howtoimg.php', true);
xmlhttp.onreadystatechange = function()
{
if (xmlhttp.readyState == 4)
{
if(xmlhttp.status == 200)
{
document.getElementById('howtoi2').innerHTML=xmlhttp.responseText;
}
}
}
xmlhttp.send(null);
}
var taghelpcontent='';
var taghelpstage=false;
function showtaghelp()
{
if (taghelpstage==true)
{
// свернуть
document.getElementById('taghelp').innerHTML=window.taghelpcontent;
taghelpstage=false;
}
else
{
var taghelpcontent=document.getElementById('taghelp').innerHTML;
window.taghelpcontent=taghelpcontent;
var xmlhttp = getXmlHttp()
xmlhttp.open('GET', '/taghelp.php', true);
xmlhttp.onreadystatechange = function()
{
if (xmlhttp.readyState == 4)
{
if(xmlhttp.status == 200)
{
document.getElementById('taghelp').innerHTML+='
'+xmlhttp.responseText;
}
}
}
xmlhttp.send(null);
taghelpstage=true;
}
}
function getXmlHttp(){
var xmlhttp;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}
function textcount(entertext)
{
var re1 = /<\/a>/g;
var re2 = /<\/a>/g;
var re3 = /\[url=https:\/\/(imgbb\.com|ibb\.co)\/([\w-]*)\]\[img\]https:\/\/i.ibb.co\/(\w+)\/([\w-]+)\.(png|jpg|jpeg|gif)\[\/img\]\[\/url\]/g;
var newstr = entertext.value.replace(re1, "[img:$1/$2/$3]");
var newstr = newstr.replace(re2, "[img:$3/$4/$5]");
var newstr = newstr.replace(re3, "[img:$3/$4/$5]");
if (newstr != entertext.value) entertext.value=newstr;
maxlen=10000;
maxline=200;
textlen=entertext.value.length;
if (textlen>maxlen)
{
entertext.value = entertext.value.substring(0,maxlen);
textlen=maxlen;
}
k=maxline/maxlen;
linelen=Math.round(textlen*k);
if (linelen) document.getElementById('progressline').style.width=linelen;
else document.getElementById('progressline').style.width=1;
}