var oldType, oldHTML, imgURL, imgTID, oldTHREAD;
function SetPromptTable() {
var promptTable = document.createElement('table');
promptTable.id = "pmnotifywrap";
promptTable.cellPadding = "1";
promptTable.cellSpacing = "1";
promptTable.width = "480px";
for (r = 0; r < 2; r++) {
var promptTR = promptTable.insertRow(-1);
if (r == 0){
promptTR.className = 'pmnotifytop'
var promptTD = promptTR.insertCell(-1);
promptTD.height = '12';
promptTD.align = 'center';
promptTD.valign = 'middle';
var promptDiv = document.createElement('div');
promptDiv.id = 'pmnotifytop';
promptDiv.innerHTML = lang_a['info_prinfo'];
promptTD.appendChild(promptDiv);
}
if (r == 1){
promptTR.className = 'pmnotify';
var promptTD = promptTR.insertCell(-1);
promptTD.className = 'pmnotify';
promptTD.width = '480px';
promptTD.align = 'left';
promptTD.valign = 'middle';
promptTD.innerHTML = '
";
my_getbyid("pic" + tid).innerHTML = pic;
}
}
function closet_cb(data){
var fid = data.substr(data.lastIndexOf(']:::[') + 5);
var tid = data.substring(0,data.lastIndexOf(']:::['));
if (tid || fid) {
var pic = "
";
my_getbyid("pic" + tid).innerHTML = pic;
}
}
function turnthread(tid,type,fid){
if (type == 1) x_closethread(tid, fid, closet_cb);
if (type == 0) x_openthread(tid, fid, opent_cb);
}
function edithread(tid){
if (my_getbyid("thread_c_b_sp")) closeColorSp();
var oldTN = my_getbyid("thread_c_b_" + tid);
var arrColors=[["#800000","#8b4513","#006400","#2f4f4f","#000080","#4b0082","#800080","#000000"],["#ff0000","#daa520","#6b8e23","#708090","#0000cd","#483d8b","#c71585","#696969"],["#ff4500","#ffa500","#808000","#4682b4","#1e90ff","#9400d3","#ff1493","#a9a9a9"],["#ff6347","#ffd700","#32cd32","#87ceeb","#00bfff","#9370db","#ff69b4","#dcdcdc"],["X","#ffffe0","#98fb98","#e0ffff","#87cefa","#e6e6fa","#dda0dd","#ffffff"]];
if (!my_getbyid("show" + tid)) return false;
var title = my_getbyid("show" + tid).innerHTML;
var boldck = title.toLowerCase().lastIndexOf('') == '-1' ? '' : 'checked';
var colorTableDiv = document.createElement('div');
colorTableDiv.id = 'thread_c_b_sp';
colorTableDiv.style.display = 'inline';
colorTableDiv.style.position = 'absolute';
colorTableDiv.style.border = '#7FB9F8 1px solid';
colorTableDiv.style.background = '#FFFFFF';
var chDiv = document.createElement('div');
chDiv.style.width = '124px';
chDiv.style.padding = '0px 2px 0px 2px';
chDiv.innerHTML = ""+lang_a['info_close']+" "+lang_a['info_bold']+"";
colorTableDiv.appendChild(chDiv);
var colorTable = document.createElement('table');
colorTable.cellPadding = "1";
colorTable.cellSpacing = "1";
colorTable.style.fontSize = "9px";
for (var n in arrColors)
{
var colorTR = colorTable.insertRow(-1);
for (var m in arrColors[n])
{
var colorTD = colorTR.insertCell(-1);
colorTD.id = 'forecolor_' + tid + '_sp_' + arrColors[n][m] ;
colorTD.className = 'row1';
var colorDiv = document.createElement('div');
colorDiv.style.width = '11px';
colorDiv.style.height = '11px';
colorDiv.style.border = 'white 1px solid';
colorDiv.style.fontSize = '1px';
colorDiv.style.cursor='hand';
colorDiv.onclick = chTitleColor;
colorDiv.onmouseover = changeCss1;
colorDiv.onmouseout = changeCss2;
if (arrColors[n][m] == 'X') {
colorDiv.innerHTML = 'X';
colorDiv.style.font = '11px Arial';
colorDiv.style.textAlign = 'center';
colorDiv.style.lineHeight = '11px';
}
else colorDiv.style.background = arrColors[n][m];
colorTD.appendChild(colorDiv);
}
}
colorTableDiv.appendChild(colorTable);
oldTN.appendChild(colorTableDiv);
}
function cbsend_cb(data){
var text = data.substr(data.lastIndexOf(']:::[') + 5);
var tid = data.substring(0,data.lastIndexOf(']:::['));
my_getbyid("show" + tid).innerHTML = text;
}
function changeCss1(e){
var el
if (isIE) el = window.event.srcElement;
else el = e.target;
eventid = el.parentNode;
eventid.style.backgroundColor = 'darkgray' ;
}
function changeCss2(e){
var el
if (isIE) el = window.event.srcElement;
else el = e.target;
eventid = el.parentNode;
eventid.style.backgroundColor = '';
}
function chTitleColor(e){
var el
if (isIE) el = window.event.srcElement;
else el = e.target;
eventid = el.parentNode;
var text = eventid.id;
var color = text.substr(text.lastIndexOf('_sp_') + 4);
var tid = text.substring(10,text.lastIndexOf('_sp_'));
var bold = my_getbyid("showbb" + tid).checked ? 1 : 0;
closeColorSp();
x_cbsend(tid,color,bold,cbsend_cb);
}
function closeColorSp(){
my_getbyid("thread_c_b_sp").parentNode.removeChild(my_getbyid("thread_c_b_sp"));
}
function noajax(){
//nothing
}
function quickreply_cb(data){
if (my_getbyid('querySubmit')) {
var querySubmit = my_getbyid('querySubmit');
querySubmit.disabled = false;
}
if (my_getbyid('queryPreview')) {
var queryPreview = my_getbyid('queryPreview');
queryPreview.disabled = false;
}
var showl1 = my_getbyid("promptinfo");
var showform = my_getbyid("mxbform");
var text = data.substr(data.lastIndexOf(']:::[') + 5);
var num = data.substring(0,data.lastIndexOf(']:::['));
if (num.lastIndexOf(']:::[') != -1) {
var num_tmp = num.substring(0,num.lastIndexOf(']:::['));
num = num_tmp;
}
if (num == 1)
{
isint = 1;
if (text) var info = text;
else var info = lang_a['info_ermember'];
L1show(info);
setTimeout(function() {
showl1.style.display='none';
showl1.style.visibility='hidden';
}, 6000);
var pnum = showform.pnum.value;
if (pnum > 11)
{
ppnum = parseInt(pnum);
showform.pnum.value = ppnum;
}
return;
}else{
isint = 0;
}
antim = text.substr(text.lastIndexOf('+:::+') + 5);
pagetext = text.substring(0,text.lastIndexOf('+:::+'));
if (my_getbyid("ajaxrep" + num)) my_getbyid("ajaxrep" + num).style.display = "block";
else {
if (isGecko) alert(lang_a['info_erfxre']);
else return false;
}
if (isIE) my_getbyid("ajaxrep" + num).innerHTML = pagetext;
else {
try
{
my_getbyid("ajaxrep" + num).innerHTML = pagetext;
}
catch (e)
{
numvalue = 11;
my_getbyid("ajaxrep" + numvalue).innerHTML = pagetext;
}
}
antimhash = antim.substr(antim.lastIndexOf('-:::-') + 5);
antimtext = antim.substring(0,antim.lastIndexOf('-:::-'));
var numnew = parseInt(num) + 1;
showform.pnum.value = numnew;
if (antimhash == 1 && antimtext == 1)
{
//nothing
}
else
{
if (my_getbyid("antispam")){
showform.userimagehash.value = antimhash;
my_getbyid("antispamtext").innerHTML = antimtext;
}else{
//nothing
}
}
showl1.style.display='none';
showl1.style.visibility='hidden';
openquick();
}
function queryly(){
if (my_getbyid('querySubmit'))
var querySubmit = my_getbyid('querySubmit');
querySubmit.disabled = true;
if (my_getbyid('queryPreview'))
var queryPreview = my_getbyid('queryPreview');
queryPreview.disabled = true;
var showredirect = my_getbyid("redirect").checked;
var showl1 = my_getbyid("promptinfo");
var showan = my_getbyid("antispam");
var showform = my_getbyid("mxbform");
if (showredirect == true) {
mxeGet();
showform.submit();
return false;
}
if (showan)
{
var antispam = showan.value;
}
else
{
var antispam = 1;
}
if (showan)
{
if (antispam.length != 4 || !antispam)
{
if (antispam != 1)
{
showan.value = "";
var info = lang_a['info_inmenber'];
L1show(info);
setTimeout(function() {
showl1.style.display='none';
showl1.style.visibility='hidden';
}, 3000);
}
querySubmit.disabled = false;
queryPreview.disabled = false;
return;
}
}
mxeGet();
var content = mxeTxH.value;
initData();
var contentlength = calculate_byte(content);
if ( contentlength < postminchars || contentlength > postmaxchars )
{
try
{
showan.value = "";
}
catch (e)
{
//nothing
}
var info = lang_a['info_ctis']+postminchars+"~"+postmaxchars+lang_a['info_bhstr'];
L1show(info);
querySubmit.disabled = false;
queryPreview.disabled = false;
setTimeout(function() {
showl1.style.display='none';
showl1.style.visibility='hidden';
}, 3000);
return;
}
else
{
mxeTxH.value = '';
var todo = 'update';
var s = showform.s.value;
var f = showform.f.value;
var t = showform.t.value;
var qreply = 1;
var userimagehash = showform.userimagehash.value;
var smile,signature,url,quote;
var allowsmile = showform.allowsmile.checked;
allowsmile==true?smile=1:smile=0;
var showsignature = showform.showsignature.checked;
showsignature==true?signature=1:signature=0;
var parseurl = showform.parseurl.checked;
parseurl==true?url=1:url=0;
var quotepost = showform.quotepost.checked;
quotepost==true?quote=1:quote=0;
var givecash = showform.givecash.value;
if (!givecash)
{
givecash = 0;
}
var allowbbcode = showform.allowbbcode.value;
var postnum = showform.postnum.value;
var pnum = showform.pnum.value;
var modeType = wMode ? 'wysiwyg' : 'bbcode';
x_quickreply( f, userimagehash, pnum, t, content, s, smile, signature, url, quote ,givecash ,allowbbcode ,postnum ,antispam ,qreply, modeType, quickreply_cb);
if (antispam != 1)
{
showan.value = "";
}
var info = lang_g['g_refering'];
L1show(info);
}
}
function returnpagetext_cb(data){
var html1 = data.substr(data.lastIndexOf(']:::[') + 5);
var pid = data.substring(0,data.lastIndexOf(']:::['));
var showDiv = my_getbyid('show' + pid);
var html2 = showDiv.innerHTML;
oldHTML = document.createElement('input');
oldHTML.type = 'hidden';
oldHTML.id = 'oldHTML' + pid;
oldHTML.value = html2;
if (html1.lastIndexOf('') != -1 ) html1 = html1.substring(0,html1.lastIndexOf(''));
else html1 = html1;
wMode = 1;
var showParent = showDiv.parentNode;
showDiv.innerHTML = '';
showDiv.appendChild(oldHTML);
showTxa = document.createElement('textarea');
showTxa.id = 'showarea' + pid;
showTxa.style.width = '500px';
showTxa.style.height = '300px';
showTxa.value = html1;
showDiv.appendChild(showTxa);
mxeditor('showarea' + pid);
showSubmit = document.createElement('div');
showSubmit.style.width = '500px';
showSubmit.style.height = '30px';
showSubmit.style.textAlign = 'center';
var click_se_nd = 'editorsend('+pid+')';
var type = 'text';
showSubmit.innerHTML = ' ';
showDiv.appendChild(showSubmit);
mxeWin.focus();
}
function showedit(pid,fid,bbcode,html,type,uid){
if (mxe){
if (typeof mxeDoc == 'object' && mxe.substr(0, 8) == 'showarea') {
var mxe_pid = mxeTxH.id.substr(8);
if (mxe_pid == pid) return;
editorreset(mxe_pid,oldType);
} else {
closedquick();
}
}
if (my_getbyid('querySubmit')) {
if (my_getbyid('querySubmit').disabled == true) {
my_getbyid('post').onclick = null;
} else {
my_getbyid('querySubmit').disabled = true;
}
}
oldType = type;
if (isIE) var geit = 1;
else var geit = 0;
if (type == 'text') {
thisforum = realthisforum;
x_returnpagetext(pid,returnpagetext_cb);
} else {
thisforum = 'signature';
var showDiv = my_getbyid('signature' + pid);
var html = showDiv.innerHTML;
oldHTML = document.createElement('input');
oldHTML.type = 'hidden';
oldHTML.id = 'oldHTML' + pid;
oldHTML.value = html;
if (html.lastIndexOf('') != -1 ) html = html1.substring(0,html1.lastIndexOf(''));
else html = html;
wMode = 1;
var showParent = showDiv.parentNode;
showDiv.innerHTML = '';
showDiv.appendChild(oldHTML);
showTxa = document.createElement('textarea');
showTxa.id = 'showarea' + pid;
showTxa.style.width = '300px';
showTxa.style.height = '150px';
showTxa.value = html;
showDiv.appendChild(showTxa);
mxeditor('showarea' + pid);
showSubmit = document.createElement('div');
showSubmit.style.width = '300px';
showSubmit.style.height = '30px';
showSubmit.style.textAlign = 'center';
var click_se_nd = 'sigsend('+pid+','+uid+')';
showSubmit.innerHTML = ' ';
showDiv.appendChild(showSubmit);
mxeWin.focus();
}
}
function returnsig_cb(data){
var tmp = data.substr(data.lastIndexOf(']:::[') + 5);
var pid = data.substring(0,data.lastIndexOf(']:::['));
my_getbyid("signature"+pid).innerHTML = tmp;
var showli = my_getbyid("promptinfo");
showli.style.display='none';
showli.style.visibility='hidden';
openquick();
}
function sigsend(pid,uid){
thisforum = realthisforum;
mxeGet();
var content = mxeTxH.value;
var contentlength = calculate_byte(content);
if (contentlength > postmaxchars || contentlength <= 4)
{
var info= lang_g['g_outstr']+"(4~"+postmaxchars+")"+lang_a['info_again']+".";
var id = "signature" + pid;
CreatDiv(id,info);
setTimeout(function() {
my_getbyid(id).innerHTML = oldHTML.value;
}, 3000);
openquick();
return false;
}
my_getbyid("signature" + pid).style.display='block';
var info=""+lang_a['info_reading']+"";
var id = "signature" + pid;
CreatDiv(id,info);
var modeType = wMode ? 'wysiwyg' : 'bbcode';
x_returnsig(pid,content,uid,modeType,returnsig_cb);
}
function editorreset(pid,type){
thisforum = realthisforum;
if (typeof mxeDoc == 'object' && mxe == 'showarea' + pid +'W') {
var oldHTML = my_getbyid('oldHTML' + pid);
if (oldHTML) {
var html = oldHTML.value;
if (typeof(load_qmxe)=="function") {
my_getbyid("post").onclick = Function("load_qmxe()");
}
} else {
return;
}
if (type == 'text') var showDiv = my_getbyid('show' + pid);
else var showDiv = my_getbyid('signature' + pid);
showDiv.innerHTML = html;
mxe = mxeWin = mxeDoc = mxeTxa = mxeTxH = mxeEbox = mxeStatus = mxeWidth = mxeHeight = eWidth = null;
}
}
function openquick() {
if (canwMode) {
var cookiemode = get_cookie('mxeditor');
if (cookiemode == 'wysiwyg') wMode = 1;
else if (cookiemode == 'bbcode') wMode = 0;
} else wMode = 0;
if (my_getbyid('post')) {
my_getbyid('querySubmit').disabled = false;
if (typeof(load_qmxe)=="function") {
my_getbyid("post").onclick = Function("load_qmxe()");
}
if (fEdit) {
var quickREdit = my_getbyid('eDiv_postW');
if (quickREdit) {
quickREdit.parentNode.removeChild(quickREdit);
mxeditor('post', qmxemenu);
} else {
mxe = mxeWin = mxeDoc = mxeTxa = mxeTxH = mxeEbox = mxeStatus = mxeWidth = mxeHeight = eWidth = null;
}
}
if (my_getbyid('querySubmit')) my_getbyid('querySubmit').onclick = queryly;
}
}
function closedquick(){
if (typeof mxeDoc == 'object' && mxe == 'postW') {
if (fEdit) {
if (wMode) {
if (isIE) {
mxeWin.document.open();
mxeWin.document.close();
}
mxeWin.document.designMode = "off";
} else mxeTxa.readOnly = 'readonly';
var quickREdit = my_getbyid('eDiv_' + mxe);
if (quickmxemenu == "1") {
var ncBu;
for (var n in mBut) {
if(mBut[n] != '|') {
ncBu = my_getbyid(mBut[n] + '_mxButton_' + mxe);
ncBu.className = 'bu_miss';
ncBu.onmouseover = ncBu.onmouseout = ncBu.onmousedown = ncBu.onmouseup = null;
}
}
}
mxeStatus.innerHTML = lang_a['info_closequ'];
quickREdit.onmouseover = quickREdit.onmouseout = quickREdit.onmousedown = quickREdit.onmouseup = null;
}
mxe = mxeWin = mxeDoc = mxeTxa = mxeTxH = mxeEbox = mxeStatus = mxeWidth = mxeHeight = eWidth = null;
my_getbyid('querySubmit').onclick = 'function ff_c_l() {return false;}';
}
}
function returntext_cb(data){
var tmp = data.substr(data.lastIndexOf(']:::[') + 5);
var pid = data.substring(0,data.lastIndexOf(']:::['));
my_getbyid("show" + pid).innerHTML = tmp;
var showli = my_getbyid("promptinfo");
showli.style.display='none';
showli.style.visibility='hidden';
openquick();
}
function editorsend(pid){
var f = my_getbyid('forum_id').value;
mxeGet();
var content = mxeTxH.value;
var contentlength = calculate_byte(content);
if (contentlength < postminchars || contentlength > postmaxchars)
{
var info= lang_g['g_outstr']+"("+postminchars+"~"+postmaxchars+")"+lang_a['info_again']+"?";
var id = "show" + pid;
CreatDiv(id,info);
setTimeout(function() {
my_getbyid("show" + pid).innerHTML = oldHTML.value;
}, 3000);
openquick();
return false;
}
my_getbyid("show" + pid).style.display='block';
var info=""+lang_a['info_reading']+"";
var id = "show" + pid;
CreatDiv(id,info);
var modeType = wMode ? 'wysiwyg' : 'bbcode';
x_returntext(pid,content,f,modeType,returntext_cb);
}
function checkuser_cb(data){
if(data.length > 0) {
my_getbyid("Mis").style.display = 'block';
my_getbyid("ST_div").style.display = 'block';
my_getbyid("showresult_div").style.display = 'block';
document.getElementById("showresult_div").innerHTML=data;
}
}
function checkuser(){
var username = my_getbyid("addsong_text").value;
if (username.length <= 0) {
return;
}
if (username){
x_checkuser(username,checkuser_cb);
}
}
function my_getbyid(id) {
itm = null;
if (document.getElementById) {
itm = document.getElementById(id);
} else if (document.all) {
itm = document.all[id];
} else if (document.layers) {
itm = document.layers[id];
}
return itm;
}
function checkmail_cb(data){
var isok_email = my_getbyid("isok_email");
var isno_email = my_getbyid("isno_email");
var isexist_email = my_getbyid("isexist_email");
isno_email.style.display = 'none';
isok_email.style.display = 'none';
isexist_email.style.display = 'none';
if(data=='no'){
isno_email.style.display = 'block';
} else if (data=='exist') {
isexist_email.style.display = 'block';
} else if(data=='ok') {
isok_email.style.display = 'block';
}
}
function checkmail(){
var email = my_getbyid("email").value;
var isempty_email = my_getbyid("isempty_email");
if (email.length <= 0) {
isempty_email.style.display = 'block';
} else {
isempty_email.style.display = 'none';
x_checkmail(email,checkmail_cb);
}
}
function sendcolor(color,tid){
if (color == 1)
{
my_getbyid("colorf"+tid).innerHTML = ""+lang_a['info_renew']+"";
my_getbyid("titlecolor"+tid).value = "";
}
else{
my_getbyid("colorf"+tid).innerHTML = " ";
my_getbyid("titlecolor"+tid).value = color;
}
}
function showthreadin(tid){
if (my_getbyid("show" + tid)){
var oldTN = my_getbyid("show" + tid);
} else {
return false;
}
var oldTNP = oldTN.parentNode.parentNode;
for (var i=0; i<2; i++){
if (oldTN.childNodes[0].tagName) oldTN = oldTN.childNodes[0];
}
var oldHTML = document.createElement('input');
oldHTML.id = 'oldhtml'+tid;
oldHTML.type = 'hidden';
oldHTML.value = oldTNP.innerHTML;
oldTHREAD = oldTNP.innerHTML;
var text = oldTN.innerHTML.replace(/>/g,'>').replace(/</g,'<').replace(/&/g,'&');
oldTNP.innerHTML = "";
oldTNP.appendChild(oldHTML);
var textIp = my_getbyid("threadname" + tid);
textIp.value = text;
textIp.focus();
}
function CreatDiv( id , info){
var value = '';
var showli = my_getbyid("promptinfo");
showli.style.left = mxeTxH.offsetLeft + 30;
showli.style.top = mxeTxH.offsetTop + 60;
showli.style.display='block';
showli.style.visibility='visible';
my_getbyid("showinfo").innerHTML = "
";
my_getbyid("pic" + tid).innerHTML = pic;
}
}
function closet_cb(data){
var fid = data.substr(data.lastIndexOf(']:::[') + 5);
var tid = data.substring(0,data.lastIndexOf(']:::['));
if (tid || fid) {
var pic = "
";
my_getbyid("pic" + tid).innerHTML = pic;
}
}
function turnthread(tid,type,fid){
if (type == 1) x_closethread(tid, fid, closet_cb);
if (type == 0) x_openthread(tid, fid, opent_cb);
}
function edithread(tid){
if (my_getbyid("thread_c_b_sp")) closeColorSp();
var oldTN = my_getbyid("thread_c_b_" + tid);
var arrColors=[["#800000","#8b4513","#006400","#2f4f4f","#000080","#4b0082","#800080","#000000"],["#ff0000","#daa520","#6b8e23","#708090","#0000cd","#483d8b","#c71585","#696969"],["#ff4500","#ffa500","#808000","#4682b4","#1e90ff","#9400d3","#ff1493","#a9a9a9"],["#ff6347","#ffd700","#32cd32","#87ceeb","#00bfff","#9370db","#ff69b4","#dcdcdc"],["X","#ffffe0","#98fb98","#e0ffff","#87cefa","#e6e6fa","#dda0dd","#ffffff"]];
if (!my_getbyid("show" + tid)) return false;
var title = my_getbyid("show" + tid).innerHTML;
var boldck = title.toLowerCase().lastIndexOf('') == '-1' ? '' : 'checked';
var colorTableDiv = document.createElement('div');
colorTableDiv.id = 'thread_c_b_sp';
colorTableDiv.style.display = 'inline';
colorTableDiv.style.position = 'absolute';
colorTableDiv.style.border = '#7FB9F8 1px solid';
colorTableDiv.style.background = '#FFFFFF';
var chDiv = document.createElement('div');
chDiv.style.width = '124px';
chDiv.style.padding = '0px 2px 0px 2px';
chDiv.innerHTML = ""+lang_a['info_close']+" "+lang_a['info_bold']+"";
colorTableDiv.appendChild(chDiv);
var colorTable = document.createElement('table');
colorTable.cellPadding = "1";
colorTable.cellSpacing = "1";
colorTable.style.fontSize = "9px";
for (var n in arrColors)
{
var colorTR = colorTable.insertRow(-1);
for (var m in arrColors[n])
{
var colorTD = colorTR.insertCell(-1);
colorTD.id = 'forecolor_' + tid + '_sp_' + arrColors[n][m] ;
colorTD.className = 'row1';
var colorDiv = document.createElement('div');
colorDiv.style.width = '11px';
colorDiv.style.height = '11px';
colorDiv.style.border = 'white 1px solid';
colorDiv.style.fontSize = '1px';
colorDiv.style.cursor='hand';
colorDiv.onclick = chTitleColor;
colorDiv.onmouseover = changeCss1;
colorDiv.onmouseout = changeCss2;
if (arrColors[n][m] == 'X') {
colorDiv.innerHTML = 'X';
colorDiv.style.font = '11px Arial';
colorDiv.style.textAlign = 'center';
colorDiv.style.lineHeight = '11px';
}
else colorDiv.style.background = arrColors[n][m];
colorTD.appendChild(colorDiv);
}
}
colorTableDiv.appendChild(colorTable);
oldTN.appendChild(colorTableDiv);
}
function cbsend_cb(data){
var text = data.substr(data.lastIndexOf(']:::[') + 5);
var tid = data.substring(0,data.lastIndexOf(']:::['));
my_getbyid("show" + tid).innerHTML = text;
}
function changeCss1(e){
var el
if (isIE) el = window.event.srcElement;
else el = e.target;
eventid = el.parentNode;
eventid.style.backgroundColor = 'darkgray' ;
}
function changeCss2(e){
var el
if (isIE) el = window.event.srcElement;
else el = e.target;
eventid = el.parentNode;
eventid.style.backgroundColor = '';
}
function chTitleColor(e){
var el
if (isIE) el = window.event.srcElement;
else el = e.target;
eventid = el.parentNode;
var text = eventid.id;
var color = text.substr(text.lastIndexOf('_sp_') + 4);
var tid = text.substring(10,text.lastIndexOf('_sp_'));
var bold = my_getbyid("showbb" + tid).checked ? 1 : 0;
closeColorSp();
x_cbsend(tid,color,bold,cbsend_cb);
}
function closeColorSp(){
my_getbyid("thread_c_b_sp").parentNode.removeChild(my_getbyid("thread_c_b_sp"));
}
function noajax(){
//nothing
}
function quickreply_cb(data){
if (my_getbyid('querySubmit')) {
var querySubmit = my_getbyid('querySubmit');
querySubmit.disabled = false;
}
if (my_getbyid('queryPreview')) {
var queryPreview = my_getbyid('queryPreview');
queryPreview.disabled = false;
}
var showl1 = my_getbyid("promptinfo");
var showform = my_getbyid("mxbform");
var text = data.substr(data.lastIndexOf(']:::[') + 5);
var num = data.substring(0,data.lastIndexOf(']:::['));
if (num.lastIndexOf(']:::[') != -1) {
var num_tmp = num.substring(0,num.lastIndexOf(']:::['));
num = num_tmp;
}
if (num == 1)
{
isint = 1;
if (text) var info = text;
else var info = lang_a['info_ermember'];
L1show(info);
setTimeout(function() {
showl1.style.display='none';
showl1.style.visibility='hidden';
}, 6000);
var pnum = showform.pnum.value;
if (pnum > 11)
{
ppnum = parseInt(pnum);
showform.pnum.value = ppnum;
}
return;
}else{
isint = 0;
}
antim = text.substr(text.lastIndexOf('+:::+') + 5);
pagetext = text.substring(0,text.lastIndexOf('+:::+'));
if (my_getbyid("ajaxrep" + num)) my_getbyid("ajaxrep" + num).style.display = "block";
else {
if (isGecko) alert(lang_a['info_erfxre']);
else return false;
}
if (isIE) my_getbyid("ajaxrep" + num).innerHTML = pagetext;
else {
try
{
my_getbyid("ajaxrep" + num).innerHTML = pagetext;
}
catch (e)
{
numvalue = 11;
my_getbyid("ajaxrep" + numvalue).innerHTML = pagetext;
}
}
antimhash = antim.substr(antim.lastIndexOf('-:::-') + 5);
antimtext = antim.substring(0,antim.lastIndexOf('-:::-'));
var numnew = parseInt(num) + 1;
showform.pnum.value = numnew;
if (antimhash == 1 && antimtext == 1)
{
//nothing
}
else
{
if (my_getbyid("antispam")){
showform.userimagehash.value = antimhash;
my_getbyid("antispamtext").innerHTML = antimtext;
}else{
//nothing
}
}
showl1.style.display='none';
showl1.style.visibility='hidden';
openquick();
}
function queryly(){
if (my_getbyid('querySubmit'))
var querySubmit = my_getbyid('querySubmit');
querySubmit.disabled = true;
if (my_getbyid('queryPreview'))
var queryPreview = my_getbyid('queryPreview');
queryPreview.disabled = true;
var showredirect = my_getbyid("redirect").checked;
var showl1 = my_getbyid("promptinfo");
var showan = my_getbyid("antispam");
var showform = my_getbyid("mxbform");
if (showredirect == true) {
mxeGet();
showform.submit();
return false;
}
if (showan)
{
var antispam = showan.value;
}
else
{
var antispam = 1;
}
if (showan)
{
if (antispam.length != 4 || !antispam)
{
if (antispam != 1)
{
showan.value = "";
var info = lang_a['info_inmenber'];
L1show(info);
setTimeout(function() {
showl1.style.display='none';
showl1.style.visibility='hidden';
}, 3000);
}
querySubmit.disabled = false;
queryPreview.disabled = false;
return;
}
}
mxeGet();
var content = mxeTxH.value;
initData();
var contentlength = calculate_byte(content);
if ( contentlength < postminchars || contentlength > postmaxchars )
{
try
{
showan.value = "";
}
catch (e)
{
//nothing
}
var info = lang_a['info_ctis']+postminchars+"~"+postmaxchars+lang_a['info_bhstr'];
L1show(info);
querySubmit.disabled = false;
queryPreview.disabled = false;
setTimeout(function() {
showl1.style.display='none';
showl1.style.visibility='hidden';
}, 3000);
return;
}
else
{
mxeTxH.value = '';
var todo = 'update';
var s = showform.s.value;
var f = showform.f.value;
var t = showform.t.value;
var qreply = 1;
var userimagehash = showform.userimagehash.value;
var smile,signature,url,quote;
var allowsmile = showform.allowsmile.checked;
allowsmile==true?smile=1:smile=0;
var showsignature = showform.showsignature.checked;
showsignature==true?signature=1:signature=0;
var parseurl = showform.parseurl.checked;
parseurl==true?url=1:url=0;
var quotepost = showform.quotepost.checked;
quotepost==true?quote=1:quote=0;
var givecash = showform.givecash.value;
if (!givecash)
{
givecash = 0;
}
var allowbbcode = showform.allowbbcode.value;
var postnum = showform.postnum.value;
var pnum = showform.pnum.value;
var modeType = wMode ? 'wysiwyg' : 'bbcode';
x_quickreply( f, userimagehash, pnum, t, content, s, smile, signature, url, quote ,givecash ,allowbbcode ,postnum ,antispam ,qreply, modeType, quickreply_cb);
if (antispam != 1)
{
showan.value = "";
}
var info = lang_g['g_refering'];
L1show(info);
}
}
function returnpagetext_cb(data){
var html1 = data.substr(data.lastIndexOf(']:::[') + 5);
var pid = data.substring(0,data.lastIndexOf(']:::['));
var showDiv = my_getbyid('show' + pid);
var html2 = showDiv.innerHTML;
oldHTML = document.createElement('input');
oldHTML.type = 'hidden';
oldHTML.id = 'oldHTML' + pid;
oldHTML.value = html2;
if (html1.lastIndexOf('') != -1 ) html1 = html1.substring(0,html1.lastIndexOf(''));
else html1 = html1;
wMode = 1;
var showParent = showDiv.parentNode;
showDiv.innerHTML = '';
showDiv.appendChild(oldHTML);
showTxa = document.createElement('textarea');
showTxa.id = 'showarea' + pid;
showTxa.style.width = '500px';
showTxa.style.height = '300px';
showTxa.value = html1;
showDiv.appendChild(showTxa);
mxeditor('showarea' + pid);
showSubmit = document.createElement('div');
showSubmit.style.width = '500px';
showSubmit.style.height = '30px';
showSubmit.style.textAlign = 'center';
var click_se_nd = 'editorsend('+pid+')';
var type = 'text';
showSubmit.innerHTML = ' ';
showDiv.appendChild(showSubmit);
mxeWin.focus();
}
function showedit(pid,fid,bbcode,html,type,uid){
if (mxe){
if (typeof mxeDoc == 'object' && mxe.substr(0, 8) == 'showarea') {
var mxe_pid = mxeTxH.id.substr(8);
if (mxe_pid == pid) return;
editorreset(mxe_pid,oldType);
} else {
closedquick();
}
}
if (my_getbyid('querySubmit')) {
if (my_getbyid('querySubmit').disabled == true) {
my_getbyid('post').onclick = null;
} else {
my_getbyid('querySubmit').disabled = true;
}
}
oldType = type;
if (isIE) var geit = 1;
else var geit = 0;
if (type == 'text') {
thisforum = realthisforum;
x_returnpagetext(pid,returnpagetext_cb);
} else {
thisforum = 'signature';
var showDiv = my_getbyid('signature' + pid);
var html = showDiv.innerHTML;
oldHTML = document.createElement('input');
oldHTML.type = 'hidden';
oldHTML.id = 'oldHTML' + pid;
oldHTML.value = html;
if (html.lastIndexOf('') != -1 ) html = html1.substring(0,html1.lastIndexOf(''));
else html = html;
wMode = 1;
var showParent = showDiv.parentNode;
showDiv.innerHTML = '';
showDiv.appendChild(oldHTML);
showTxa = document.createElement('textarea');
showTxa.id = 'showarea' + pid;
showTxa.style.width = '300px';
showTxa.style.height = '150px';
showTxa.value = html;
showDiv.appendChild(showTxa);
mxeditor('showarea' + pid);
showSubmit = document.createElement('div');
showSubmit.style.width = '300px';
showSubmit.style.height = '30px';
showSubmit.style.textAlign = 'center';
var click_se_nd = 'sigsend('+pid+','+uid+')';
showSubmit.innerHTML = ' ';
showDiv.appendChild(showSubmit);
mxeWin.focus();
}
}
function returnsig_cb(data){
var tmp = data.substr(data.lastIndexOf(']:::[') + 5);
var pid = data.substring(0,data.lastIndexOf(']:::['));
my_getbyid("signature"+pid).innerHTML = tmp;
var showli = my_getbyid("promptinfo");
showli.style.display='none';
showli.style.visibility='hidden';
openquick();
}
function sigsend(pid,uid){
thisforum = realthisforum;
mxeGet();
var content = mxeTxH.value;
var contentlength = calculate_byte(content);
if (contentlength > postmaxchars || contentlength <= 4)
{
var info= lang_g['g_outstr']+"(4~"+postmaxchars+")"+lang_a['info_again']+".";
var id = "signature" + pid;
CreatDiv(id,info);
setTimeout(function() {
my_getbyid(id).innerHTML = oldHTML.value;
}, 3000);
openquick();
return false;
}
my_getbyid("signature" + pid).style.display='block';
var info=""+lang_a['info_reading']+"";
var id = "signature" + pid;
CreatDiv(id,info);
var modeType = wMode ? 'wysiwyg' : 'bbcode';
x_returnsig(pid,content,uid,modeType,returnsig_cb);
}
function editorreset(pid,type){
thisforum = realthisforum;
if (typeof mxeDoc == 'object' && mxe == 'showarea' + pid +'W') {
var oldHTML = my_getbyid('oldHTML' + pid);
if (oldHTML) {
var html = oldHTML.value;
if (typeof(load_qmxe)=="function") {
my_getbyid("post").onclick = Function("load_qmxe()");
}
} else {
return;
}
if (type == 'text') var showDiv = my_getbyid('show' + pid);
else var showDiv = my_getbyid('signature' + pid);
showDiv.innerHTML = html;
mxe = mxeWin = mxeDoc = mxeTxa = mxeTxH = mxeEbox = mxeStatus = mxeWidth = mxeHeight = eWidth = null;
}
}
function openquick() {
if (canwMode) {
var cookiemode = get_cookie('mxeditor');
if (cookiemode == 'wysiwyg') wMode = 1;
else if (cookiemode == 'bbcode') wMode = 0;
} else wMode = 0;
if (my_getbyid('post')) {
my_getbyid('querySubmit').disabled = false;
if (typeof(load_qmxe)=="function") {
my_getbyid("post").onclick = Function("load_qmxe()");
}
if (fEdit) {
var quickREdit = my_getbyid('eDiv_postW');
if (quickREdit) {
quickREdit.parentNode.removeChild(quickREdit);
mxeditor('post', qmxemenu);
} else {
mxe = mxeWin = mxeDoc = mxeTxa = mxeTxH = mxeEbox = mxeStatus = mxeWidth = mxeHeight = eWidth = null;
}
}
if (my_getbyid('querySubmit')) my_getbyid('querySubmit').onclick = queryly;
}
}
function closedquick(){
if (typeof mxeDoc == 'object' && mxe == 'postW') {
if (fEdit) {
if (wMode) {
if (isIE) {
mxeWin.document.open();
mxeWin.document.close();
}
mxeWin.document.designMode = "off";
} else mxeTxa.readOnly = 'readonly';
var quickREdit = my_getbyid('eDiv_' + mxe);
if (quickmxemenu == "1") {
var ncBu;
for (var n in mBut) {
if(mBut[n] != '|') {
ncBu = my_getbyid(mBut[n] + '_mxButton_' + mxe);
ncBu.className = 'bu_miss';
ncBu.onmouseover = ncBu.onmouseout = ncBu.onmousedown = ncBu.onmouseup = null;
}
}
}
mxeStatus.innerHTML = lang_a['info_closequ'];
quickREdit.onmouseover = quickREdit.onmouseout = quickREdit.onmousedown = quickREdit.onmouseup = null;
}
mxe = mxeWin = mxeDoc = mxeTxa = mxeTxH = mxeEbox = mxeStatus = mxeWidth = mxeHeight = eWidth = null;
my_getbyid('querySubmit').onclick = 'function ff_c_l() {return false;}';
}
}
function returntext_cb(data){
var tmp = data.substr(data.lastIndexOf(']:::[') + 5);
var pid = data.substring(0,data.lastIndexOf(']:::['));
my_getbyid("show" + pid).innerHTML = tmp;
var showli = my_getbyid("promptinfo");
showli.style.display='none';
showli.style.visibility='hidden';
openquick();
}
function editorsend(pid){
var f = my_getbyid('forum_id').value;
mxeGet();
var content = mxeTxH.value;
var contentlength = calculate_byte(content);
if (contentlength < postminchars || contentlength > postmaxchars)
{
var info= lang_g['g_outstr']+"("+postminchars+"~"+postmaxchars+")"+lang_a['info_again']+"?";
var id = "show" + pid;
CreatDiv(id,info);
setTimeout(function() {
my_getbyid("show" + pid).innerHTML = oldHTML.value;
}, 3000);
openquick();
return false;
}
my_getbyid("show" + pid).style.display='block';
var info=""+lang_a['info_reading']+"";
var id = "show" + pid;
CreatDiv(id,info);
var modeType = wMode ? 'wysiwyg' : 'bbcode';
x_returntext(pid,content,f,modeType,returntext_cb);
}
function checkuser_cb(data){
if(data.length > 0) {
my_getbyid("Mis").style.display = 'block';
my_getbyid("ST_div").style.display = 'block';
my_getbyid("showresult_div").style.display = 'block';
document.getElementById("showresult_div").innerHTML=data;
}
}
function checkuser(){
var username = my_getbyid("addsong_text").value;
if (username.length <= 0) {
return;
}
if (username){
x_checkuser(username,checkuser_cb);
}
}
function my_getbyid(id) {
itm = null;
if (document.getElementById) {
itm = document.getElementById(id);
} else if (document.all) {
itm = document.all[id];
} else if (document.layers) {
itm = document.layers[id];
}
return itm;
}
function checkmail_cb(data){
var isok_email = my_getbyid("isok_email");
var isno_email = my_getbyid("isno_email");
var isexist_email = my_getbyid("isexist_email");
isno_email.style.display = 'none';
isok_email.style.display = 'none';
isexist_email.style.display = 'none';
if(data=='no'){
isno_email.style.display = 'block';
} else if (data=='exist') {
isexist_email.style.display = 'block';
} else if(data=='ok') {
isok_email.style.display = 'block';
}
}
function checkmail(){
var email = my_getbyid("email").value;
var isempty_email = my_getbyid("isempty_email");
if (email.length <= 0) {
isempty_email.style.display = 'block';
} else {
isempty_email.style.display = 'none';
x_checkmail(email,checkmail_cb);
}
}
function sendcolor(color,tid){
if (color == 1)
{
my_getbyid("colorf"+tid).innerHTML = ""+lang_a['info_renew']+"";
my_getbyid("titlecolor"+tid).value = "";
}
else{
my_getbyid("colorf"+tid).innerHTML = " ";
my_getbyid("titlecolor"+tid).value = color;
}
}
function showthreadin(tid){
if (my_getbyid("show" + tid)){
var oldTN = my_getbyid("show" + tid);
} else {
return false;
}
var oldTNP = oldTN.parentNode.parentNode;
for (var i=0; i<2; i++){
if (oldTN.childNodes[0].tagName) oldTN = oldTN.childNodes[0];
}
var oldHTML = document.createElement('input');
oldHTML.id = 'oldhtml'+tid;
oldHTML.type = 'hidden';
oldHTML.value = oldTNP.innerHTML;
oldTHREAD = oldTNP.innerHTML;
var text = oldTN.innerHTML.replace(/>/g,'>').replace(/</g,'<').replace(/&/g,'&');
oldTNP.innerHTML = "";
oldTNP.appendChild(oldHTML);
var textIp = my_getbyid("threadname" + tid);
textIp.value = text;
textIp.focus();
}
function CreatDiv( id , info){
var value = '';
var showli = my_getbyid("promptinfo");
showli.style.left = mxeTxH.offsetLeft + 30;
showli.style.top = mxeTxH.offsetTop + 60;
showli.style.display='block';
showli.style.visibility='visible';
my_getbyid("showinfo").innerHTML = "