/* $Id$ */

/**
 * Attaches the debugging behavior.
 */
(function($) {
  Drupal.behaviors.incubatorThemeSiteName = {
    attach: function (context) {
      $('body', context).once('header-resizing', function() {
        var compareHeight;
        var detector;
        var headerGroup;
        headerGroup = $('hgroup.site-name-slogan');
        detector = $('#region-branding .logo-img');
        compareHeight = detector.height();
        headerGroup.height(compareHeight);
        setPageFont();
        $(window).resize(function(){
          if (detector.height()!=compareHeight) {
            compareHeight = detector.height();
            headerGroup.height(compareHeight);
          }
          setPageFont();
        });
        function setPageFont() {
          if ($(window).width() < 320) {
            $('#page').css('font-size', '75%');
          }
          else {
            $('#page').css('font-size', '100%');
          }
        }
      })
    }
  };
})(jQuery);

