// $Id: ao.core.js 3757 2010-03-15 13:26:48Z egarciagu $

/*
 * @file
 *
 * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque dignissim,
 * neque varius auctor pretium, sapien turpis tempor purus, eu mattis urna massa
 * nec elit. Integer suscipit volutpat velit in scelerisque.
 */

var Plataforma = Plataforma || {'settings': {}, 'behaviors': {}};

/**
 * Set the variable that indicates if JavaScript behaviors should be applied
 */
Plataforma.jsEnabled = document.getElementsByTagName && document.createElement && document.createTextNode && document.documentElement && document.getElementById;

Plataforma.attachBehaviors = function(context) {
  context = context || document;
  if (Plataforma.jsEnabled) {
    // Execute all of them.
    jQuery.each(Plataforma.behaviors, function() {
      this(context);
    });
  }
};

Plataforma.freezeHeight = function () {
  Plataforma.unfreezeHeight();
  var div = document.createElement('div');
  $(div).css({
    position: 'absolute',
    top: '0px',
    left: '0px',
    width: '1px',
    height: $('body').css('height')
  }).attr('id', 'freeze-height');
  $('body').append(div);
};

Plataforma.unfreezeHeight = function () {
  $('#freeze-height').remove();
};


// Global Killswitch on the <html> element
if (Plataforma.jsEnabled)
{
  // Global Killswitch on the <html> element
  $(document.documentElement).addClass('js');
  // 'js enabled' cookie
  document.cookie = 'has_js=1; path=/';
  // Attach all behaviors.
  $(document).ready(function() {
    Plataforma.attachBehaviors(this);
  });
}
