(function(){
function copypaste(inj_text) {
	// create html
	var inj_html = inj_text
		.replace("[link]", "<a href='"+document.location.href+"'>")
		.replace("[/link]", "</a>")
		.replace("[title/]", document.title);
	// create full injection node and insert into dom
	var inj_node = $("<span style='position:absolute;left:-10000px;'><br/>"+inj_html+"</span>");
	// de-jquery it and store this on the check function
	arguments.callee.check.inj = inj_node[0];
	$("body").append(inj_node).mouseup(arguments.callee.check);
}
copypaste.check = function() {
	// create a new range around the injected node
	var e = document.createRange();
	e.selectNode(arguments.callee.inj);
	// then add this node to the current selection
	window.getSelection().addRange(e);
}
jQuery.copypaste = copypaste;
//
})();
