// use setTimeout workaround to delay checkmark the menu
// when onmenucomplete is ready then use it instead of oncreate
// see bug 78290 for the detail
UpdateCurrentMailCharset();
setTimeout(UpdateCurrentMailCharset, 0);
UpdateCharsetDetector();
setTimeout(UpdateCharsetDetector, 0);
}
var gCharsetMenu = Components.classes['@mozilla.org/rdf/datasource;1?name=charset-menu'].getService().QueryInterface(Components.interfaces.nsICurrentCharsetListener);
var gLastBrowserCharset = null;
function charsetLoadListener (event)
{
var charset = window._content.document.characterSet;
if (charset.length > 0 && (charset != gLastBrowserCharset)) {
gCharsetMenu.SetCurrentCharset(charset);
gPrevCharset = gLastBrowserCharset;
gLastBrowserCharset = charset;
}
}
function composercharsetLoadListener (event)
{
var charset = window._content.document.characterSet;
if (charset.length > 0 ) {
gCharsetMenu.SetCurrentComposerCharset(charset);
}
}
function SetForcedEditorCharset(charset)
{
if (charset.length > 0 ) {
gCharsetMenu.SetCurrentComposerCharset(charset);
}
EditorSetDocumentCharacterSet(charset);
}
var gLastMailCharset = null;
function mailCharsetLoadListener (event)
{
if (msgWindow) {
var charset = msgWindow.mailCharacterSet;
if (charset.length > 0 && (charset != gLastMailCharset)) {