
//=======================================================================
// RTE Stylesheet Enhancement
// Copyright (C) 2004 MyST Technology Partners
// http://myst-technology.com
//=======================================================================

var g_RTEBaseStylesheet = null;
var g_RTEStylesheet     = null;

function setRTEBaseStylesheet(stylesheet_)
{
	g_RTEBaseStylesheet = stylesheet_;
} 

function getRTEBaseStylesheet()
{
	return g_RTEBaseStylesheet;
}

function setRTEStylesheet(stylesheet_)
{
	g_RTEStylesheet = stylesheet_;
} 

function getRTEStylesheet()
{
	return g_RTEStylesheet;
}

//function getRTEPageStyle()
//{
//	var pageStyle = "";
//
//	if (g_RTEBaseStylesheet != null)
//	{
//	  pageStyle += "@import url(";
//	  pageStyle += g_RTEBaseStylesheet;
//	  pageStyle += ");\n";
//	}
//
//	if (g_RTEStylesheet != null)
//	{
//	  pageStyle += "@import url(";
//	  pageStyle += g_RTEStylesheet;
//	  pageStyle += ");\n";
//	}
//
//	return pageStyle;
//}

function stylesheetLink()
{
	var link = "";

	if (g_RTEBaseStylesheet != null)
	{
	  link += "<link rel='StyleSheet' href='";
	  link += g_RTEBaseStylesheet;
	  link += "'>\n";
	}

	if (g_RTEStylesheet != null)
	{
	  link += "<link rel='StyleSheet' href='";
	  link += g_RTEStylesheet;
	  link += "'>\n";
	}

	return link;
}

//=======================================================================
// HTML Entity Support Enhancement
// Copyright (C) 2003 MyST Technology Partners
// http://myst-technology.com
//=======================================================================

// +----------------------------------------------------+
// | HTML 4 Character Entities                          |
// | See: http://www.w3.org/TR/html4/sgml/entities.html |
// +----------------------------------------------------+

function addEntity(m_, c_, name_)
{
	m_[c_] = name_;	
}

