var selection;

function q(author,date,postid){ 
var itm = null;
if (selection!="") {
	  if (document.getElementById) {
		itm = document.getElementById('qr_open');
	  } else if (document.all){
		itm = document.all['qr_open'];
	  } else if (document.layers){
		itm = document.layers['qr_open'];
	  }
	
	  if (!itm) {
	   // do nothing
	  }
	  else if (itm.style) {
		 itm.style.display = ""; 
	  }
	  else { itm.visibility = "show"; }
scroll(0,10000);
// отличие от оригинального скрипта Сусанина в том, что его код позволят совершать подлог в цитировании
// так, выделяя текст в одном посте, а тыкая кнопку "цитата" в другом посте
// можно присвоить цитируемую реплику другому человеку
// нахуй обиды по этому поводу. коль читаешь топик, утрудись понять кто-кого цитирует без всяких подсказок
paste("[quote]"+selection+"[/quote]\n", 0);}
else alert ("Выделите цитируемую реплику мышью!");
}

function paste(text, flag){
if (document.REPLIER) 
	{
	if ((document.selection)&&(flag)) 
		{
		document.REPLIER.Post.focus();
		document.REPLIER.document.selection.createRange().text = text;
		}
		else document.REPLIER.Post.value += text;
	}
}
	
function g() {
if (document.getSelection)
	{
	selection = document.getSelection();
  }
else if (window.getSelection)
	{
	selection = window.getSelection();
	}
else
  selection = document.selection.createRange().text;
}

