/**
* 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 can use JavaScript to
* insert the roles. This is a stop-gap measure while the W3C sort
* out the validator.
*
*/
if (Drupal.jsEnabled) {
  $(document).ready(function() {

    // Set role=header on #header wrapper div.
    $("#header").attr("role","banner");

    // Set role=complementary on #main-content blocks, sidebars and regions.
    $(".block, #sidebar-wrapper, .sidebar-top, .sidebar, .recent-contents").attr("role","complementary");

    // Remove role=complementary from system blocks.
    $(".block-system, td.block, tr.region, td.region").removeAttr("role","complementary");

    // Set role=main on .main-content div.
    $(".main-content").attr("role","main");

    // Set role=search on search block and box.
    $("#search-theme-form, .search-box, #search-form").attr("role","search");

	// Set role=footer on the footer message.
    $("#footer").attr("role","footer");

    // Set role=contentinfo on the footer message.
    $("#footer-message").attr("role","contentinfo");

    // Set role=article on nodes.
    $(".node").attr("role","article");

    // Set role=nav on navigation-like blocks.
    $("#menu-top, ul.links, ul.tags, .admin-panel, #breadcrumb, .block-menu, #block-user-1, #block-user-3, .block-book, .block-forum, .block-blog, .block-comment, .block-statistics-0, .block-aggregator, ul.pager, .local-tasks").attr("role","navigation");
 
  });
}
