Файл: tjersy.worldbyte.net/inc/functions/js.js
Строк: 39
<?php
function tag(text1, text2) {
if ((document.selection)) {
document.message.msg.focus();
document.message.document.selection.createRange().text = text1+document.message.document.selection.createRange().text+text2;
} else if(document.forms['message'].elements['msg'].selectionStart!=undefined) {
var element = document.forms['message'].elements['msg'];
var str = element.value;
var start = element.selectionStart;
var length = element.selectionEnd - element.selectionStart;
element.value = str.substr(0, start) + text1 + str.substr(start, length) + text2 + str.substr(start + length);
document.forms['message'].elements['msg'].focus();
} else document.message.msg.value += text1+text2;
document.forms['message'].elements['msg'].focus();}
?>