// $Id: html5shiv.js,v 1.1.2.1 2010/10/14 05:36:20 jmburnz Exp $
// html5shiv MIT @rem remysharp.com/html5-enabling-script
// iepp v1.5.1 MIT @jon_neal iecss.com/print-protector
/*@cc_on@if(@_jscript_version<9)(function(p,e){function q(a,b){if(g[a])g[a].styleSheet.cssText+=b;else{var c=r[l],d=e[j]("style");d.media=a;c.insertBefore(d,c[l]);g[a]=d;q(a,b)}}function s(a,b){for(var c=new RegExp("\\b("+m+")\\b(?!.*[;}])","gi"),d=function(k){return".iepp_"+k},h=-1;++h<a.length;){b=a[h].media||b;s(a[h].imports,b);q(b,a[h].cssText.replace(c,d))}}function t(){for(var a,b=e.getElementsByTagName("*"),c,d,h=new RegExp("^"+m+"$","i"),k=-1;++k<b.length;)if((a=b[k])&&(d=a.nodeName.match(h))){c=new RegExp("^\\s*<"+d+"(.*)\\/"+
d+">\\s*$","i");i.innerHTML=a.outerHTML.replace(/\r|\n/g," ").replace(c,a.currentStyle.display=="block"?"<div$1/div>":"<span$1/span>");c=i.childNodes[0];c.className+=" iepp_"+d;c=f[f.length]=[a,c];a.parentNode.replaceChild(c[1],c[0])}s(e.styleSheets,"all")}function u(){for(var a=-1,b;++a<f.length;)f[a][1].parentNode.replaceChild(f[a][0],f[a][1]);for(b in g)r[l].removeChild(g[b]);g={};f=[]}for(var m="abbr article aside audio canvas command datalist details figure figcaption footer header hgroup mark meter nav output progress section summary time video".replace(/ /g,
"|"),n=m.split("|"),r=e.documentElement,i=e.createDocumentFragment(),g={},f=[],o=-1,l="firstChild",j="createElement";++o<n.length;){e[j](n[o]);i[j](n[o])}i=i.appendChild(e[j]("div"));p.attachEvent("onbeforeprint",t);p.attachEvent("onafterprint",u)})(this,document)@end@*/;
// $Id: at.js,v 1.1.2.2 2010/10/19 22:41:25 jmburnz Exp $
(function ($) {
  /**
   * Insert WAI-ARIA Landmark Roles (Roles for Accessible Rich Internet Applications)
   *
   * http://www.w3.org/TR/2006/WD-aria-role-20060926/
   * 
   * Due to validation errors with WAI-ARIA roles we use JavaScript to 
   * insert the roles. This is a stop-gap measure while the W3C sort 
   * out the validator.
   *
   * This is a starting point, you can copy this and use it in your subtheme for more granular control.
   */
  Drupal.behaviors.adaptivetheme = {
    attach: function(context) {

      // Set role="banner" on the header element.
      $("body > header").attr("role", "banner");

      // Set role="main" on #main-content div.
      $("#main-content").attr("role", "main");

      // Set role="search" on search forms.
      $("#search-theme-form").attr("role", "search");

      // Set role="contentinfo" on the page footer.
      $("footer").attr("role", "contentinfo");

      // Set role=article on nodes.
      $(".article").attr("role", "article");

      // Set role="nav" on navigation-like blocks.
      $("nav, .admin-panel, #breadcrumb").attr("role", "navigation");
      
      // Set role="complementary" on navigation-like blocks.
      $("aside").attr("role", "complementary");

      // Set role="region" on section elements.
      $("section").attr("role", "region");

      // Set role="region" on section elements.
      $("#search-block-form, #search-form").attr("role", "search");

    }
  };

  /**
   * In most instances this will be called using the built in theme settings.
   * However, if you want to use this manually you can call this file
   * in the info file and user the ready function e.g.:
   * 
   * This will set sidebars and the main content column all to equal height:
   *  (function ($) {
   *    Drupal.behaviors.adaptivetheme = {
   *      attach: function(context) {
   *        $('#content-column, .sidebar').equalHeight();
   *      }
   *    };
   *  })(jQuery);
   */
  jQuery.fn.equalHeight = function () {
    var height = 0;
    var maxHeight = 0;

    // Store the tallest element's height
    this.each(function () {
      height = jQuery(this).outerHeight();
      maxHeight = (height > maxHeight) ? height : maxHeight;
    });

    // Set element's min-height to tallest element's height
    return this.each(function () {
      var t = jQuery(this);
      var minHeight = maxHeight - (t.outerHeight() - t.height());
      var property = jQuery.browser.msie && jQuery.browser.version < 7 ? 'height' : 'min-height';

      t.css(property, minHeight + 'px');
   });
  };

})(jQuery);;

