function getSelectedText(){return window.getSelection?window.getSelection().toString():document.getSelection?document.getSelection():document.selection?document.selection.createRange().text:!1}function onTextReceived(a){for(var b="",c=0;c<a.getElementsByTagName("quote")[0].childNodes.length;c++)b+=a.getElementsByTagName("quote")[0].childNodes[c].nodeValue;"undefined"!=typeof oEditorHandle_message&&oEditorHandle_message.bRichTextEnabled?(dQuoteText?oEditorHandle_message.insertText(b.match(/^\[quote(.*)]/gi)+dQuoteText+"[/quote]<br />",!1,!0):oEditorHandle_message.insertText(b+"<br />",!1,!0),oEditorHandle_message.focus()):(document.forms.postmodify.message.value+=dQuoteText?b.match(/^\[quote(.*)]/gi)+dQuoteText+"[/quote]\n":b+"\n",document.forms.postmodify.message.focus()),dQuoteText="",ajax_indicator(!1)}function insertReplyText(a){return dQuoteText=getSelectedText(),""==dQuoteText&&"undefined"!=typeof oQuickReply&&oQuickReply.bCollapsed?!0:(ajax_indicator(!0),getXMLDocument(smf_prepareScriptUrl(smf_scripturl)+"action=quotefast;quote="+a+";xml;pb=message",onTextReceived),"undefined"!=typeof oQuickReply&&oQuickReply.bCollapsed&&oQuickReply.swap(),window.location.hash="#quickreply",!1)}var dQuoteText;"undefined"!=typeof oQuickReply&&(oQuickReply.quote=insertReplyText),"undefined"!=typeof oEditorHandle_message&&(insertQuoteFast=insertReplyText);