//-----------------------------------------------------------------------
// Factory to create an HTML 4 character entity map.
function createHTML4EntityMap()
{
	var m = new Array();

	// 24.2.1 The list of characters
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

	m[160] = "nbsp";		//  no-break space = non-breaking space, U+00A0 ISOnum 
	m[161] = "iexcl";		//  inverted exclamation mark, U+00A1 ISOnum 
	m[162] = "cent";		//  cent sign, U+00A2 ISOnum 
	m[163] = "pound";		//  pound sign, U+00A3 ISOnum 
	m[164] = "curren";		//  currency sign, U+00A4 ISOnum 
	m[165] = "yen";			//  yen sign = yuan sign, U+00A5 ISOnum 
	m[166] = "brvbar";		//  broken bar = broken vertical bar, U+00A6 ISOnum 
	m[167] = "sect";		//  section sign, U+00A7 ISOnum 
	m[168] = "uml";			//  diaeresis = spacing diaeresis, U+00A8 ISOdia 
	m[169] = "copy";		//  copyright sign, U+00A9 ISOnum 
	m[170] = "ordf";		//  feminine ordinal indicator, U+00AA ISOnum 
	m[171] = "laquo";		//  left-pointing double angle quotation mark = left pointing guillemet, U+00AB ISOnum 
	m[172] = "not";			//  not sign, U+00AC ISOnum 
	m[173] = "shy";			//  soft hyphen = discretionary hyphen, U+00AD ISOnum 
	m[174] = "reg";			//  registered sign = registered trade mark sign, U+00AE ISOnum 
	m[175] = "macr";		//  macron = spacing macron = overline = APL overbar, U+00AF ISOdia 
	m[176] = "deg";			//  degree sign, U+00B0 ISOnum 
	m[177] = "plusmn";		//  plus-minus sign = plus-or-minus sign, U+00B1 ISOnum 
	m[178] = "sup2";		//  superscript two = superscript digit two = squared, U+00B2 ISOnum 
	m[179] = "sup3";		//  superscript three = superscript digit three = cubed, U+00B3 ISOnum 
	m[180] = "acute";		//  acute accent = spacing acute, U+00B4 ISOdia 
	m[181] = "micro";		//  micro sign, U+00B5 ISOnum 
	m[182] = "para";		//  pilcrow sign = paragraph sign, U+00B6 ISOnum 
	m[183] = "middot";		//  middle dot = Georgian comma = Greek middle dot, U+00B7 ISOnum 
	m[184] = "cedil";		//  cedilla = spacing cedilla, U+00B8 ISOdia 
	m[185] = "sup1";		//  superscript one = superscript digit one, U+00B9 ISOnum 
	m[186] = "ordm";		//  masculine ordinal indicator, U+00BA ISOnum 
	m[187] = "raquo";		//  right-pointing double angle quotation mark = right pointing guillemet, U+00BB ISOnum 
	m[188] = "frac14";		//  vulgar fraction one quarter = fraction one quarter, U+00BC ISOnum 
	m[189] = "frac12";		//  vulgar fraction one half = fraction one half, U+00BD ISOnum 
	m[190] = "frac34";		//  vulgar fraction three quarters = fraction three quarters, U+00BE ISOnum 
	m[191] = "iquest";		//  inverted question mark = turned question mark, U+00BF ISOnum 
	m[192] = "Agrave";		//  latin capital letter A with grave = latin capital letter A grave, U+00C0 ISOlat1 
	m[193] = "Aacute";		//  latin capital letter A with acute, U+00C1 ISOlat1 
	m[194] = "Acirc";		//  latin capital letter A with circumflex, U+00C2 ISOlat1 
	m[195] = "Atilde";		//  latin capital letter A with tilde, U+00C3 ISOlat1 
	m[196] = "Auml";		//  latin capital letter A with diaeresis, U+00C4 ISOlat1 
	m[197] = "Aring";		//  latin capital letter A with ring above = latin capital letter A ring, U+00C5 ISOlat1 
	m[198] = "AElig";		//  latin capital letter AE = latin capital ligature AE, U+00C6 ISOlat1 
	m[199] = "Ccedil";		//  latin capital letter C with cedilla, U+00C7 ISOlat1 
	m[200] = "Egrave";		//  latin capital letter E with grave, U+00C8 ISOlat1 
	m[201] = "Eacute";		//  latin capital letter E with acute, U+00C9 ISOlat1 
	m[202] = "Ecirc";		//  latin capital letter E with circumflex, U+00CA ISOlat1 
	m[203] = "Euml";		//  latin capital letter E with diaeresis, U+00CB ISOlat1 
	m[204] = "Igrave";		//  latin capital letter I with grave, U+00CC ISOlat1 
	m[205] = "Iacute";		//  latin capital letter I with acute, U+00CD ISOlat1 
	m[206] = "Icirc";		//  latin capital letter I with circumflex, U+00CE ISOlat1 
	m[207] = "Iuml";		//  latin capital letter I with diaeresis, U+00CF ISOlat1 
	m[208] = "ETH";			//  latin capital letter ETH, U+00D0 ISOlat1 
	m[209] = "Ntilde";		//  latin capital letter N with tilde, U+00D1 ISOlat1 
	m[210] = "Ograve";		//  latin capital letter O with grave, U+00D2 ISOlat1 
	m[211] = "Oacute";		//  latin capital letter O with acute, U+00D3 ISOlat1 
	m[212] = "Ocirc";		//  latin capital letter O with circumflex, U+00D4 ISOlat1 
	m[213] = "Otilde";		//  latin capital letter O with tilde, U+00D5 ISOlat1 
	m[214] = "Ouml";		//  latin capital letter O with diaeresis, U+00D6 ISOlat1 
	m[215] = "times";		//  multiplication sign, U+00D7 ISOnum 
	m[216] = "Oslash";		//  latin capital letter O with stroke = latin capital letter O slash, U+00D8 ISOlat1 
	m[217] = "Ugrave";		//  latin capital letter U with grave, U+00D9 ISOlat1 
	m[218] = "Uacute";		//  latin capital letter U with acute, U+00DA ISOlat1 
	m[219] = "Ucirc";		//  latin capital letter U with circumflex, U+00DB ISOlat1 
	m[220] = "Uuml";		//  latin capital letter U with diaeresis, U+00DC ISOlat1 
	m[221] = "Yacute";		//  latin capital letter Y with acute, U+00DD ISOlat1 
	m[222] = "THORN";		//  latin capital letter THORN, U+00DE ISOlat1 
	m[223] = "szlig";		//  latin small letter sharp s = ess-zed, U+00DF ISOlat1 
	m[224] = "agrave";		//  latin small letter a with grave = latin small letter a grave, U+00E0 ISOlat1 
	m[225] = "aacute";		//  latin small letter a with acute, U+00E1 ISOlat1 
	m[226] = "acirc";		//  latin small letter a with circumflex, U+00E2 ISOlat1 
	m[227] = "atilde";		//  latin small letter a with tilde, U+00E3 ISOlat1 
	m[228] = "auml";		//  latin small letter a with diaeresis, U+00E4 ISOlat1 
	m[229] = "aring";		//  latin small letter a with ring above = latin small letter a ring, U+00E5 ISOlat1 
	m[230] = "aelig";		//  latin small letter ae = latin small ligature ae, U+00E6 ISOlat1 
	m[231] = "ccedil";		//  latin small letter c with cedilla, U+00E7 ISOlat1 
	m[232] = "egrave";		//  latin small letter e with grave, U+00E8 ISOlat1 
	m[233] = "eacute";		//  latin small letter e with acute, U+00E9 ISOlat1 
	m[234] = "ecirc";		//  latin small letter e with circumflex, U+00EA ISOlat1 
	m[235] = "euml";		//  latin small letter e with diaeresis, U+00EB ISOlat1 
	m[236] = "igrave";		//  latin small letter i with grave, U+00EC ISOlat1 
	m[237] = "iacute";		//  latin small letter i with acute, U+00ED ISOlat1 
	m[238] = "icirc";		//  latin small letter i with circumflex, U+00EE ISOlat1 
	m[239] = "iuml";		//  latin small letter i with diaeresis, U+00EF ISOlat1 
	m[240] = "eth";			//  latin small letter eth, U+00F0 ISOlat1 
	m[241] = "ntilde";		//  latin small letter n with tilde, U+00F1 ISOlat1 
	m[242] = "ograve";		//  latin small letter o with grave, U+00F2 ISOlat1 
	m[243] = "oacute";		//  latin small letter o with acute, U+00F3 ISOlat1 
	m[244] = "ocirc";		//  latin small letter o with circumflex, U+00F4 ISOlat1 
	m[245] = "otilde";		//  latin small letter o with tilde, U+00F5 ISOlat1 
	m[246] = "ouml";		//  latin small letter o with diaeresis, U+00F6 ISOlat1 
	m[247] = "divide";		//  division sign, U+00F7 ISOnum 
	m[248] = "oslash";		//  latin small letter o with stroke, = latin small letter o slash, U+00F8 ISOlat1 
	m[249] = "ugrave";		//  latin small letter u with grave, U+00F9 ISOlat1 
	m[250] = "uacute";		//  latin small letter u with acute, U+00FA ISOlat1 
	m[251] = "ucirc";		//  latin small letter u with circumflex, U+00FB ISOlat1 
	m[252] = "uuml";		//  latin small letter u with diaeresis, U+00FC ISOlat1 
	m[253] = "yacute";		//  latin small letter y with acute, U+00FD ISOlat1 
	m[254] = "thorn";		//  latin small letter thorn, U+00FE ISOlat1 
	m[255] = "yuml";		//  latin small letter y with diaeresis, U+00FF ISOlat1 

	// 24.3.1 The list of characters
	// Mathematical, Greek and Symbolic characters for HTML
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

	/* Latin Extended-B */
	m[402] = "fnof";		//  latin small f with hook = function = florin, U+0192 ISOtech 

	/* Greek */
	m[913] = "Alpha";		//  greek capital letter alpha, U+0391 
	m[914] = "Beta";		//  greek capital letter beta, U+0392 
	m[915] = "Gamma";		//  greek capital letter gamma, U+0393 ISOgrk3 
	m[916] = "Delta";		//  greek capital letter delta, U+0394 ISOgrk3 
	m[917] = "Epsilon";		//  greek capital letter epsilon, U+0395 
	m[918] = "Zeta";		//  greek capital letter zeta, U+0396 
	m[919] = "Eta";			//  greek capital letter eta, U+0397 
	m[920] = "Theta";		//  greek capital letter theta, U+0398 ISOgrk3 
	m[921] = "Iota";		//  greek capital letter iota, U+0399 
	m[922] = "Kappa";		//  greek capital letter kappa, U+039A 
	m[923] = "Lambda";		//  greek capital letter lambda, U+039B ISOgrk3 
	m[924] = "Mu";			//  greek capital letter mu, U+039C 
	m[925] = "Nu";			//  greek capital letter nu, U+039D 
	m[926] = "Xi";			//  greek capital letter xi, U+039E ISOgrk3 
	m[927] = "Omicron";		//  greek capital letter omicron, U+039F 
	m[928] = "Pi";			//  greek capital letter pi, U+03A0 ISOgrk3 
	m[929] = "Rho";			//  greek capital letter rho, U+03A1 
	/* there is no Sigmaf, and no U+03A2 character either */
	m[931] = "Sigma";		//  greek capital letter sigma, U+03A3 ISOgrk3 
	m[932] = "Tau";			//  greek capital letter tau, U+03A4 
	m[933] = "Upsilon";		//  greek capital letter upsilon, U+03A5 ISOgrk3 
	m[934] = "Phi";			//  greek capital letter phi, U+03A6 ISOgrk3 
	m[935] = "Chi";			//  greek capital letter chi, U+03A7 
	m[936] = "Psi";			//  greek capital letter psi, U+03A8 ISOgrk3 
	m[937] = "Omega";		//  greek capital letter omega, U+03A9 ISOgrk3 

	m[945] = "alpha";		//  greek small letter alpha, U+03B1 ISOgrk3 
	m[946] = "beta";		//  greek small letter beta, U+03B2 ISOgrk3 
	m[947] = "gamma";		//  greek small letter gamma, U+03B3 ISOgrk3 
	m[948] = "delta";		//  greek small letter delta, U+03B4 ISOgrk3 
	m[949] = "epsilon";		//  greek small letter epsilon, U+03B5 ISOgrk3 
	m[950] = "zeta";		//  greek small letter zeta, U+03B6 ISOgrk3 
	m[951] = "eta";			//  greek small letter eta, U+03B7 ISOgrk3 
	m[952] = "theta";		//  greek small letter theta, U+03B8 ISOgrk3 
	m[953] = "iota";		//  greek small letter iota, U+03B9 ISOgrk3 
	m[954] = "kappa";		//  greek small letter kappa, U+03BA ISOgrk3 
	m[955] = "lambda";		//  greek small letter lambda, U+03BB ISOgrk3 
	m[956] = "mu";			//  greek small letter mu, U+03BC ISOgrk3 
	m[957] = "nu";			//  greek small letter nu, U+03BD ISOgrk3 
	m[958] = "xi";			//  greek small letter xi, U+03BE ISOgrk3 
	m[959] = "omicron";		//  greek small letter omicron, U+03BF NEW 
	m[960] = "pi";			//  greek small letter pi, U+03C0 ISOgrk3 
	m[961] = "rho";			//  greek small letter rho, U+03C1 ISOgrk3 
	m[962] = "sigmaf";		//  greek small letter final sigma, U+03C2 ISOgrk3 
	m[963] = "sigma";		//  greek small letter sigma, U+03C3 ISOgrk3 
	m[964] = "tau";			//  greek small letter tau, U+03C4 ISOgrk3 
	m[965] = "upsilon";		//  greek small letter upsilon, U+03C5 ISOgrk3 
	m[966] = "phi";			//  greek small letter phi, U+03C6 ISOgrk3 
	m[967] = "chi";			//  greek small letter chi, U+03C7 ISOgrk3 
	m[968] = "psi";			//  greek small letter psi, U+03C8 ISOgrk3 
	m[969] = "omega";		//  greek small letter omega, U+03C9 ISOgrk3 
	m[977] = "thetasym";	//  greek small letter theta symbol, U+03D1 NEW 
	m[978] = "upsih";		//  greek upsilon with hook symbol, U+03D2 NEW 
	m[982] = "piv";			//  greek pi symbol, U+03D6 ISOgrk3 

	/* General Punctuation */
	m[8226] = "bull";		//  bullet = black small circle, U+2022 ISOpub  
	/* bullet is NOT the same as bullet operator, U+2219 */
	m[8230] = "hellip";		//  horizontal ellipsis = three dot leader, U+2026 ISOpub  
	m[8242] = "prime";		//  prime = minutes = feet, U+2032 ISOtech 
	m[8243] = "Prime";		//  double prime = seconds = inches, U+2033 ISOtech 
	m[8254] = "oline";		//  overline = spacing overscore, U+203E NEW 
	m[8260] = "frasl";		//  fraction slash, U+2044 NEW 

	/* Letterlike Symbols */
	m[8472] = "weierp";		//  script capital P = power set = Weierstrass p, U+2118 ISOamso 
	m[8465] = "image";		//  blackletter capital I = imaginary part, U+2111 ISOamso 
	m[8476] = "real";		//  blackletter capital R = real part symbol, U+211C ISOamso 
	m[8482] = "trade";		//  trade mark sign, U+2122 ISOnum 
	m[8501] = "alefsym";	//  alef symbol = first transfinite cardinal, U+2135 NEW 
	/* alef symbol is NOT the same as hebrew letter alef, U+05D0 although the same glyph could be used to depict both characters */

	/* Arrows */
	m[8592] = "larr";		//  leftwards arrow, U+2190 ISOnum 
	m[8593] = "uarr";		//  upwards arrow, U+2191 ISOnum
	m[8594] = "rarr";		//  rightwards arrow, U+2192 ISOnum 
	m[8595] = "darr";		//  downwards arrow, U+2193 ISOnum 
	m[8596] = "harr";		//  left right arrow, U+2194 ISOamsa 
	m[8629] = "crarr";		//  downwards arrow with corner leftwards = carriage return, U+21B5 NEW 
	m[8656] = "lArr";		//  leftwards double arrow, U+21D0 ISOtech 
	/* ISO 10646 does not say that lArr is the same as the 'is implied by' arrow
	    but also does not have any other character for that function. So ? lArr can
	    be used for 'is implied by' as ISOtech suggests */
	m[8657] = "uArr";		//  upwards double arrow, U+21D1 ISOamsa 
	m[8658] = "rArr";		//  rightwards double arrow, U+21D2 ISOtech 
	/* ISO 10646 does not say this is the 'implies' character but does not have 
	     another character with this function so ?
	     rArr can be used for 'implies' as ISOtech suggests */
	m[8659] = "dArr";		//  downwards double arrow, U+21D3 ISOamsa 
	m[8660] = "hArr";		//  left right double arrow, U+21D4 ISOamsa 

	/* Mathematical Operators */
	m[8704] = "forall";		//  for all, U+2200 ISOtech 
	m[8706] = "part";		//  partial differential, U+2202 ISOtech  
	m[8707] = "exist";		//  there exists, U+2203 ISOtech 
	m[8709] = "empty";		//  empty set = null set = diameter, U+2205 ISOamso 
	m[8711] = "nabla";		//  nabla = backward difference, U+2207 ISOtech 
	m[8712] = "isin";		//  element of, U+2208 ISOtech 
	m[8713] = "notin";		//  not an element of, U+2209 ISOtech 
	m[8715] = "ni";			//  contains as member, U+220B ISOtech 
	/* should there be a more memorable name than 'ni'? */
	m[8719] = "prod";		//  n-ary product = product sign, U+220F ISOamsb 
	/* prod is NOT the same character as U+03A0 'greek capital letter pi' though
	     the same glyph might be used for both */
	m[8721] = "sum";		//  n-ary sumation, U+2211 ISOamsb 
	/* sum is NOT the same character as U+03A3 'greek capital letter sigma'
	     though the same glyph might be used for both */
	m[8722] = "minus";		//  minus sign, U+2212 ISOtech 
	m[8727] = "lowast";		//  asterisk operator, U+2217 ISOtech 
	m[8730] = "radic";		//  square root = radical sign, U+221A ISOtech 
	m[8733] = "prop";		//  proportional to, U+221D ISOtech 
	m[8734] = "infin";		//  infinity, U+221E ISOtech 
	m[8736] = "ang";		//  angle, U+2220 ISOamso 
	m[8743] = "and";		//  logical and = wedge, U+2227 ISOtech 
	m[8744] = "or";			//  logical or = vee, U+2228 ISOtech 
	m[8745] = "cap";		//  intersection = cap, U+2229 ISOtech 
	m[8746] = "cup";		//  union = cup, U+222A ISOtech 
	m[8747] = "int";		//  integral, U+222B ISOtech 
	m[8756] = "there4";		//  therefore, U+2234 ISOtech 
	m[8764] = "sim";		//  tilde operator = varies with = similar to, U+223C ISOtech 
	/* tilde operator is NOT the same character as the tilde, U+007E, although the same glyph might be used to represent both  */
	m[8773] = "cong";		//  approximately equal to, U+2245 ISOtech 
	m[8776] = "asymp";		//  almost equal to = asymptotic to, U+2248 ISOamsr 
	m[8800] = "ne";			//  not equal to, U+2260 ISOtech 
	m[8801] = "equiv";		//  identical to, U+2261 ISOtech 
	m[8804] = "le";			//  less-than or equal to, U+2264 ISOtech 
	m[8805] = "ge";			//  greater-than or equal to, U+2265 ISOtech 
	m[8834] = "sub";		//  subset of, U+2282 ISOtech 
	m[8835] = "sup";		//  superset of, U+2283 ISOtech 
	/* note that nsup, 'not a superset of, U+2283' is not covered by the Symbol 
	     font encoding and is not included. Should it be, for symmetry?
	     It is in ISOamsn  */ 
	m[8836] = "nsub";		//  not a subset of, U+2284 ISOamsn 
	m[8838] = "sube";		//  subset of or equal to, U+2286 ISOtech 
	m[8839] = "supe";		//  superset of or equal to, U+2287 ISOtech 
	m[8853] = "oplus";		//  circled plus = direct sum, U+2295 ISOamsb 
	m[8855] = "otimes";		//  circled times = vector product, U+2297 ISOamsb 
	m[8869] = "perp";		//  up tack = orthogonal to = perpendicular, U+22A5 ISOtech 
	m[8901] = "sdot";		//  dot operator, U+22C5 ISOamsb 
	/* dot operator is NOT the same character as U+00B7 middle dot */

	/* Miscellaneous Technical */
	m[8968] = "lceil";		//  left ceiling = apl upstile, U+2308 ISOamsc  
	m[8969] = "rceil";		//  right ceiling, U+2309 ISOamsc  
	m[8970] = "lfloor";		//  left floor = apl downstile, U+230A ISOamsc  
	m[8971] = "rfloor";		//  right floor, U+230B ISOamsc  
	m[9001] = "lang";		//  left-pointing angle bracket = bra, U+2329 ISOtech 
	/* lang is NOT the same character as U+003C 'less than' 
	     or U+2039 'single left-pointing angle quotation mark' */
	m[9002] = "rang";		//  right-pointing angle bracket = ket, U+232A ISOtech 
	/* rang is NOT the same character as U+003E 'greater than' 
	     or U+203A 'single right-pointing angle quotation mark' */

	/* Geometric Shapes */
	m[9674] = "loz";		//  lozenge, U+25CA ISOpub 

	/* Miscellaneous Symbols */
	m[9824] = "spades";		//  black spade suit, U+2660 ISOpub 
	/* black here seems to mean filled as opposed to hollow */
	m[9827] = "clubs";		//  black club suit = shamrock, U+2663 ISOpub 
	m[9829] = "hearts";		//  black heart suit = valentine, U+2665 ISOpub 
	m[9830] = "diams";		//  black diamond suit, U+2666 ISOpub 

	// 24.4.1 The list of characters
	// Special characters for HTML 
	// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

	/* C0 Controls and Basic Latin */
	m[34] = "quot";			//  quotation mark = APL quote, U+0022 ISOnum 
	m[38] = "amp";			//  ampersand, U+0026 ISOnum 
	m[60] = "lt";			//  less-than sign, U+003C ISOnum 
	m[62] = "gt";			//  greater-than sign, U+003E ISOnum 

	/* Latin Extended-A */
	m[338] = "OElig";		//  latin capital ligature OE, U+0152 ISOlat2 
	m[339] = "oelig";		//  latin small ligature oe, U+0153 ISOlat2 
	/* ligature is a misnomer, this is a separate character in some languages */
	m[352] = "Scaron";		//  latin capital letter S with caron, U+0160 ISOlat2 
	m[353] = "scaron";		//  latin small letter s with caron, U+0161 ISOlat2 
	m[376] = "Yuml";		//  latin capital letter Y with diaeresis, U+0178 ISOlat2 

	/* Spacing Modifier Letters */
	m[710] = "circ";		//  modifier letter circumflex accent, U+02C6 ISOpub 
	m[732] = "tilde";		//  small tilde, U+02DC ISOdia 

	/* General Punctuation */
	m[8194] = "ensp";		//  en space, U+2002 ISOpub 
	m[8195] = "emsp";		//  em space, U+2003 ISOpub 
	m[8201] = "thinsp";	//  thin space, U+2009 ISOpub 
	m[8204] = "zwnj";		//  zero width non-joiner, U+200C NEW RFC 2070 
	m[8205] = "zwj";		//  zero width joiner, U+200D NEW RFC 2070 
	m[8206] = "lrm";		//  left-to-right mark, U+200E NEW RFC 2070 
	m[8207] = "rlm";		//  right-to-left mark, U+200F NEW RFC 2070 
	m[8211] = "ndash";		//  en dash, U+2013 ISOpub 
	m[8212] = "mdash";		//  em dash, U+2014 ISOpub 
	m[8216] = "lsquo";		//  left single quotation mark, U+2018 ISOnum 
	m[8217] = "rsquo";		//  right single quotation mark, U+2019 ISOnum 
	m[8218] = "sbquo";		//  single low-9 quotation mark, U+201A NEW 
	m[8220] = "ldquo";		//  left double quotation mark, U+201C ISOnum 
	m[8221] = "rdquo";		//  right double quotation mark, U+201D ISOnum 
	m[8222] = "bdquo";		//  double low-9 quotation mark, U+201E NEW 
	m[8224] = "dagger";		//  dagger, U+2020 ISOpub 
	m[8225] = "Dagger";		//  double dagger, U+2021 ISOpub 
	m[8240] = "permil";		//  per mille sign, U+2030 ISOtech 
	m[8249] = "lsaquo";		//  single left-pointing angle quotation mark, U+2039 ISO proposed 
	/* lsaquo is proposed but not yet ISO standardized */
	m[8250] = "rsaquo";		//  single right-pointing angle quotation mark, U+203A ISO proposed 
	/* rsaquo is proposed but not yet ISO standardized */
	m[8364] = "euro";		//  euro sign, U+20AC NEW 

	return m;
}

