/**
 * ACE Family and Search Application
 * This application contains the ExpressShop and ProductComparison
 * functionality for the family page.
 *
 * @author Christian Bradley - bradleyc@gsicommerce.com
 * @version 1.0
 */
// Set the classpath for the javascript includes
GSI.NameSpace.setClassPath("/common/");

// Register the application with GSI Core API
GSI.Application.create("GSI.Application.ACE.FamilySearch");

// Set the requirements for this application
// The associated scripts will be dynamically imported into the DOM
GSI.Application.ACE.FamilySearch.requires = [ "GSI.Cookie", "GSI.Position","GSI.Dimensions","GSI.Mouse","/include/ExpressShop.js","/include/ProductComparison.js"];

/**
 * A cached list of select boxes
 * @type Array
 */
GSI.Application.ACE.FamilySearch.selects = undefined;

/**
 * Hide or show select boxes for IE
 * @param {Boolean} visible   Flag to show or hide the selects
 */
GSI.Application.ACE.FamilySearch.toggleSelects = function( visible )
{
  try
  {
    if( !GSI.Browser.is("IE") ){ return; }
    if( this.selects === undefined ) { this.selects = $$("select"); }
    var i,len,sel;
    for( i=0,len=this.selects.length;i<len;i++ )
    {
      sel = $(this.selects[i]);
      if( visible ) { sel.show(); }
      else { sel.hide(); }
    }
  }catch(e){}
};


/**
 * Initialize the Application
 */
GSI.Application.ACE.FamilySearch.initialize = function()
{
  if( expressShopActive ) { ExpressShop.initialize(); }
  ProductComparison.initialize();
};

