function replyfloor_seccodeimg(obj) { document.getElementById('replyfloor_seccodeverify').value = ''; var tmprandom = 'S' + Math.floor(Math.random() * 1000); obj.src = 'misc.php?mod=seccode&update='+ tmprandom+'&idhash=replyfloor'; } function replyfloor_strLenCalc(obj, checklen, maxlen) { var v = obj.value, charlen = 0, maxlen = !maxlen ? 200 : maxlen, curlen = maxlen, len = v.length; for(var i = 0; i < v.length; i++) { if(v.charCodeAt(i) < 0 || v.charCodeAt(i) > 255) { curlen -= charset == 'utf-8' ? 2 : 1; } } if(curlen >= len) { document.getElementById(checklen).innerHTML = curlen - len; } else { len = 0; var ret = ''; for(var i = 0; i < v.length; i++) { len += v.charCodeAt(i) < 0 || v.charCodeAt(i) > 255 ? (charset == 'utf-8' ? 3 : 2) : 1; if(len > maxlen) { break; } ret += v.substr(i, 1); } obj.value = ret; } } function replyfloor_insertunit(key, text, textend, moveend, selappend) { if(document.getElementById(key + 'message')) { document.getElementById(key + 'message').focus(); } textend = isUndefined(textend) ? '' : textend; moveend = isUndefined(textend) ? 0 : moveend; selappend = isUndefined(selappend) ? 1 : selappend; startlen = text.length; endlen = textend.length; if(!isUndefined(document.getElementById(key + 'message').selectionStart)) { if(selappend) { var opn = document.getElementById(key + 'message').selectionStart + 0; if(textend != '') { text = text + document.getElementById(key + 'message').value.substring(document.getElementById(key + 'message').selectionStart, document.getElementById(key + 'message').selectionEnd) + textend; } document.getElementById(key + 'message').value = document.getElementById(key + 'message').value.substr(0, document.getElementById(key + 'message').selectionStart) + text + document.getElementById(key + 'message').value.substr(document.getElementById(key + 'message').selectionEnd); if(!moveend) { document.getElementById(key + 'message').selectionStart = opn + text.length - endlen; document.getElementById(key + 'message').selectionEnd = opn + text.length - endlen; } } else { text = text + textend; document.getElementById(key + 'message').value = document.getElementById(key + 'message').value.substr(0, document.getElementById(key + 'message').selectionStart) + text + document.getElementById(key + 'message').value.substr(document.getElementById(key + 'message').selectionEnd); } } else if(document.selection && document.selection.createRange) { var sel = document.selection.createRange(); if(!sel.text.length && document.getElementById(key + 'message').sel) { sel = document.getElementById(key + 'message').sel; document.getElementById(key + 'message').sel = null; } if(selappend) { if(textend != '') { text = text + sel.text + textend; } sel.text = text.replace(/\r?\n/g, '\r\n'); if(!moveend) { sel.moveStart('character', -endlen); sel.moveEnd('character', -endlen); } sel.select(); } else { sel.text = text + textend; } } else { document.getElementById(key + 'message').value += text; } if(document.getElementById(key + 'message').onchange){ document.getElementById(key + 'message').onchange(); } } function replyfloor_showcolorbox(key, bgcolor) { var tag1 = !bgcolor ? 'color' : 'backcolor', tag2 = !bgcolor ? 'forecolor' : 'backcolor'; var coloroptions = ['Black', 'Sienna', 'DarkOliveGreen', 'DarkGreen', 'DarkSlateBlue', 'Navy', 'Indigo', 'DarkSlateGray', 'DarkRed', 'DarkOrange', 'Olive', 'Green', 'Teal', 'Blue', 'SlateGray', 'DimGray', 'Red', 'SandyBrown', 'YellowGreen', 'SeaGreen', 'MediumTurquoise', 'RoyalBlue', 'Purple', 'Gray', 'Magenta', 'Orange', 'Yellow', 'Lime', 'Cyan', 'DeepSkyBlue', 'DarkOrchid', 'Silver', 'Pink', 'Wheat', 'LemonChiffon', 'PaleGreen', 'PaleTurquoise', 'LightBlue', 'Plum', 'White']; var colortexts = ['黑色', '赭色', '暗橄榄绿色', '暗绿色', '暗灰蓝色', '海军色', '靛青色', '墨绿色', '暗红色', '暗桔黄色', '橄榄色', '绿色', '水鸭色', '蓝色', '灰石色', '暗灰色', '红色', '沙褐色', '黄绿色', '海绿色', '间绿宝石', '皇家蓝', '紫色', '灰色', '红紫色', '橙色', '黄色', '酸橙色', '青色', '深天蓝色', '暗紫色', '银色', '粉色', '浅黄色', '柠檬绸色', '苍绿色', '苍宝石绿', '亮蓝色', '洋李色', '白色']; var str = ''; for(var i = 0; i < 40; i++) { str += ''; } if(document.getElementById(key + 'attribute').className == key + 'showcolorbox'){ if(document.getElementById(key + 'attribute').innerHTML){ document.getElementById(key + 'attribute').innerHTML = ''; }else{ document.getElementById(key + 'attribute').innerHTML = str; } }else{ document.getElementById(key + 'attribute').className = key + 'showcolorbox'; document.getElementById(key + 'attribute').innerHTML = str; } } function replyfloor_showsmilebox(key) { if(typeof smilies_type == 'undefined') { var scriptNode = document.createElement("script"); scriptNode.type = "text/javascript"; scriptNode.charset = charset ? charset : (navigator.userAgent.toLowerCase().indexOf('firefox') != -1 ? document.characterSet : document.charset); scriptNode.src = 'data/cache/common_smilies_var.js?' + VERHASH; document.getElementsByTagName('head')[0].appendChild(scriptNode); scriptNode.onload = function() { replyfloor_smilies_onload(key); }; } else { replyfloor_smilies_onload(key); } } function replyfloor_smilies_onload(key) { if(typeof smilies_type == 'object') { for(i in smilies_array) { type = i;break; } str = '