//-----------------------------------------------------------------------
// Singleton character entity map instance.  Use entityMap() to access.
var g_EntityMap = null;

function entityMap()
{
	if (g_EntityMap == null)
	{
		g_EntityMap = createHTML4EntityMap();
	}

	return g_EntityMap;
}
//-----------------------------------------------------------------------
// Translates a non-ASCII character code into an entity.
function translateEntity(c_)
{
	var entityName = entityMap()[c_];

	if (entityName == null)
	{
		return "&#" + c_ + ";";
	}

	return "&" + entityName + ";";
}

//-----------------------------------------------------------------------
// Translates a string containing HTML and converts all non-ASCII
// characters to HTML entities.
function translateEntities(s_)
{
	var i = 0;
	var j = 0;
	var n = s_.length;

	var result = new String();

	// Loop to translate [i, n) in s_.
	while (i < n)
	{
		// Find span of ASCII characters [i, j) in s_.
		while (j < n && s_.charCodeAt(j) < 128)
		{
			++j;
		}

		// Copy span of ASCII characters to result.
		if (i < j)
		{
			result += s_.substring(i, j);
		}

		// Translate span of non-ASCII beginning at [j] to entities.
		while (j < n && !(s_.charCodeAt(j) < 128))
		{
			result += translateEntity(s_.charCodeAt(j++));
		}

		// This leaves [i, n) un-translated.
		i = j;
	}

	return result;
}

// +----------+
// | Get HTML |
// +----------+

//-----------------------------------------------------------------------
//// Retrieves the HTML from a rich edit control.
//function editor_getHTMLContent(objname_)
//{
//	var htmlContent = null;
//
//	var editor_obj = getObj("_" +objname_ + "_editor");    // editor object
//
//	if (editor_obj.tagName.toLowerCase() == 'iframe')
//	{
//alert("Editor is in WYSIWYG mode.");
//		// Editor is in WYSIWYG mode.
//		// We need to translate HTML entities in the content.
//		var editdoc = editor_obj.contentWindow.document;
//	    var textContent = editdoc.body.createTextRange().htmlText;
//		htmlContent = translateEntities(textContent);
//	}
//	else
//	{
//alert("Editor is in TEXTMODE (viewing raw HTML source).");
//		// Editor is in TEXTMODE (viewing raw HTML source).
//		// Return content as-is.
//		htmlContent = editor_obj.value;
//	}
//alert(htmlContent);
//	return htmlContent;
//}

//=======================================================================
// End of HTML Entity Support Enhancement
//=======================================================================
