function sayit()
{
	if (document.getSelection) // older Mozilla versions
	{
		var selectedString = document.getSelection();
	}
	else if (document.all) // MSIE 4+
	{
		var selectedString = document.selection.createRange().text;
	}
	else if (window.getSelection) // recent Mozilla versions
	{
		var selectedString = window.getSelection();
	}

	if(document.rs_form)
	{
		document.rs_form.rstext.value = selectedString;
	}
/*
	if(document.rs_form)
	{
		if(document.rs_form.rstext)
		{
			alert(document.rs_form.rstext.value);
			if(document.rs_form.rstext.value)
			{
				if(selectedString)
				{
					alert(selectedString);
					document.rs_form.rstext.value = selectedString;
				}
			}
		}
	}
*/
	if (window.location.href)
	{
		if(document.rs_form)
		{
			document.rs_form.url.value = window.location.href;
		}
		
		/*
		if(document.rs_form)
			if(document.rs_form.url)
				if(document.rs_form.url.value)
					document.rs_form.url.value = window.location.href;
		*/
	}
	else if (document.location.href)
	{
		if(document.rs_form)
		{
			document.rs_form.url.value = document.location.href;
		}
		/*
		if(document.rs_form)
			if(document.rs_form.url)
				if(document.rs_form.url.value)
					document.rs_form.url.value = document.location.href;
		*/
	}
}

function copyselected()
{
	setTimeout("sayit()",50);
	return true;
}
