var selection='';

function Insert(text) {
if(text!="") {
paste("[i]> "+text+"[/i]",0);
}else{
alert('Выделите текст для цитирования.');
}
}

function paste(text,flag) {
if((document.selection)&&(flag)) {
document.addform.message.focus();
document.addform.document.selection.createRange().text = text;
}else{
document.addform.message.value += text;
}
}

function get_selection() {
if(window.getSelection) {
selection = window.getSelection();
}else{
selection = document.selection.createRange().text;
}
}