text: fontdetect=function(){var _isInitialized=false;var _aFallbackFonts=["serif","sans-serif","monospace","cursive","fantasy"];function _init(){if(_isInitialized){return;}_isInitialized=true;$("body > :first-child").before('<div id="fontdetectHelper"><span>abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ</span></div>');$("#fontdetectHelper").css({"position":"absolute","visibility":"hidden","top":"-200px","left":"-100000px","width":"100000px","height":"200px","font-size":"100px"});}return{onFontLoaded:function(p_cssFontName,p_onLoad,p_onFail,p_options){if(!p_cssFontName){return;}var msInterval=(p_options&&p_options.msInterval)?p_options.msInterval:100;var msTimeout=(p_options&&p_options.msTimeout)?p_options.msTimeout:2000;if(!p_onLoad&&!p_onFail){return;}if(!_isInitialized){_init();}if(this.isFontLoaded(p_cssFontName)){if(p_onLoad){p_onLoad(p_cssFontName);}return;}var outerThis=this;var utStart=new Date().getTime();var idInterval=setInterval(function(){if(outerThis.isFontLoaded(p_cssFontName)){clearInterval(idInterval);p_onLoad(p_cssFontName);return;}else{var utNow=new Date().getTime();if((utNow-utStart)>msTimeout){clearInterval(idInterval);if(p_onFail){p_onFail(p_cssFontName);}}}},msInterval);},isFontLoaded:function(p_cssFontName){var wThisFont=0;var wPrevFont=0;if(!_isInitialized){_init();}for(var ix=0;ix<_aFallbackFonts.length;++ix){var $helperSpan=$("#fontdetectHelper > SPAN");$helperSpan.css("font-family",p_cssFontName+","+_aFallbackFonts[ix]);wThisFont=$helperSpan.width();if(ix>0&&wThisFont!=wPrevFont){return false;}wPrevFont=wThisFont;}return true;},whichFont:function(p_element){var sStack=$(p_element).css("font-family");var aStack=sStack.split(",");var sFont=aStack.shift();while(sFont){sFont=sFont.replace(/^\s*['"]?\s*([^'"]*)\s*['"]?\s*$/,"$1");if(this.isFontLoaded(sFont)){return sFont;}sFont=aStack.shift();}return null;}};}();
  