var fontElms;
// grab all elements with custom font, and hide them from the start:
$(function(){
  fontElms = $('#details h2, #banner h1 span, #content #main h1, .content h1, .content h2, .content h3, #footer h1, #actions a').css('visibility', 'hidden');
});
// font loader:
WebFontConfig = {
  custom: {
    families: [ 'MarketingScript' ],
    urls: [ 'css/bmg-master/fonts.css' ]
  },
  loading: function() {},
  fontloading: function(fontFamily, fontDescription) {},
  fontactive: function(fontFamily, fontDescription) {},
  fontinactive: function(fontFamily, fontDescription) {},
  active: function() {
    try{
      fontElms.hide().css('visibility', 'visible').fadeIn();
    }catch(e){}
  },
  inactive: function() {
    fontElms.css('visibility', 'visible');
  }
};
(function() {
  var wf = document.createElement('script');
  wf.src = ('https:' == document.location.protocol ? 'https' : 'http') +
      '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
  wf.type = 'text/javascript';
  wf.async = 'true';
  var s = document.getElementsByTagName('script')[0];
  s.parentNode.insertBefore(wf, s);
})();
