// Example "init" script for all the common utility modules contained in this folder.

if (typeof(fontSizer) != "undefined") {
  fontSizer.init();
}

if(typeof(popupLinks) != "undefined")
{     
      var windowSettings = ["_blank", "width=100,height=100,toolbar=no,menubar=no,status=no,scrollbars=no,location=no"];
      var flashWindow = ["flash", "width=500,height=375,toolbar=no,menubar=no,status=no,scrollbars=no,location=no"];

      popupLinks.init({
        "popup"    : windowSettings,
        "flash"       : flashWindow
      });
}

if(typeof(autoValidate) != "undefined")
{  
  defangForm.resetButtons.init(); // make "reset" buttons more safe
  defangForm.enterKey.init();     // disable submit form with Enter
  autoValidate.init();            // automaticall
}

if (window.collapseSections)
{
  collapseSections.config['div.mnav ul.level1 > li.haskids'] = {
    handle      : 'mnav',
    headSel     : 'a',
    onOpen      : function (e) { jQuery(DOM.lastElmOf(this)).slideDown(200); },
    onClose     : function (e) { var elm = DOM.lastElmOf(this); if (DOM.getStyle(elm, 'display') != 'none') { jQuery(elm).slideUp(100); } },
    clickToggle : false,
    hoverOpen   : true,
    hoverClose  : true
  };
  collapseSections.init();
}


// Remove the temporary <style id="noContentFlashHack" /> element created by the file removeflicker.js
// running this function here gives faster results than hooking it to the window.onload event.
(function(){

  var c = DOM.$("noContentFlashHack");
  if (c) { c.parentNode.removeChild(c); }

})();


