function popup(text)
{
  alert(text);
}

function formUnicodeEscape()
{
	// For all fields on all forms, escape unsafe unicode values
	// to HTML entities. This is mostly for foreign languages or copy-and-paste
	// horrors from MS word.

	for( var formIndex = 0; formIndex < document.forms.length; formIndex++ )
	{
		var form = document.forms[formIndex];
		for( var fieldIndex = 0; fieldIndex < form.length; fieldIndex++ )
		{
			var str = form[fieldIndex].value
			if( str.match( "[\u0080-\uFFFF]" ) ) {
				var newstr = "";
				for( var index = 0; index < str.length; index++ )
				{
					var c = str.charCodeAt( index );
					newstr += c >= 0x80 ?("&#" + c + ";") : str.charAt( index );
				}
				form[fieldIndex].value = newstr;
			}
		}
	}
}

