function InsertQuote(qname)
{
	var text = get_selection().toString();
	if (text != "")
	{
		var all_text = "[quote "+qname+"]"+text+"[/quote]\n\n";
		document.forms['post_form'].body.value += all_text;
		document.getElementById('phorum_textarea').focus();
		scrollTo(0, document.getElementById('phorum-post-form').offsetTop);
	}	
}

function get_selection()
{
	if (window.getSelection)
	{
		return window.getSelection();
	} else
		return document.selection.createRange().text;
}


function InsertNick(qname)
{
	if (qname != "")
	{
		document.forms['post_form'].body.value += "to [b]" + qname + ":[/b]\n\n";
		document.getElementById('phorum_textarea').focus();
		scrollTo(0, document.getElementById('phorum-post-form').offsetTop);
	}	
}
