var enabled = 1;
var saveOpen = window.open;
window.open = emptyOpen;
var dummy = "";

function emptyOpen()
{
	return null;
}

function toggle()
{
	if (enabled == 1) 
	{
		enabled = 0;
		top.uframe.document.getElementById('button_trans').value = 'Aktywuj';
	}
	else
	{
		enabled = 1;
		top.uframe.document.getElementById('button_trans').value = 'Deaktywuj';
	}
}

function getSel()
{
	if (document.getSelection) txt = document.getSelection();
	else if (document.selection) txt = document.selection.createRange().text;
	else return;
	return txt;
}

function handle_mouseup()
{
	if (getSel()) load_url();
}

function load_url()
{
	if (!enabled) return;
	word = getSel();
//	restoreOpen();
	top.open('http://www.ling.pl/ling/miniling.php4?from=1&word=' + word, "miniLING", "scrollbars=yes,width=350,height=150,top=0,left=0,resizable=1");
//	disableOpen();
}

