function paste(name)  
{  
document.commentform.comment.value+="<strong>"+name+"</strong>\n";  
}  
  
function Insert(text){  
if (text!="") paste4("<blockquote>"+text+"</blockquote>\n", 0);  
}  
function paste4(text, flag){  
if (document.commentform) {  
if ((document.selection)&&(flag)) {  
document.commentform.comment.focus();  
document.commentform.document.selection.createRange().text = text;  
} else document.commentform.comment.value += text;  
}  
}  
  
function get_selection() {  
if(navigator.userAgent.search(/webkit/i) > -1) {  
selection = window.getSelection();  
} else {  
if (document.getSelection){  
selection = document.getSelection();  
selection = selection.replace(/\r\n\r\n/gi, "_doublecaret_");  
selection = selection.replace(/\r\n/gi, " ");  
while (selection.indexOf("  ") !=-1) selection = selection.replace(/  /gi, "");  
selection = selection.replace(/_doublecaret_/gi, "\r\n\r\n");  
} else {  
selection = document.selection.createRange().text;  
}  
}  
}  

