var global_firefox_kludge;
function alertAndRefocus(this_field, errmsg)
{
	if (errmsg && (errmsg != undefined) && (errmsg != ''))
		alert(errmsg.replace(/&quot;/ig, '"').replace(/''/ig, '"'));
	
	global_firefox_kludge = this_field;
	var command = "";
	if (this_field.focus)
	{
		this_field.focus();
		command = command + "global_firefox_kludge.focus(); ";
	}
	
	if (this_field.select)
	{
		this_field.select();
		command = command + "global_firefox_kludge.select(); ";
	}
	
	setTimeout(command, 50); // Kludge for Firefox problem with focus().
}
