var isound_tts_text;
var isound_timerID;

function isound_copySelection2()
{
	setTimeout("isound_copySelectionTimeout2()",50);
	return true;
}

function isound_copySelectionTimeout2()
{
	window.top.menu.g_isound_tts_text = "";
	// window.getSelection for >= NS6, Firefox, Safari
	if (window.getSelection)
	{
		// get the selected text
		window.top.menu.g_isound_tts_text = "" + window.getSelection();
	}
	// document.getSelection for <= NS6, Opera
	else if (document.getSelection)
	{
		// get the selected text
		window.top.menu.g_isound_tts_text = "" + document.getSelection();
	}
	// document.selection for IE
	else if (document.selection)
	{
		// get the selected text
		window.top.menu.g_isound_tts_text = "" + document.selection.createRange().text;
	}
}

function isound_copyText(text)
{
	isound_tts_text = "" + text;
	isound_timerID = setTimeout("isound_copyTextTimeout2()",1000);
	return true;
}

function isound_copyText2(text)
{
	isound_tts_text = "" + text;
	isound_timerID = setTimeout("isound_copyTextTimeout3()",1000);
	return true;
}

function isound_stopText() 
{
	clearTimeout(isound_timerID);
}

function isound_copyTextTimeout2()
{
	window.top.menu.g_isound_tts_text = "" + isound_tts_text; 
}

function isound_copyTextTimeout3()
{
	window.top.menu.g_isound_tts_text = "" + isound_tts_text; 
	window.top.menu.isound_saySelection2(window.top.menu.streamID)
}
