var selectedText = quoteAuthor = '';

function quoteSelection()
{
	theSelection = false;
	if (selectedText) theSelection = selectedText;
	else if (document.selection && document.selection.createRange) theSelection = document.selection.createRange().text;

	if (theSelection)
	{
		var fck = FCKeditorAPI.GetInstance('tresc');
		fck.InsertHtml('[q|' + quoteAuthor + '|q]' + theSelection + '[/q]');
		document.form.tresc.focus();
		selectedText = quoteAuthor = theSelection = '';
		return;
	}
	else
	{
		alert(no_text_selected);
	}
}
function qu(username)
{
	if (window.getSelection && window.getSelection() || document.selection && document.selection.createRange && document.selection.createRange().text)
	{
		return true;
	}
	else
	{
		return false;
	}
}

function qc()
{
	if (document.form && document.form.tresc)
	{
		quoteSelection();
		return false;
	}
}

function qo()
{
	selectedText = document.selection? document.selection.createRange().text : document.getSelection();
}
