var spell_path = '';

function spellcheck(control)
{
	if (typeof control == 'object')
	{
		control = control.id;
	}
	var spellcheck_win = window.open(spell_path + '/spell_checker.php?field=' + control, 'spellcheck', 'status=no,location=no,directories=no,menubar=no,toolbar=no,scrollbars=yes,height=360,width=500,resizable=yes');
	spellcheck_win.focus();
	
	return false;
}

function check_spelling(control)
{
	if (typeof control == 'object')
	{
		control = control.id;
	}
	var spellcheck_win = window.open(spell_path + '/spell_checker.php?field=' + control, 'spellcheck', 'status=no,location=no,directories=no,menubar=no,toolbar=no,scrollbars=yes,height=360,width=500,resizable=yes');
	spellcheck_win.focus();
	
	return false;
}

function suggestions_onclick(control) 
{
	control.form.change_to.value = control.options[control.selectedIndex].value;
}

function suggestions_ondblclick(control)
{
	control.form.change_to.value = control.options[control.selectedIndex].value;
	control.form.action.value = 'change';
	control.form.submit();
}

function init_checker(control_id)
{
	self.focus();
	orig = top.opener.document.getElementById(control_id);
	document.forms[0].field.value = control_id;
	document.forms[0].working_text.value = orig.value;
	document.forms[0].submit();
}

function save_changes(control)
{
	orig = top.opener.document.getElementById(control.form.field.value);
	orig.value = control.form.working_text.value;
}

