OSDN Git Service

Rebased Updated templates, styles, scripts for dac.
authorDirk Dougherty <ddougherty@google.com>
Sat, 7 Nov 2015 19:34:59 +0000 (11:34 -0800)
committerDirk Dougherty <ddougherty@google.com>
Fri, 29 Jan 2016 02:28:16 +0000 (18:28 -0800)
Change-Id: Ida1a7f39cb6df0255f8f9c8e96a2270a0283c59e

30 files changed:
tools/droiddoc/templates-sdk-dev/assets/css/default.css
tools/droiddoc/templates-sdk-dev/assets/images/android_logo.png
tools/droiddoc/templates-sdk-dev/assets/images/android_logo@2x.png
tools/droiddoc/templates-sdk-dev/assets/images/play-circle-grey.png [deleted file]
tools/droiddoc/templates-sdk-dev/assets/images/play-circle-grey_2x.png [deleted file]
tools/droiddoc/templates-sdk-dev/assets/images/play-circle-white.png [deleted file]
tools/droiddoc/templates-sdk-dev/assets/images/play-circle-white_2x.png [deleted file]
tools/droiddoc/templates-sdk-dev/assets/images/sprite.png
tools/droiddoc/templates-sdk-dev/assets/images/sprite@2x.png [new file with mode: 0644]
tools/droiddoc/templates-sdk-dev/assets/js/android_3p-bundle.js
tools/droiddoc/templates-sdk-dev/assets/js/docs.js
tools/droiddoc/templates-sdk-dev/class.cs
tools/droiddoc/templates-sdk-dev/classes.cs
tools/droiddoc/templates-sdk-dev/components/masthead.cs
tools/droiddoc/templates-sdk-dev/customizations.cs
tools/droiddoc/templates-sdk-dev/designpage.cs
tools/droiddoc/templates-sdk-dev/docpage.cs
tools/droiddoc/templates-sdk-dev/footer.cs
tools/droiddoc/templates-sdk-dev/head_tag.cs
tools/droiddoc/templates-sdk-dev/header.cs
tools/droiddoc/templates-sdk-dev/jd_lists_unified.cs
tools/droiddoc/templates-sdk-dev/package.cs
tools/droiddoc/templates-sdk-dev/packages.cs
tools/droiddoc/templates-sdk-dev/sample.cs
tools/droiddoc/templates-sdk-dev/sampleindex.cs
tools/droiddoc/templates-sdk-dev/sdkpage.cs
tools/droiddoc/templates-sdk-dev/trailer.cs
tools/droiddoc/templates-sdk/assets/css/default.css
tools/droiddoc/templates-sdk/assets/js/docs.js
tools/droiddoc/templates-sdk/head_tag.cs

index 9219917..f6fdd4b 100644 (file)
@@ -30,7 +30,7 @@ body {
   font: 14px/24px Roboto, sans-serif;
   font-weight: 400;
   letter-spacing:.1;
-  padding:0 20px;
+  padding: 0 20px;
 }
 
 @media (max-width: 719px) {
@@ -40,7 +40,8 @@ body {
   }
 
   body {
-    padding: 0 10px;
+    padding-left: 10px;
+    padding-right: 10px;
   }
 }
 
@@ -91,15 +92,6 @@ body {
   margin-right: 20px;
   float: left; }
 
-#nav {
-  margin:0;
-  padding:0 0 30px;
-}
-
-#side-nav {
-  padding-top: 20px;
-}
-
 #devdoc-nav h2 {
   border:0;
 }
@@ -191,11 +183,12 @@ h1, h2, h3 {
 h1 {
   font-size: 44px;
   line-height: 56px;
-  margin: 24px 0 12px;
   font-weight: 300;
+  margin: 0;
+  padding: 24px 0 12px;
 }
 h1.short {
-  margin-right:320px;
+  padding-right:320px;
 }
 @media (max-width: 719px) {
   h1 {
@@ -208,30 +201,41 @@ h2 {
   font-size: 28px;
   font-weight: 400;
   line-height: 32px;
-  margin: 24px 0 16px;
+  margin: 0;
+  padding: 12px 0 16px;
 }
 h3 {
   font-size: 24px;
   line-height: 32px;
   font-weight: 400;
-  margin: 16px 0;
+  margin: 0;
+  padding: 8px 0 12px;
 }
 h4 {
   font-size: 18px;
   line-height: 24px;
-  margin: 12px 0;
+  margin: 0;
+  padding: 4px 0 8px;
   font-weight: 500;
 }
 h5, h6 {
   font-size: 16px;
   line-height: 24px;
-  margin: 8px 0;
+  margin: 0;
+  padding: 4px 0 8px;
 }
 hr { /* applied to the bottom of h2 elements */
   height: 1px;
   margin: 7px 0 12px;
   border: 0;
-  background: #e5e5e5;
+  background: rgba(0, 0, 0, 0.1);
+}
+h2[id], h3[id], h4[id], h5[id], h6[id] {
+  margin-top: -64px;
+  border-top: 64px solid transparent;
+  -webkit-background-clip: padding-box;
+  -moz-background-clip: padding;
+  background-clip: padding-box;
 }
 p, pre, table, form {
   margin: 0 0 12px;
@@ -283,7 +287,7 @@ pre strong, pre b, a strong, a b, a code {
 }
 pre, code {
   color: #060;
-  font: 13px/18px Consolas, "Liberation Mono", Menlo, Courier, monospace;
+  font: 13px/18px Consolas, "Liberation Mono", Menlo, Monaco, Courier, monospace;
   -webkit-font-smoothing: subpixel-antialiased;
   -moz-osx-font-smoothing: auto;
 }
@@ -385,7 +389,7 @@ video.with-shadow {
     margin-left: 0; }
   .layout-content-col h3,
   .layout-content-col h4 {
-    margin-top:0; }
+    padding-top:0; }
 
 .layout-content-col.span-1 {
   width: 40px; }
@@ -474,158 +478,6 @@ video.with-shadow {
 .vspace.size-16 {
   height: 160px; }
 
-/* nav */
-#nav {
-  /* section header divs */
-  /* expanded section header divs */
-  /* sublinks */ }
-  #nav li {
-    list-style-type: none;
-    font-size: 12px;
-    margin:0;
-    padding:0;
-    line-height: 18px; }
-  #nav a {
-    color: #505050;
-    text-decoration: none;
-    word-wrap:break-word; }
-  #nav .nav-section-header {
-    position: relative;
-    margin-bottom: 1px;
-    padding: 0 30px 0 0; }
-  #nav li.selected a {
-    color: #039BE5;
-  }
-  #nav li.selected ul li a {
-  /* don't highlight child items */
-    color: #505050; }
-  #nav .nav-section .nav-section .nav-section-header {
-    /* no white line between second level sections */
-    margin-bottom: 0; }
-    /* section header links */
-    #nav > li > div > a {
-      display: block;
-      font-weight: 700;
-      padding: 13px 0 12px 10px; }
-    #nav .nav-section-header:after {
-      content: '';
-      background: transparent url(../images/styles/disclosure_down.png) no-repeat scroll 50% 50%;
-      width: 34px;
-      height: 34px;
-      display: block;
-      position: absolute;
-      top: 6px;
-      right: 0; }
-    #nav .nav-section-header.empty {
-      padding:0; }
-    #nav .nav-section-header.empty:after {
-      display: none; }
-    /* nested nav headers */
-    #nav .nav-section .nav-section {
-      position: relative;
-      padding: 0;
-      margin: 0; }
-    #nav .nav-section li a {
-    /* first gen child (2nd level li) */
-      display:block;
-      font-weight: 700;
-      text-transform: none;
-      padding: 13px 5px 13px 10px;
-       }
-    #nav .nav-section li li a {
-    /* second gen child (3rd level li) */
-      font-weight: 400;
-      padding: 7px 5px 7px 10px;
-       }
-  #nav li.expanded .nav-section-header {
-    background: #f0f0f0; }
-  #nav li.expanded .nav-section-header.empty {
-    background: none; }
-  #nav li.expanded li .nav-section-header {
-    background: none; }
-  #nav li.expanded li ul {
-  /* 3rd level ul */
-    padding:6px 0 1px 20px;
-  }
-    #nav li.expanded > .nav-section-header:after {
-      content: '';
-      background: transparent url(../images/styles/disclosure_up.png) no-repeat scroll 50% 50%;
-      width: 34px;
-      height: 34px; }
-  #nav li.expanded li ul.tree-list-children {
-    padding: 0;
-  }
-  #nav li.expanded li ul.tree-list-children .tree-list-children {
-    padding:0 0 0 10px;
-  }
-  #nav li span.tree-list-subtitle {
-    display:inline-block;
-    padding:5px 0 0 10px;
-    color:#555;
-    text-transform:uppercase;
-    font-size:12px;
-  }
-  #nav li span.tree-list-subtitle:before {
-    content: '—';
-  }
-  #nav li span.tree-list-subtitle:after {
-    content: '—';
-  }
-  #nav li span.tree-list-subtitle.package {
-    padding-top:15px;
-    cursor:default;
-  }
-  #nav li span.tree-list-subtitle.package:before {
-    content: '';
-  }
-  #nav li span.tree-list-subtitle.package:after {
-    content: '';
-  }
-  #nav li ul.tree-list-children.classes {
-    padding-left:10px;
-  }
-  #nav li ul {
-    display:none;
-    overflow: hidden;
-    margin: 0; }
-    #nav li ul.animate-height-in {
-      -webkit-transition: height 0.25s ease-in;
-      -moz-transition: height 0.25s ease-in;
-      transition: height 0.25s ease-in; }
-    #nav li ul.animate-height-out {
-      -webkit-transition: height 0.25s ease-out;
-      -moz-transition: height 0.25s ease-out;
-      transition: height 0.25s ease-out; }
-    #nav li ul li {
-      padding: 0; }
-      #nav li li li {
-        padding: 0; }
-  #nav li.expanded ul {
-    }
-    #nav li ul > li {
-      padding:0;
-    }
-    #nav li ul > li:last-child {
-      padding-bottom:5px;
-    }
-    #nav li ul.tree-list-children > li:last-child {
-      padding-bottom:0;
-    }
-    #nav li.expanded ul > li {
-      background:#f7f7f7; }
-    #nav li.expanded ul > li li {
-      background:inherit; }
-  #nav li ul.tree-list-children ul {
-    display:block; }
-
-#nav.samples-nav li li li a {
-  padding-top:3px;
-  padding-bottom:3px;
-}
-#nav.samples-nav li li ul > li:last-child {
-  padding-bottom:3px;
-}
-
 .new,
 .new-child {
   font-size: .78em;
@@ -682,13 +534,10 @@ a.back-link {
 }
 .paging-links {
   position: relative;
-  height:30px; }
-  .paging-links a {
-    position: absolute; }
+  min-height:30px; }
   .paging-links a,
   .training-nav-top a {
     text-decoration: none; }
-    .paging-links .prev-page-link:before,
     .training-nav-top .prev-page-link:before,
     a.back-link:before {
       content: '';
@@ -697,14 +546,9 @@ a.back-link {
       height: 10px;
       display: inline-block;
       margin-right: 5px; }
-    .paging-links .prev-page-link {
-      left: -15px; }
-    .paging-links .next-page-link {
-      right: 0; }
-    .next-page-link:after,
-    .start-class-link:after,
-    .start-course-link:after,
-    .next-class-link:after,
+    .training-nav-top .next-page-link:after,
+    .training-nav-top .start-class-link:after,
+    .training-nav-top .start-course-link:after,
     .go-link:after {
       content: '';
       background: transparent url(../images/styles/disclosure_right.png) no-repeat scroll 50% 50%;
@@ -717,7 +561,7 @@ a.back-link {
     .next-page-link.inline:after {
       content: none; }
 
-  .content-footer .paging-links .next-page-link {
+  .content-footer {
     left:0;
   }
 
@@ -732,7 +576,7 @@ a.back-link {
     text-align:center;
     width: 50%;
   }
-  
+
   .training-nav-top a.prev-page-link {
     padding-left: 15px;
     text-align: left;
@@ -757,8 +601,7 @@ a.back-link {
   }
 
   .training-nav-top a.start-class-link,
-  .training-nav-top a.start-course-link,
-  .paging-links a.start-class-link {
+  .training-nav-top a.start-course-link {
     width:100%;
   }
 
@@ -780,7 +623,6 @@ a.back-link {
     font-size: 20px;
     font-weight: 500;
     height: 32px;
-    margin: 0;
     padding: 52px 16px 12px;
     position: relative;
   }
@@ -802,7 +644,7 @@ a.back-link {
     color: currentColor;
     font-size: inherit;
     font-weight: inherit;
-    margin:0 0 10px;
+    padding:0 0 10px;
     display:block;
     float:left;
     width:675px;
@@ -840,7 +682,7 @@ a.back-link {
     margin: 0 0 6px;
     line-height: 16px;
   }
-  
+
   /* Class colors */
   ol.class-list li:nth-child(10n+1) .title {
     background: #00bcd4;
@@ -872,7 +714,7 @@ a.back-link {
   ol.class-list li:nth-child(10n+10) .title {
     background: #7e57c2;
   }
-  
+
   @media (max-width: 719px) {
     ol.class-list ol,
     ol.class-list .description {
@@ -898,7 +740,7 @@ div#title-tabs-wrapper {
 }
 h1.with-title-tabs {
   display:inline-block;
-  margin:0 0 -1px 0;
+  margin-bottom: -1px;
   padding:0 60px 0 0;
   border-bottom:1px solid #F9F9F9;
 }
@@ -979,7 +821,7 @@ h3:target {
     animation-timing-function: ease-out; }
 
 .design ol h4 {
-  margin-bottom:0;
+  padding-bottom:0;
 }
 .design ol {
   counter-reset: item; }
@@ -1248,15 +1090,6 @@ scroll top left;
   .download-button:active {
     background-color: #006699; }
 
-.button.disabled,
-.button.disabled:hover,
-.button.disabled:active {
-  background:#ebebeb;
-  color:#999 !important;
-  border-color:#999;
-  cursor:default;
-}
-
 /* UI tables and other things found in Writing style and Settings pattern */
 .ui-table {
   width: 100%;
@@ -1438,7 +1271,7 @@ color-stop(50%, #acbc00), color-stop(50%, #bdde00), color-stop(100%, #bdde00));
 
   /* bump up spacing above subheadings */
   h2 {
-      margin-top: 40px !important;
+      padding-top: 40px !important;
   }
 
   /* print link URLs where possible and give links default text color */
@@ -1577,7 +1410,8 @@ color-stop(50%, #acbc00), color-stop(50%, #bdde00), color-stop(100%, #bdde00));
   width:226px;
   font-size:13px;
   line-height:18px;
-  border-left:3px solid #a9e27d;
+  border-left:3px solid #96ca7c;
+  border-left-color: rgba(106, 179, 68, .7); /* #6ab344 * 70% */
   float:right;
   padding:0 0 0 20px;
   margin:0 0 1em 20px;
@@ -1588,7 +1422,7 @@ color-stop(50%, #acbc00), color-stop(50%, #bdde00), color-stop(100%, #bdde00));
 .sidebox h4,
 .sidebox h5 {
   font-weight:bold;
-  margin:0 0 10px;
+  padding: 0 0 10px;
   line-height: 16px;
 }
 
@@ -1647,7 +1481,7 @@ color-stop(50%, #acbc00), color-stop(50%, #bdde00), color-stop(100%, #bdde00));
 
 
 h3.rel-resources {
-margin:1.25em auto;
+  padding:1.25em auto;
 }
 
 /* --------------------------------------------------------------------------
@@ -1823,7 +1657,7 @@ div.sdk-terms.fullsize {
 
 div.sdk-terms h3,
 div.sdk-terms h2 {
-  margin:0;
+  padding: 0;
 }
 
 div#sdk-terms-form {
@@ -1897,8 +1731,7 @@ Three-Pane
   padding: 0 0 0 4px;
 }
 #packages-nav li a, #packages-nav li a:active, #packages-nav li a:visited,
-#classes-nav li li a, #classes-nav li li a:active, #classes-nav li li a:visited,
-#nav-tree li a, #nav-tree li a:active, #nav-tree li a:visited {
+#classes-nav li li a, #classes-nav li li a:active, #classes-nav li li a:visited {
   color: #222;
   font-weight: normal;
 }
@@ -1909,8 +1742,7 @@ Three-Pane
 #packages-nav li.selected a, #packages-nav li.selected a:active, #packages-nav li.selected
 a:visited,
 #classes-nav li li.selected a, #classes-nav li li.selected a:active, #classes-nav li li.selected
-a:visited,
-#nav-tree li div.selected {
+a:visited {
     font-weight: 500;
     color: #0099cc;
     background-color:#fff; }
@@ -1918,10 +1750,7 @@ a:visited,
   #classes-nav li.selected ul li a {
   /* don't highlight child items */
     color: #555555; }
-#nav-tree li div.selected a {
-    font-weight: 500;
-    color: #0099cc;
-}
+
 #nav-swap {
   height:30px;
   border-top:1px solid #ccc;
@@ -1951,72 +1780,6 @@ a:visited,
   cursor:pointer;
 }
 
-
-/* nav tree */
-#swapper, #nav-tree, #tree-list {
-  overflow:hidden;
-  margin-left:0;
-}
-
-#nav-tree ul {
-  list-style:none;
-  padding:0;
-  margin:10px 0;
-}
-
-#nav-tree ul li div {
-  padding:0 0 0 4px;
-}
-
-#side-nav #nav-tree ul li a,
-#side-nav #nav-tree ul li span.no-children {
-  padding: 0;
-  margin: 0;
-}
-
-#nav-tree .plus {
-  margin: 0 3px 0 0;
-}
-
-#nav-tree ul ul {
-  list-style: none;
-  margin: 0;
-  padding: 0 0 0 0;
-}
-
-#nav-tree ul li {
-  margin: 0;
-  padding: 0 0 0 0;
-  white-space: nowrap;
-}
-
-#nav-tree .children_ul {
-  padding:0;
-  margin:0;
-}
-#nav-tree .children_ul li div {
-  padding:0 0 0 10px;
-}
-#nav-tree .children_ul .children_ul li div {
-  padding:0 0 0 20px;
-}
-
-#nav-tree a.nolink {
-  color: #222;
-  text-decoration: none;
-}
-
-#nav-tree span.label {
-  width: 100%;
-}
-
-#nav-tree {
-  overflow-x: auto;
-  overflow-y: scroll;
-  outline:0;
-}
-
-
 /* Content */
 #doc-col {
   margin-right:0;
@@ -2039,7 +1802,7 @@ a:visited,
 }
 #doc-header h1 {
   line-height: 0;
-  margin-bottom: 15px;
+  padding-bottom: 15px;
 }
 #api-info-block {
   float: right;
@@ -2384,33 +2147,6 @@ div.sampleLine {
 }*/
 
 /* --------------------------------------------------------------------------
-Butterbar
-*/
-#butterbar-wrapper {
-  position:absolute;
-  top:0;
-  left:0;
-  width:100%;
-}
-#butterbar {
-  width:100%;
-  margin:0 auto;
-}
-#butterbar-message {
-  background-color:rgba(255, 187, 51, .4);
-  font-size:13px;
-  padding: 5px 0;
-  text-align:center;
-}
-a#butterbar-message {
-  cursor:pointer;
-  display:block;
-}
-a#butterbar-message:hover {
-  text-decoration:underline;
-}
-
-/* --------------------------------------------------------------------------
 Misc and article typography
 */
 
@@ -2597,27 +2333,30 @@ p.warning, div.warning {
 }
 
 p.note, div.note {
-  border-color: #66c2ff;
+  border-color: #4eb9ed;
+  border-color: rgba(3, 155, 229, .7); /* #039be5 * 70% */
 }
 
 p.caution, div.caution {
-  border-color: #f81;
+  border-color: #ffbc4c;
+  border-color: rgba(255, 160, 0, .7); /* #ffa000 * 70% */
 }
 
 p.warning, div.warning {
-  border-color: #f55;
+  border-color: #f48684;
+  border-color: rgba(239, 83, 80, .7); /* #ef5350 * 70% */
 }
 
 div.note.design {
-  border-left: 4px solid #33B5E5;
+  border-left: 4px solid #00bcd4;
 }
 
 div.note.develop {
-  border-left: 4px solid #F80;
+  border-left: 4px solid #ff7043;
 }
 
 div.note.distribute {
-  border-left: 4px solid #9C0;
+  border-left: 4px solid #afb42b;
 }
 
 .note p, .caution p, .warning p {
@@ -2718,7 +2457,7 @@ a.notice-designers h3 {
   font-weight:bold;
   text-transform:uppercase;
   color:#000 !important;
-  margin:0 0 1px;
+  padding:0 0 1px;
 }
 a.notice-developers-video p,
 a.notice-developers p,
@@ -3060,8 +2799,7 @@ Feature Boxes
 
 .feature-box h4,
 .dialog h4 {
-    margin: 15px 18px 10px;
-    padding:0;
+    padding: 15px 18px 10px;
 }
 
 .feature-box p,
@@ -3344,7 +3082,7 @@ body.google table.jd-sumtable th {
 }
 
 h4.jd-tagtitle {
-  margin:0;
+  padding:0;
 }
 
 h4 .normal {
@@ -3354,7 +3092,7 @@ h4 .normal {
 /* API reference: heading for "Parameters", "See Also", etc.,
 in details sections */
 h5.jd-tagtitle {
-  margin:0 0 .25em 0;
+  padding:0 0 .25em 0;
   font-size:1em;
 }
 
@@ -3397,470 +3135,104 @@ table.jd-tagtable th {
   color:inherit;
 }
 
+/************ STICKY NAV BAR ******************/
 
-/* SEARCH FILTER */
-
-.menu-container {
-  position:relative;
-}
-#search_autocomplete {
-  font-weight:normal;
+#context {
+  clear: both;
+  padding-top: 14px;
 }
-
-.search_filtered_wrapper {
-  position: absolute;
-  right: 18px;
-  top: 64px;
+#context .breadcrumb {
+  float: left;
+  margin-bottom: 10px;
 }
-.suggest-card {
-  float:right;
-  position:relative;
-  width:170px;
-  min-height:90px;
-  border: solid 1px #C5C5C5;
-  background: white;
-  margin-right:-5px;
-  -moz-box-shadow: 0 0 10px rgba(0,0,0,0.2);
-  -webkit-box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
-  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
+#context .util {
+  float: right;
+  margin-right: 20px;
 }
-.suggest-card.reference {
-  z-index: 998;
-  width: auto;
+
+.breadcrumb {
+  list-style: none;
+  margin: 0;
+  padding: 0;
+  position: relative;
 }
-.suggest-card.develop {
-  z-index:997;
-  border-top: solid 4px #ff7043;
+.breadcrumb li {
+  float: left;
+  padding: 0 20px 0 0;
+  color: #000;
+  white-space: nowrap;
 }
-.suggest-card.design {
-  z-index:996;
-  border-top: solid 4px #00bcd4;
+.breadcrumb li a {
+  color: #000;
 }
-.suggest-card.distribute {
-  z-index:995;
-  border-top: solid 4px #afb42b;
+.breadcrumb li:after {
+  content: url(../images/breadcrumb.png);
+  position: relative;
+  top: 1px;
+  left: 10px;
+  width: 5px;
+  height: 10px;
 }
-.child-card {
-  width:100%;
+.breadcrumb li.current {
+  font-weight: 700;
 }
-.suggest-card.dummy {
-  width:172px;
-  float:right;
-  border:0;
-  background:transparent;
-  -moz-box-shadow: none;
-  -webkit-box-shadow: none;
-  box-shadow: none;
+.breadcrumb li.current:after {
+  display: none;
 }
 
-ul.search_filtered {
-  min-width:100%;
-  list-style: none;
-  margin: 5px 0;
-  padding: 0;
+/* offset the <a name=""> tags to account for sticky nav */
+body.reference a[name] {
+  visibility: hidden;
+  display: block;
+  position: relative;
+  top: -56px;
 }
-.search_filtered .jd-selected {
-  background:#efefef;
+
+
+/* Quicknav */
+.btn-quicknav {
+  width:20px;
+  height:28px;
+  float:left;
+  margin-left:6px;
+  padding-right:10px;
+  position:relative;
   cursor:pointer;
-}
-.search_filtered .jd-selected,
-.search_filtered .jd-selected a {
-    color:#039BE5 !important;
+  border-right:1px solid #CCC;
 }
 
-.no-display {
-  display: none;
+.btn-quicknav a {
+  zoom:1;
+  position:absolute;
+  top:13px;
+  left:5px;
+  display:block;
+  text-indent:-9999em;
+  width:10px;
+  height:5px;
+  background:url(../images/quicknav_arrow.png) no-repeat;
 }
 
-.search_filtered li.jd-autocomplete {
-  font-size: 0.81em;
-  border: none;
-  margin: 0;
-  padding: 0;
-  line-height:1.5em;
+.btn-quicknav a.arrow-active {
+  background-position: 0 -5px;
+  display:none;
 }
 
-.search_filtered li a {
-  padding: 2px 10px;
-  color:#222 !important;
-  display:inline-block;
-  line-height:12px;
+#header-wrap.quicknav a.arrow-inactive {
+  display:none;
 }
 
-.search_filtered li.header {
-  font-weight:bold;
-  color:#444;
-  border: none;
-  margin: 0;
-  padding: 2px 10px;
-  line-height:1.5em;
-}
-.search_filtered li.header.small {
-  font-size:0.85em;
+.btn-quicknav.active a.arrow-active {
+  display:block;
 }
 
-.suggest-card.reference
-.search_filtered li.header {
-  color:#aaa;
-  font-size: 0.81em;
+#header-wrap.quicknav .nav-x li {
+  min-width:160px;
+  margin-right:20px;
 }
 
-.search_filtered li.header:first-child {
-  margin: 0 0 2px;
-}
-
-@media (max-width: 719px) {
-  .search_filtered_wrapper {
-    left: 24px;
-    right: 24px;
-    top: 44px;
-  }
-
-  .suggest-card {
-    box-shadow: 0 2px 1px rgba(0, 0, 0, 0.1), 0 0 1px rgba(0, 0, 0, 0.1);
-    float: none;
-    margin-right: 0;
-    min-height: 0;
-    max-height: 204px;
-    overflow: hidden;
-  }
-
-  .suggest-card.develop,
-  .suggest-card.design,
-  .suggest-card.distribute {
-    display: none !important;
-  }
-
-  ul.search_filtered {
-    margin: 0;
-  }
-
-  .search_filtered li.jd-autocomplete {
-    border-top: solid 1px #C5C5C5;
-    font-size: inherit;
-    text-align: left;
-  }
-
-  .search_filtered li.jd-autocomplete:first-child {
-    border-top: 0;
-  }
-
-  .search_filtered li a {
-    display: block;
-    overflow: hidden;
-    padding: 14px 10px;
-    text-overflow: ellipsis;
-    white-space: nowrap;
-  }
-}
-
-.show-item {
-  display: table-row;
-}
-.hide-item {
-  display: hidden;
-}
-
-
-
-/* SEARCH RESULTS */
-
-
-#leftSearchControl .gsc-twiddle {
-  background-image : none;
-}
-
-#leftSearchControl td, #searchForm td {
-  border: 0px solid #000;
-  padding:0;
-}
-
-#leftSearchControl .gsc-resultsHeader .gsc-title {
-  padding-left : 0px;
-  font-weight : bold;
-  font-size : 13px;
-  color:#006699;
-  display : none;
-}
-
-#leftSearchControl .gsc-resultsHeader div.gsc-results-selector {
-  display : none;
-}
-
-#leftSearchControl .gsc-resultsRoot {
-  padding-top : 6px;
-}
-
-#leftSearchControl div.gs-visibleUrl-long {
-  display : block;
-  color:#006699;
-}
-
-#leftSearchControl .gsc-webResult {
-  padding:0 0 20px 0;
-}
-
-.gsc-webResult div.gs-visibleUrl-short,
-table.gsc-branding,
-.gsc-clear-button {
-  display : none;
-}
-
-.gsc-cursor-box .gsc-cursor div.gsc-cursor-page,
-.gsc-cursor-box .gsc-trailing-more-results a.gsc-trailing-more-results,
-#leftSearchControl a,
-#leftSearchControl a b {
-  color:#006699;
-}
-
-.gsc-resultsHeader {
-  display: none;
-}
-
-/* Disable built in search forms */
-.gsc-control form.gsc-search-box {
-  display : none;
-}
-table.gsc-search-box {
-  margin:6px 0 0 0;
-  border-collapse:collapse;
-}
-
-td.gsc-input {
-  padding:0 2px;
-  width:100%;
-  vertical-align:middle;
-}
-
-input.gsc-input {
-  border:1px solid #BCCDF0;
-  width:99%;
-  padding-left:2px;
-  font-size:.95em;
-}
-
-td.gsc-search-button {
-  text-align: right;
-  padding:0;
-  vertical-align:top;
-}
-
-
-#searchResults {
-  overflow:hidden; /* because the repositioned page links makes the section think it needs to scroll
-(it doesn't) */
-  height:auto;
-}
-
-#searchResults .gsc-control {
-  position:relative;
-  width:auto;
-  padding:0 0 10px;
-}
-
-#searchResults .gsc-tabsArea {
-  position: relative;
-  white-space: nowrap;
-  float: left;
-  width: 25%;
-}
-
-#searchResults .gsc-above-wrapper-area {
-  display:none;
-}
-
-#searchResults .gsc-resultsbox-visible {
-  box-sizing: border-box;
-  float: left;
-  padding-left:20px;
-  width: 75%;
-}
-
-@media (max-width: 719px) {
-  #searchResults .gsc-tabsArea {
-    display: none;
-  }
-
-  #searchResults .gsc-resultsbox-visible {
-    float: none;
-    padding-left: 0;
-    width: auto;
-  }
-}
-
-#searchResults .gsc-tabHeader {
-  margin-top: 4px;
-  padding: 3px 6px;
-  position:relative;
-  width:auto;
-  display:block;
-}
-
-#searchResults h2#searchTitle {
-  padding:0;
-  margin:30px 0 5px;
-  border:none;
-}
-
-#searchResults h2#searchTitle em {
-  font-style:normal;
-  color:#33B5E5;
-}
-
-#searchResults .gsc-table-result {
-  margin:5px 0 10px 0;
-  background-color:transparent;
-}
-#searchResults .gs-web-image-box, .gs-promotion-image-box {
-  width:120px;
-}
-#searchResults .gs-web-image-box img.gs-image, .gs-promotion-image-box img.gs-promotion-image {
-  max-width:120px;
-}
-
-#searchResults .gsc-table-result .gsc-thumbnail {
-  padding:0 20px 0 0;
-}
-
-#searchResults td {
-  background-color:transparent;
-}
-
-#searchResults .gsc-expansionArea {
-  position:relative;
-}
-#searchResults .gsc-tabsArea .gsc-cursor-box {
-  width:200px;
-  padding:20px 0 0 1px;
-}
-#searchResults .gsc-cursor-page {
-  display:inline-block;
-  float:left;
-  margin:-1px 0 0 -1px;
-  padding:0;
-  height:27px;
-  width:27px;
-  text-align:center;
-  line-height:2;
-}
-
-#searchResults .gsc-tabHeader.gsc-tabhInactive,
-#searchResults .gsc-cursor-page {
-  background: #F0F0F0;
-  border: 0;
-  color: #039BE5;
-}
-
-#searchResults .gsc-tabHeader.gsc-tabhActive,
-#searchResults .gsc-tabHeader.gsc-tabhActive:hover,
-#searchResults .gsc-cursor-page.gsc-cursor-current-page,
-#searchResults .gsc-cursor-page.gsc-cursor-current-page:hover {
-  background-color: #039BE5;
-  border: 0;
-  color: #fff;
-}
-
-
-
-
-/************ STICKY NAV BAR ******************/
-
-#context {
-  clear: both;
-  padding-top: 14px;
-}
-#context .breadcrumb {
-  float: left;
-  margin-bottom: 10px;
-}
-#context .util {
-  float: right;
-  margin-right: 20px;
-}
-
-.breadcrumb {
-  list-style: none;
-  margin: 0;
-  padding: 0;
-  position: relative;
-}
-.breadcrumb li {
-  float: left;
-  padding: 0 20px 0 0;
-  color: #000;
-  white-space: nowrap;
-}
-.breadcrumb li a {
-  color: #000;
-}
-.breadcrumb li:after {
-  content: url(../images/breadcrumb.png);
-  position: relative;
-  top: 1px;
-  left: 10px;
-  width: 5px;
-  height: 10px;
-}
-.breadcrumb li.current {
-  font-weight: 700;
-}
-.breadcrumb li.current:after {
-  display: none;
-}
-
-/* offset the <a name=""> tags to account for sticky nav */
-body.reference a[name] {
-  visibility: hidden;
-  display: block;
-  position: relative;
-  top: -56px;
-}
-
-
-/* Quicknav */
-.btn-quicknav {
-  width:20px;
-  height:28px;
-  float:left;
-  margin-left:6px;
-  padding-right:10px;
-  position:relative;
-  cursor:pointer;
-  border-right:1px solid #CCC;
-}
-
-.btn-quicknav a {
-  zoom:1;
-  position:absolute;
-  top:13px;
-  left:5px;
-  display:block;
-  text-indent:-9999em;
-  width:10px;
-  height:5px;
-  background:url(../images/quicknav_arrow.png) no-repeat;
-}
-
-.btn-quicknav a.arrow-active {
-  background-position: 0 -5px;
-  display:none;
-}
-
-#header-wrap.quicknav a.arrow-inactive {
-  display:none;
-}
-
-.btn-quicknav.active a.arrow-active {
-  display:block;
-}
-
-#header-wrap.quicknav .nav-x li {
-  min-width:160px;
-  margin-right:20px;
-}
-
-#header-wrap.quicknav li.last {
-  margin-right:0px;
+#header-wrap.quicknav li.last {
+  margin-right:0px;
 }
 
 #quicknav {
@@ -4116,7 +3488,7 @@ body.reference a[name] {
 
 
 #landing h1 {
-  margin:17px 0 20px 0 !important;
+  padding:17px 0 20px 0 !important;
 }
 
 a.download-sdk {
@@ -4312,7 +3684,7 @@ a.download-sdk {
 }
 .slideshow-develop .content-right h2 {
   padding:0;
-  margin-bottom:10px;
+  padding-bottom:10px;
   border:none;
   font-size:24px;
 }
@@ -4405,7 +3777,7 @@ a.download-sdk {
 .feed .feed-container .feed-frame li.playlist-video h5 {
   font-size:12px;
   line-height:13px;
-  margin:0;
+  padding:0;
 }
 .feed .feed-container .feed-frame li.playlist-video p {
   margin:5px 0 0;
@@ -4503,7 +3875,7 @@ a.download-sdk {
   margin-bottom:0;
 }
 .landing-banner h1 {
-  margin-top:16px;
+  padding-top:16px;
   padding-bottom:24px;
 }
 .landing-docs,
@@ -4517,7 +3889,7 @@ a.download-sdk {
   color:#555;
   text-transform:uppercase;
   border-bottom:1px solid #CCC;
-  margin:0 0 20px;
+  padding:0 0 20px;
 }
 .landing-docs a {
   color:#333 !important;
@@ -4558,8 +3930,7 @@ a.download-sdk {
   color:#555;
   text-transform:uppercase;
   border-bottom:none;
-  margin:0 0 1em;
-  padding:5px 0 0;
+  padding:5px 0 1em;
 }
 
 
@@ -4667,8 +4038,7 @@ a.download-sdk {
   color:#555;
   text-transform:uppercase;
   border-bottom:1px solid #CCC;
-  padding:8px 0 0 1px;
-  margin-bottom:14px;
+  padding:8px 0 14px 1px;
   clear:both;
 }
 
@@ -4713,7 +4083,7 @@ a.download-sdk {
   line-height: 80px;
   text-align: center;
   letter-spacing: -1px;
-  margin-bottom: 6px;
+  padding-bottom: 6px;
 }
 
 .landing-pre-h1 {
@@ -5049,152 +4419,9 @@ a.download-sdk {
 }
 
 
-
-/**
- * VIDEO
- */
-
-#video-container {
-  display:none;
-  position:fixed;
-  top:0;
-  left:0;
-  width:100%;
-  height:100%;
-  background-color:rgba(0,0,0,0.8);
-  z-index:9999;
-}
-
-#video-frame {
-  max-width:940px;
-  height:100%;
-  margin:72px auto;
-  display:none;
-  position:relative;
-}
-
-.video-close {
-  cursor: pointer;
-  position: absolute;
-  right: -49px;
-  top: -49px;
-  pointer-events: all;
-}
-
-#icon-video-close {
-  background-image: url("../images/close-white.png");
-  background-image: -webkit-image-set(url(../images/close-white.png) 1x, url(../images/close-white_2x.png) 2x);
-  background-repeat: no-repeat;
-  background-position: 0 0;
-  background-size: 36px 36px;
-  height: 36px;
-  width: 36px;
-  display:block;
-}
-
-#icon-video-close:hover {
-  background-image: url("../images/close-grey.png");
-  background-image: -webkit-image-set(url(../images/close-grey.png) 1x, url(../images/close-grey_2x.png) 2x);
-}
-
-/* Preload the hover images */
-a.video-shadowbox-button.white:after {
-  display:none;
-  content:url("../images/close-grey.png") url("../images/close-grey_2x.png");
-}
-
-a.video-shadowbox-button.white {
-  background-image: url("../images/play-circle-white.png");
-  background-image: -webkit-image-set(url(../images/play-circle-white.png) 1x, url(../images/play-circle-white_2x.png) 2x);
-  background-size: 36px 36px;
-  background-repeat: no-repeat;
-  background-position: right;
-  padding: 16px 42px 16px 8px;
-  font-size: 18px;
-  font-weight: 500;
-  line-height: 24px;
-  color: #fff;
-  text-decoration:none;
-}
-
-a.video-shadowbox-button.white:hover {
-  color:#bababa !important;
-  background-image: url("../images/play-circle-grey.png");
-  background-image: -webkit-image-set(url(../images/play-circle-grey.png) 1x, url(../images/play-circle-grey_2x.png) 2x);
-}
-
-/* Preload the hover images */
-a.video-shadowbox-button.white:after {
-  display:none;
-  content:url("../images/play-circle-grey.png") url("../images/play-circle-grey_2x.png");
-}
-
-/*
- * Responsive YouTube embeds from DevSite
- *
- * When applied to a <div> that wraps a video, "video-wrapper" forces the video
- * to float right at 50% of the column width on desktop, but appear as a block
- * element at 100% of the column width on smaller screens.
- * "video-wrapper-full-width" works the same but is always 100% width.
- */
-.video-wrapper,
-.video-wrapper-left {
-  float: right;
-  margin: 0 0 40px 40px;
-  padding-top: calc(((100% - 40px) / 2) / 16 * 9); /* 16:9 including margin */
-  position: relative;
-  width: calc((100% - 40px) / 2);                  /* 50% including margin */
-}
-
-/*
- * "video-wrapper-left" forces 50% without the float
- * This is useful for heading content when you want the video to
- * appear next to an element that is already floated right
- * (e.g. tb-wrapper <div>)
- */
-.video-wrapper-left {
-  float: none;
-  margin: 16px 0 20px 0;
-}
-
-.video-wrapper-full-width {
-  margin: 16px 0;
-  padding-top: 56.25%; /* Forces div to 16:9 at 100% width */
-  position: relative;
-  width: 100%;
-}
-
-.video-wrapper embed,
-.video-wrapper iframe,
-.video-wrapper object,
-.video-wrapper-full-width embed,
-.video-wrapper-full-width iframe,
-.video-wrapper-full-width object,
-.video-wrapper-left embed,
-.video-wrapper-left iframe,
-.video-wrapper-left object {
-  height: 100%;
-  left: 0;
-  position: absolute;
-  top: 0;
-  width: 100%;
-}
-
-@media screen and (max-width: 1000px) {
-
-  .video-wrapper,
-  .video-wrapper-left {
-    float: none;
-    margin: 16px 0;
-    padding-top: 56.25%; /* Forces div to 16:9 at 100% width */
-    width: 100%;
-  }
-}
-
-
-/******************
-Styles for d.a.c/index:
-*******************/
+/******************
+Styles for d.a.c/index:
+*******************/
 
 
 
@@ -5232,7 +4459,7 @@ Styles for d.a.c/index:
   font-size: 60px;
   line-height: 68px;
   letter-spacing: -1px;
-  margin-top: 0;
+  padding-top: 0;
 }
 
 .fullscreen-carousel .hero p {
@@ -5371,62 +4598,6 @@ Styles for d.a.c/index:
   margin-bottom: 26px;
 }
 
-
-/*
-  Styles for the actions bar.
-*/
-.actions-bar {
-  background: #b0bec5;
-  text-align: center;
-}
-
-.actions-bar .actions {
-  padding: 24px 0;
-  font-size: 0.1px;
-  line-height: 0.1px;
-}
-
-.actions-bar .actions:after {
-  content: '';
-  width: 100%;
-  display: inline-block;
-}
-
-.actions-bar .actions > div {
-  display: inline-block;
-  margin: 0 16px;
-}
-
-.actions-bar .actions a {
-  color: #fff;
-  font-size: 24px;
-  font-weight: 300;
-  line-height: 50px;
-  -webkit-transition: opacity .3s;
-  transition: opacity .3s;
-}
-
-.actions-bar .actions a:hover {
-  opacity: .54;
-}
-
-.actions-bar .actions .dac-sprite {
-  margin: 0 -8px 0 -12px;
-}
-
-@media (max-width: 719px) {
-  .actions-bar {
-    text-align: left;
-  }
-
-  .actions-bar .actions > div {
-    display: block;
-    margin: 0;
-  }
-}
-
-
-
 /*
   Specific styles for new home page layout of the carousels.
 */
@@ -5588,7 +4759,100 @@ a.home-new-cta-btn:hover,
   display:none;
 }
 
-.dac-visible-mobile-block, .dac-mobile-only, .dac-visible-mobile-inline, .dac-visible-mobile-inline-block, .dac-visible-tablet-block, .dac-visible-tablet-inline, .dac-visible-tablet-inline-block, .dac-visible-desktop-block, .dac-visible-desktop-inline, .dac-visible-desktop-inline-block {
+#tb li:before, #qv li:before {
+  background-position: 0px -196px;
+  height: 24px;
+  width: 24px;
+  content: '';
+  left: -8px;
+  opacity: .7;
+  position: absolute;
+  top: -4px;
+}
+
+/* CHANGE EXISTING SELECTOR FOR ANDROID M HERO ONLY
+   REMOVE THE BELOW STYLES WHEN THE ANDROID M CAROUSEL
+   GRAPHIC ON THE MAIN LANDING IS TAKEN DOWN */
+.dac-hero.mprev {
+  background-color: #fff;
+  background-position: 50% 53%;
+  background-size: cover;
+  background-image: url(../../assets/images/home/android_m_hero_1200.jpg);
+  box-sizing: border-box;
+  font-size: 16px;
+  min-height: 550px;
+  padding-top: 88px;
+}
+.dac-hero.dac-darken.mprev::before {
+  background: rgba(0, 0, 0, 0.3);
+  bottom: 0;
+  content: '';
+  display: block;
+  left: 0;
+  position: absolute;
+  right: 0;
+  top: 0;
+}
+
+.dac-hero.dac-darken.mprev::before {
+  background: -webkit-linear-gradient(top, rgba(0, 0, 0, .05), rgba(0, 0, 0, .05), #000 950px);
+  background: linear-gradient(to bottom, rgba(0, 0, 0, .05), rgba(0, 0, 0, 0.05), #000 950px);
+}
+
+@media (max-width: 719px) {
+  .dac-hero.dac-darken.mprev {
+    background-size: auto 600px;
+    background-position: 55% 0;
+    background-repeat: no-repeat;
+  }
+
+  .dac-hero-figure.mprev {
+    height: 10px;
+    margin: 15px 0;
+  }
+}
+
+@media (max-width: 719px) {
+  .dac-hero.dac-darken.mprev {
+    background-size: auto 600px;
+    background-position: 55% 0;
+    background-repeat: no-repeat;
+  }
+
+  .dac-hero-figure.mprev {
+    height: 10px;
+    margin: 15px 0;
+  }
+}
+
+@media (max-width: 1200px) {
+  .dac-hero.dac-darken.mprev {
+    background-size: auto 700px;
+    background-position: 55% 0;
+    background-repeat: no-repeat;
+  }
+
+  .dac-hero-cta.mprev {
+    white-space:nowrap;
+  }
+}
+
+@charset "UTF-8";
+/**
+ * Fades out an element.
+ * Applies visibility hidden when the transition is finished.
+ *
+ * Use opacity: 1; to show the element.
+ */
+.dac-visible-mobile-block, .dac-mobile-only,
+.dac-visible-mobile-inline,
+.dac-visible-mobile-inline-block,
+.dac-visible-tablet-block,
+.dac-visible-tablet-inline,
+.dac-visible-tablet-inline-block,
+.dac-visible-desktop-block,
+.dac-visible-desktop-inline,
+.dac-visible-desktop-inline-block {
   display: none !important;
 }
 
@@ -5651,6 +4915,13 @@ a.home-new-cta-btn:hover,
 }
 
 /**
+ * Hide from browsers/screenreaders on all sizes.
+ */
+.dac-hidden {
+  display: none !important;
+}
+
+/**
  * Break strings when their length exceeds the width of their container.
  */
 .dac-text-break {
@@ -5740,8 +5011,6 @@ a.home-new-cta-btn:hover,
   box-sizing: border-box;
   display: none;
   height: 70px;
-  left: 50%;
-  margin-left: -35px;
   line-height: 65px;
   padding-left: 4px;
   position: absolute;
@@ -5749,11 +5018,20 @@ a.home-new-cta-btn:hover,
   text-align: center;
   -webkit-transition: opacity .5s;
           transition: opacity .5s;
-  top: 50px;
   width: 70px;
   z-index: 1; }
+  .resource-card-6x2 .play-button {
+    display: block;
+    left: 10px;
+    top: 15px;
+    -webkit-transform: scale(0.73);
+        -ms-transform: scale(0.73);
+            transform: scale(0.73); }
   .resource-card-6x6 .play-button {
-    display: block; }
+    display: block;
+    left: 50%;
+    margin-left: -35px;
+    top: 50px; }
 
 /* Styling for background image including tinting and section icons in stacks */
 .card-bg {
@@ -5823,11 +5101,10 @@ a.home-new-cta-btn:hover,
     color: #333;
     font-size: 18px;
     font-weight: 500;
-    line-height: 24px;
-    margin-bottom: 2px;
-    max-height: 48px;
+    line-height: 23px;
+    margin-bottom: 7px;
+    max-height: 46px;
     overflow: hidden;
-    padding-bottom: 5px;
     text-overflow: ellipsis;
     white-space: normal; }
   .card-info .description {
@@ -5945,7 +5222,7 @@ a.home-new-cta-btn:hover,
     /*text-transform: uppercase;*/
     color: #898989;
     font-size: 17px;
-    line-height: 24px;
+    line-height: 23px;
     margin-bottom: 6px; }
   .resource-stack-layout .section-card {
     height: 284px; }
@@ -6246,13 +5523,14 @@ a.home-new-cta-btn:hover,
   height: 100%;
   position: absolute;
   display: block; }
+
 .resource-card-3x2 > .card-info, .resource-card-6x2 > .card-info, .resource-card-9x2 > .card-info, .resource-card-12x2 > .card-info, .resource-card-15x2 > .card-info, .resource-card-18x2 > .card-info {
   height: 100%;
   left: 90px;
   padding: 6px 12px;
   overflow: hidden; }
   .resource-card-3x2 > .card-info .title, .resource-card-6x2 > .card-info .title, .resource-card-9x2 > .card-info .title, .resource-card-12x2 > .card-info .title, .resource-card-15x2 > .card-info .title, .resource-card-18x2 > .card-info .title {
-    max-height: 48px;
+    max-height: 69px;
     white-space: normal; }
   .resource-card-3x2 > .card-info .description, .resource-card-6x2 > .card-info .description, .resource-card-9x2 > .card-info .description, .resource-card-12x2 > .card-info .description, .resource-card-15x2 > .card-info .description, .resource-card-18x2 > .card-info .description {
     display: none; }
@@ -6260,10 +5538,12 @@ a.home-new-cta-btn:hover,
     height: auto; }
 
 /* Override to show the description instead of the content section */
-.no-section .resource-card-3x2 > .card-info .section, .no-section .resource-card-6x2 > .card-info .section {
+.no-section .resource-card-3x2 > .card-info .section,
+.no-section .resource-card-6x2 > .card-info .section {
   display: none; }
 
-.no-section .resource-card-3x2 > .card-info .description, .no-section .resource-card-6x2 > .card-info .description {
+.no-section .resource-card-3x2 > .card-info .description,
+.no-section .resource-card-6x2 > .card-info .description {
   display: block; }
 
 /* 1/2 row items */
@@ -6283,7 +5563,7 @@ a.home-new-cta-btn:hover,
     .resource-card-3x3 > .card-info .section, .resource-card-6x3 > .card-info .section, .resource-card-9x3 > .card-info .section, .resource-card-12x3 > .card-info .section, .resource-card-15x3 > .card-info .section, .resource-card-18x3 > .card-info .section {
       display: none; }
     .resource-card-3x3 > .card-info .title, .resource-card-6x3 > .card-info .title, .resource-card-9x3 > .card-info .title, .resource-card-12x3 > .card-info .title, .resource-card-15x3 > .card-info .title, .resource-card-18x3 > .card-info .title {
-      max-height: 96px;
+      max-height: 92px;
       white-space: normal; }
     .resource-card-3x3 > .card-info .text, .resource-card-6x3 > .card-info .text, .resource-card-9x3 > .card-info .text, .resource-card-12x3 > .card-info .text, .resource-card-15x3 > .card-info .text, .resource-card-18x3 > .card-info .text {
       height: auto; }
@@ -6315,16 +5595,31 @@ a.home-new-cta-btn:hover,
 /* Example of card menu tinting */
 .resource-widget[data-section=distribute\/tools] .section-card-menu .card-bg:after {
   background: rgba(126, 55, 148, 0.4) !important; }
+
 .resource-widget[data-section=distribute\/tools] .section-card-menu .card-section-icon .icon {
   background-color: #7e3794 !important; }
+
 .resource-widget[data-section=distribute\/tools] .section-card-menu .card-info ul li {
   border-top-color: #7e3794 !important; }
 
 /* tinting for stacks */
-div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-menu .card-info ul li {
+div.jd-descr > .resource-widget[data-section=distribute\/tools]
+.section-card-menu .card-info ul li {
   border-top-color: #7e3794 !important; }
 
-.dac-fab, .button, .landing-button, .dac-button {
+/* Show more/less */
+.dac-show-more,
+.dac-show-less {
+  display: none !important; }
+
+.dac-has-more .dac-show-more {
+  display: inline-block !important; }
+
+.dac-has-less .dac-show-less {
+  display: inline-block !important; }
+
+.dac-fab, .dac-button-social, .button, .landing-button,
+.dac-button {
   background: transparent;
   border: 0;
   border-radius: 3px;
@@ -6355,16 +5650,19 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-me
           user-select: none;
   white-space: nowrap; }
 
-.button, .landing-button, .dac-button.dac-raised {
+.button, .landing-button,
+.dac-button.dac-raised {
   background-color: #FAFAFA;
   box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26); }
 
 .dac-button.dac-raised.dac-primary, .landing-secondary, .button {
   background-color: #039bef; }
   .dac-button.dac-raised.dac-primary:hover, .landing-secondary:hover, .button:hover {
-    background-color: #0288d1; color:#fff; }
+    background-color: #0288d1; }
   .dac-button.dac-raised.dac-primary:active, .landing-secondary:active, .button:active {
     background-color: #0277bd; }
+  .dac-button.dac-raised.dac-primary.disabled, .button.disabled {
+    background-color: #bbb; }
 
 .dac-button.dac-raised.dac-red, .landing-primary {
   background-color: #bf3722; }
@@ -6374,35 +5672,108 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-me
     background-color: #822517; }
 
 .dac-button.dac-raised.dac-green, .landing-button.green {
-  background-color: #90C653; }
-
-.dac-button.dac-raised.dac-primary, .landing-secondary, .button, .dac-button.dac-raised.dac-red, .landing-primary, .dac-button.dac-raised.dac-green, .landing-button.green {
+  background-color: #90c653; }
+  .dac-button.dac-raised.dac-green:hover, .landing-button.green:hover {
+    background-color: #79b03b; }
+  .dac-button.dac-raised.dac-green:active, .landing-button.green:active {
+    background-color: #699933; }
+
+.dac-button.dac-raised.dac-primary, .landing-secondary, .button,
+.dac-button.dac-raised.dac-red,
+.landing-primary,
+.dac-button.dac-raised.dac-green,
+.landing-button.green {
   color: #fff; }
 
 .dac-button.dac-large, .landing-button {
   padding: 12px 24px; }
 
-.dac-fab {
+.dac-fab, .dac-button-social {
   background: #fff;
   box-shadow: 0 2px 5px rgba(0, 0, 0, 0.26);
   border-radius: 50%;
-  font-size: 0;
   height: 36px;
   line-height: 36px;
+  margin: 0;
   min-width: 0;
   overflow: hidden;
   padding: 0;
   vertical-align: middle;
   width: 36px; }
-  .dac-fab:hover, a:hover > .dac-fab {
+  .dac-fab:hover, .dac-button-social:hover,
+  a:hover > .dac-fab,
+  a:hover > .dac-button-social {
     box-shadow: 0 3px 8px rgba(0, 0, 0, 0.26); }
-  .dac-fab.dac-primary {
+  .dac-fab > .dac-sprite, .dac-button-social > .dac-sprite, .dac-fab > .dac-modal-header-close:before, .dac-button-social > .dac-modal-header-close:before, .paging-links .dac-fab > .prev-page-link:before, .paging-links .dac-button-social > .prev-page-link:before, .paging-links .dac-fab > .next-page-link:before, .paging-links .dac-button-social > .next-page-link:before, .paging-links .dac-fab > .next-class-link:before, .paging-links .dac-button-social > .next-class-link:before, .paging-links .dac-fab > .start-class-link:after, .paging-links .dac-button-social > .start-class-link:after {
+    margin-top: -2px; }
+  .dac-fab.dac-primary, .dac-primary.dac-button-social {
     background: #00c7a0; }
-  .dac-fab.dac-large {
+  .dac-fab.dac-large, .dac-large.dac-button-social {
     height: 54px;
     line-height: 54px;
     width: 54px; }
 
+.dac-button-social {
+  background: #ccc;
+  box-shadow: none;
+  position: relative;
+  overflow: hidden; }
+  .dac-button-social::after {
+    background: rgba(0, 0, 0, 0.2);
+    border-radius: 50%;
+    bottom: 0;
+    content: '';
+    display: block;
+    left: 0;
+    opacity: 0;
+    position: absolute;
+    right: 0;
+    top: 0;
+    -webkit-transition: opacity .3s;
+            transition: opacity .3s; }
+  .dac-button-social:hover {
+    box-shadow: none; }
+  .dac-button-social:active::after {
+    opacity: 1; }
+  .dac-button-social:focus.dac-rss, .dac-button-social:hover.dac-rss {
+    background: #ff9800; }
+  .dac-button-social:focus.dac-youtube, .dac-button-social:hover.dac-youtube {
+    background: #f44336; }
+  .dac-button-social:focus.dac-gplus, .dac-button-social:hover.dac-gplus {
+    background: #f44336; }
+  .dac-button-social:focus.dac-twitter, .dac-button-social:hover.dac-twitter {
+    background: #55acee; }
+
+.dac-action {
+  display: inline-block;
+  margin: 0 16px; }
+  .dac-action-link {
+    color: inherit;
+    font-size: 24px;
+    font-weight: 300;
+    line-height: 50px;
+    -webkit-transition: opacity .3s;
+            transition: opacity .3s; }
+    .dac-action-link:hover {
+      color: inherit;
+      opacity: .54; }
+  .dac-action-sprite {
+    margin-left: -12px;
+    margin-right: -8px; }
+  .dac-actions {
+    list-style-type: none;
+    margin: 0;
+    padding-bottom: 24px;
+    padding-top: 24px;
+    text-align: center; }
+    @media (max-width: 719px) {
+      .dac-actions {
+        text-align: left; } }
+  @media (max-width: 719px) {
+    .dac-action {
+      display: block;
+      margin: 0; } }
+
 .dac-scroll-button {
   height: 54px;
   line-height: 54px;
@@ -6437,17 +5808,19 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-me
     text-align: right; }
   .dac-footer-contact, .dac-footer-social {
     display: inline-block; }
-  .dac-footer .dac-footer-getnews, .dac-footer .dac-footer-contact-link {
+  .dac-footer .dac-footer-getnews,
+  .dac-footer .dac-footer-contact-link {
     color: #000;
     cursor: pointer;
     font-size: 20px;
     font-weight: 300;
     margin: 8px 0;
     vertical-align: middle; }
-  .dac-footer .dac-footer-contact-link, .dac-footer .dac-footer-social-link {
+  .dac-footer .dac-footer-contact-link,
+  .dac-footer .dac-footer-social-link {
     margin-left: 16px;
     margin-right: 0; }
-  .dac-footer-getnews > .dac-fab {
+  .dac-footer-getnews > .dac-fab, .dac-footer-getnews > .dac-button-social {
     margin-left: 4px; }
   .dac-footer-separator {
     background: #f0f0f0;
@@ -6477,7 +5850,8 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-me
       display: block; }
     .dac-footer-social-link, .dac-footer-contact-link {
       display: inline-block; }
-    .dac-footer .dac-footer-contact-link, .dac-footer .dac-footer-social-link {
+    .dac-footer .dac-footer-contact-link,
+    .dac-footer .dac-footer-social-link {
       margin-left: 0;
       margin-right: 16px; }
     .dac-footer .locales {
@@ -6492,6 +5866,8 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-me
   margin: 0 auto;
   max-width: 940px;
   clear: both; }
+  .dac-fullscreen-mode .wrap {
+    max-width: none; }
 
 .cols {
   margin-left: -10px;
@@ -6932,7 +6308,7 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-me
 .col-push-15of16 {
   left: 93.75%; }
 
-@media (max-width: 960px) and (min-width: 720px) {
+@media (max-width: 959px) and (min-width: 720px) {
   .col-tablet-1of1, .col-tablet-2of2, .col-tablet-3of3, .col-tablet-4of4, .col-tablet-5of5, .col-tablet-6of6, .col-tablet-8of8, .col-tablet-10of10, .col-tablet-12of12, .col-tablet-16of16 {
     width: 100%; }
   .col-tablet-1of2, .col-tablet-2of4, .col-tablet-3of6, .col-tablet-4of8, .col-tablet-5of10, .col-tablet-6of12, .col-tablet-8of16 {
@@ -7127,69 +6503,83 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-me
     left: 93.75%; } }
 
 .col-3-wide {
-  width: 33.33333333%; }
+  width: 33.3333333333%; }
 
 @media (max-width: 719px) {
   /* Remove .col-12 and .col-13 backward compatibility support as soon as it's been removed. */
-[class*=col-], .col-12 [class*=col-], .col-13 [class*=col-] {
+[class*=col-],
+  .col-12 [class*=col-],
+  .col-13 [class*=col-] {
   float: none;
   left: 0;
   width: auto;
 } }
 
+/**
+ * Fades out an element.
+ * Applies visibility hidden when the transition is finished.
+ *
+ * Use opacity: 1; to show the element.
+ */
 /* Header component */
 .dac-header {
-  background: #fff;
-  height: 64px;
-  margin: 0 -20px;
-}
-
-@media (max-width: 719px) {
-  .dac-header {
-    margin: 0 -10px;
-  }
-}
-
-.about .dac-header, .distribute .dac-header, .develop .dac-header {
-  height: 128px;
-}
-
-.dac-header-inner {
-  background: #fff;
-  box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.07);
-  box-sizing: border-box;
+  box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.07);
+  box-sizing: border-box;
+  background: #6ab344;
   height: 64px;
+  margin: 0;
   left: 0;
+  position: fixed;
   right: 0;
   top: 0;
-  z-index: 52;
+  -webkit-transition: background 200ms;
+  transition: background 200ms;
+  z-index: 61;
 }
 
-.dac-header.dac-sub .dac-header-inner {
-  border-bottom: 1px solid #e5e5e5;
-  box-shadow: none;
+.dac-ndk {
+  background: #00bcd4;
 }
 
-.dac-header.is-sticky .dac-header-inner {
-  position: fixed;
-  -webkit-animation: .3s dac-header-show;
-  animation: .3s dac-header-show;
+.dac-search-mode .dac-header {
+  background: #b0bec5;
+  -webkit-transition: background 200ms;
+  transition: background 200ms;
+}
+
+.dac-search-mode .dac-header-logo,
+  .dac-search-mode .dac-header-console-btn {
+  opacity: 0;
+  visibility: hidden;
+  -webkit-transition: visibility 0s linear 200ms, opacity 200ms linear;
+  transition: visibility 0s linear 200ms, opacity 200ms linear;
 }
 
 .dac-header-logo {
-  border-right: 1px solid #e5e5e5;
   display: block;
   font-size: 20px;
-  font-weight: 300;
+  font-weight: 400;
   float: left;
   letter-spacing: .3px;
   line-height: 36px;
-  margin-right: 16px;
-  padding: 14px 24px 14px;
+  opacity: 1;
+  padding: 13px 48px 15px 0;
 }
 
 .dac-header-logo, .dac-header-logo:hover, .dac-header-logo:focus {
-  color: #444;
+  color: #fff;
+}
+
+@media (min-width: 980px) {
+  .dac-header-logo {
+    border-right: 1px solid rgba(0, 0, 0, 0.1);
+  }
+}
+
+@media (min-width: 720px) and (max-width: 979px) {
+  .dac-header-logo {
+    padding-right: 10px;
+  }
 }
 
 .dac-header-logo-image {
@@ -7197,26 +6587,92 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-me
   vertical-align: top;
 }
 
+.dac-header-tabs {
+  list-style: none;
+  margin: 0 10px;
+  display: none;
+  opacity: 1;
+  -webkit-transition: opacity 200ms linear 200ms;
+  transition: opacity 200ms linear 200ms;
+}
+
+@media (min-width: 720px) and (max-width: 979px) {
+  .dac-header-tabs {
+    display: inline-block;
+  }
+}
+
+@media (min-width: 980px) {
+  .dac-header-tabs {
+    display: inline-block;
+  }
+}
+
+.dac-header-tabs li {
+  display: inline-block;
+}
+
+.dac-header-tab {
+  display: inline-block;
+  line-height: 64px;
+  height: 64px;
+  padding: 0 9px;
+  color: #fff;
+  color: rgba(255, 255, 255, 0.7);
+  font-size: 14px;
+  text-transform: uppercase;
+  font-weight: 500;
+}
+
+.dac-header-tab:hover {
+  color: #fff;
+}
+
+.dac-header-tab.selected {
+  border-bottom: 4px solid #fff;
+  height: 60px;
+  color: #fff;
+}
+
+.dac-search-mode .dac-header-tabs {
+  opacity: 0;
+  -webkit-transition: opacity 0ms linear 0ms;
+  transition: opacity 0ms linear 0ms;
+}
+
 .dac-header-console-btn {
-  border: 1px solid #c5c5c5;
   border-radius: 3px;
-  box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.11);
-  background: #fff;
+  box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.2);
   float: right;
   font-size: 14px;
+  font-weight: 500;
   line-height: 28px;
-  margin: 17px 30px 17px 10px;
-  padding: 0 10px;
+  margin: 13px 13px 12px 24px;
+  opacity: 1;
+  padding: 4px 10px;
   position: relative;
-  z-index: 52;
+  text-transform: uppercase;
+  -webkit-transition: box-shadow .2s;
+  transition: box-shadow .2s;
+  z-index: 60;
+}
+
+@media (min-width: 720px) and (max-width: 979px) {
+  .dac-header-console-btn {
+    display: none;
+  }
 }
 
-.dac-header-console-btn > .dac-sprite {
+.dac-header-console-btn > .dac-sprite, .dac-header-console-btn > .dac-modal-header-close:before, .paging-links .dac-header-console-btn > .prev-page-link:before, .paging-links .dac-header-console-btn > .next-page-link:before, .paging-links .dac-header-console-btn > .next-class-link:before, .paging-links .dac-header-console-btn > .start-class-link:after {
   margin-right: 5px;
 }
 
 .dac-header-console-btn, .dac-header-console-btn:hover, .dac-header-console-btn:focus {
-  color: #666;
+  color: #fff;
+}
+
+.dac-header-console-btn:hover {
+  box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.3);
 }
 
 .dac-header-console-btn:focus {
@@ -7226,23 +6682,16 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-me
 
 @media (max-width: 719px) {
   .dac-header {
-    height: 64px !important;
     text-align: center;
   }
 
-  .dac-header-inner {
-    position: fixed;
-  }
-
   .dac-header-logo {
     border-right: 0;
     display: inline-block;
     margin-right: 0;
     float: none;
-  }
-
-  .dac-header.dac-sub {
-    display: none;
+    padding-left: 0;
+    padding-right: 0;
   }
 
   .dac-header-console-btn {
@@ -7250,57 +6699,37 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-me
   }
 }
 
-@-webkit-keyframes dac-header-show {
-  0% {
-    -webkit-transform: translateY(-64px);
-    transform: translateY(-64px);
-  }
-
-  100% {
-    -webkit-transform: translateY(0);
-    transform: translateY(0);
-  }
-}
-
-@keyframes dac-header-show {
-  0% {
-    -webkit-transform: translateY(-64px);
-    transform: translateY(-64px);
-  }
-
-  100% {
-    -webkit-transform: translateY(0);
-    transform: translateY(0);
-  }
-}
-
 /* Header Breadcrumbs component */
 .dac-header-crumbs {
-  display: none;
   list-style-type: none;
-  margin: 0;
+  margin: 23px 0 -13px 0;
+  display: inline-block;
 }
 
-.is-sticky .dac-header-crumbs {
-  display: block;
+.dac-header-crumbs.dac-has-content {
+  opacity: 1;
 }
 
 .dac-header-crumbs-item {
   float: left;
   position: relative;
   margin: 0;
-  padding-left: 10px;
+  padding: 0;
+}
+
+.dac-header-crumbs-item i, .dac-header-crumbs-item .dac-nav-link-forward {
+  display: none;
 }
 
 .dac-header-crumbs-item:before {
-  color: #444;
-  content: '>';
-  font-weight: 300;
-  font-size: 20px;
-  left: 0;
-  line-height: 28px;
-  padding: 16px 0;
+  content: '';
+  background: transparent url(../images/styles/disclosure_right.png) no-repeat scroll 50% 50%;
+  width: 10px;
+  height: 10px;
+  display: inline-block;
   position: absolute;
+  top: 12px;
+  left: -15px;
 }
 
 .dac-header-crumbs-item:first-child:before {
@@ -7308,622 +6737,1187 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-me
 }
 
 .dac-header-crumbs-link {
-  color: #444;
   display: block;
   font-size: 16px;
-  font-weight: 300;
   line-height: 32px;
-  padding: 16px 16px;
-  -webkit-transition: background-color 0.35s cubic-bezier(0.35, 0, 0.25, 1);
-  transition: background-color 0.35s cubic-bezier(0.35, 0, 0.25, 1);
+  padding: 0 20px 0 0;
 }
 
-.dac-header-crumbs-link:hover, .dac-header-crumbs-link:focus {
-  color: rgba(68, 68, 68, 0.7);
+.dac-header-crumbs-link, .dac-header-crumbs-link:hover, .dac-header-crumbs-link:focus {
+  color: #666;
 }
 
 .dac-header-crumbs-link:focus {
-  background: rgba(63, 81, 181, 0.1);
   outline: 0;
+  text-decoration: underline;
 }
 
 .dac-header-crumbs-link.current {
-  color: #6ab344;
   font-weight: 400;
 }
 
-.dac-header-crumbs-link.current.ndk {
-  color: #00BCD4;
-}
-
-@media (max-width: 719px) {
-  .dac-header-crumbs {
-    display: none;
-  }
-}
-
 /* Header site search component */
 .dac-header-search {
-  background: #fff;
-  border-left: 1px solid #e5e5e5;
-  display: block;
-  float: right;
-  height: 28px;
-  padding: 18px 0;
-  position: relative;
-  overflow: hidden;
-  -webkit-transition: width 0.4s ease, left 0.4s ease;
-  transition: width 0.4s ease, left 0.4s ease;
-  width: 64px;
-  z-index: 52;
-}
-
-.dac-header-search:hover, .dac-header-search.active {
-  width: 228px;
+  bottom: 64px;
+  position: absolute;
+  right: 220px;
+  top: 0;
+  width: 238px;
+  -webkit-transition: width 300ms, right 100ms, margin 100ms;
+  transition: width 300ms, right 100ms, margin 100ms;
 }
 
 .dac-header-search-inner {
-  width: 228px;
+  margin: 0 auto;
+  max-width: 940px;
+  position: relative;
+  width: 100%;
 }
 
-.dac-header-search-btn {
-  left: 20px;
-  position: absolute;
-  top: 20px;
-  opacity: .54;
-}
+@media (min-width: 980px) {
+  .dac-header-search-inner::after {
+    background: -webkit-linear-gradient(right, #6ab344, rgba(106, 179, 68, 0));
+    background: linear-gradient(to left, #6ab344, rgba(106, 179, 68, 0));
+    content: '';
+    display: block;
+    height: 64px;
+    position: absolute;
+    right: 100%;
+    top: 0;
+    -webkit-transition: opacity 200ms, -webkit-transform 300ms;
+    transition: opacity 200ms, transform 300ms;
+    -webkit-transform-origin: right center;
+    -ms-transform-origin: right center;
+    transform-origin: right center;
+    width: 64px;
+  }
 
-.dac-header-search-form {
-  left: 54px;
-  opacity: 0;
-  position: absolute;
-  right: 24px;
-  top: 20px;
-  -webkit-transition: opacity .4s;
-  transition: opacity .4s;
+  .dac-search-mode .dac-header-search-inner::after {
+    opacity: 0;
+    -webkit-transform: scaleX(0);
+    -ms-transform: scaleX(0);
+    transform: scaleX(0);
+  }
 }
 
-.dac-header-search:hover .dac-header-search-form, .dac-header-search.active .dac-header-search-form {
-  opacity: 1;
+.dac-header-search-icon {
+  left: 8px;
+  pointer-events: none;
+  position: absolute;
+  top: 18px;
 }
 
 .dac-header-search-input {
-  background-color: transparent;
+  background: #77be53;
+  border-radius: 3px;
   border: none;
-  border-bottom: 1px solid #CCC;
-  border-radius: 0;
   box-sizing: border-box;
-  color: #2f2f2f;
+  color: #fff;
   font-size: 14px;
-  height: 24px;
-  outline: none;
-  padding: 4px 20px 4px 0;
+  font-weight: 600;
+  margin: 13px 0;
+  padding: 9px 36px 10px;
+  -webkit-transition: background 200ms, color 200ms;
+  transition: background 200ms, color 200ms;
   width: 100%;
-  z-index: 1500;
 }
 
-.dac-header-search-input:focus {
-  color: #222;
-  font-weight: bold;
-  outline: 0;
+.dac-header-search-close, .dac-header-search-clear {
+  background: none;
+  border: none;
+  cursor: pointer;
+  font-size: 0;
+  outline: none;
+  position: absolute;
+  margin: 0;
+}
+
+.dac-header-search-clear {
+  display: inline-block;
+  opacity: .4;
+  padding: 8px;
+  top: 15px;
+  right: 0;
+}
+
+.dac-header-search-clear:hover, .dac-header-search-clear:focus {
+  opacity: .8;
 }
 
 .dac-header-search-close {
-  position: absolute;
-  right: 4px;
-  bottom: 4px;
-  width: 16px;
-  height: 16px;
-  margin: 0;
-  text-indent: -1000em;
-  background: url(../images/close.png) no-repeat 0 0;
-  z-index: 9999;
+  left: -45px;
+  top: 20px;
+  -webkit-transform: translateX(45px);
+  -ms-transform: translateX(45px);
+  transform: translateX(45px);
+  visibility: hidden;
 }
 
-.dac-header-search-close:hover, .dac-header-search-close:focus {
-  background-position: -16px 0;
-  cursor: pointer;
+.dac-header-search ::-webkit-input-placeholder {
+  color: #fff;
+  font-weight: 300;
+  -webkit-transition: color 200ms;
+  transition: color 200ms;
 }
 
-@media (max-width: 719px) {
-  .dac-header-search {
-    position: absolute;
-    left: calc(100% - 64px);
-    right: 0;
-    top: 0;
-    width: auto;
-  }
+.dac-header-search :-moz-placeholder {
+  color: #fff;
+  font-weight: 300;
+  transition: color 200ms;
+}
 
-  .dac-header-search:hover, .dac-header-search.active {
-    left: 64px;
-    width: auto;
-  }
+.dac-header-search ::-moz-placeholder {
+  color: #fff;
+  font-weight: 300;
+  transition: color 200ms;
 }
 
-/* Main navigation component */
-.is-sticky .dac-nav, .dac-nav-head, .dac-nav-toggle {
-  display: none;
+.dac-header-search :-ms-input-placeholder {
+  color: #fff;
+  font-weight: 300;
+  transition: color 200ms;
 }
 
-.dac-nav-list {
-  list-style-type: none;
-  left: 192px;
-  margin: 0;
-  position: absolute;
-  right: 0;
-  top: 0;
-  z-index: 51;
+.dac-header-search-input:focus {
+  outline: 0;
 }
 
-.dac-nav-item {
-  float: left;
-  margin: 0;
+.dac-search-mode .dac-header-search {
+  width: 940px;
+  right: 50%;
+  margin-right: -470px;
 }
 
-.dac-nav-head {
-  margin-bottom: 10px;
+.dac-search-mode .dac-header-search .dac-header-search-input::after {
+  background: -webkit-linear-gradient(right, #b0bec5, rgba(176, 190, 197, 0));
+  background: linear-gradient(to left, #b0bec5, rgba(176, 190, 197, 0));
 }
 
-.dac-nav-dimmer {
-  background: #000;
-  display: none;
-  height: 100%;
-  left: 0;
-  opacity: 0;
-  position: fixed;
-  top: 0;
-  -webkit-transition: visibility 0s linear .3s, opacity .3s linear;
-  transition: visibility 0s linear .3s, opacity .3s linear;
-  -webkit-transform: translateZ(0);
-  transform: translateZ(0);
-  visibility: hidden;
-  width: 100%;
-  z-index: 52;
-}
-
-.dac-nav-hamburger {
-  display: inline-block;
-  height: 15px;
-  width: 16px;
-}
-
-.dac-nav-hamburger-top, .dac-nav-hamburger-mid, .dac-nav-hamburger-bot {
-  background: #999;
-  display: block;
-  height: 3px;
-  margin: 3px 0 0;
-  width: 100%;
-}
-
-.dac-nav-link {
-  color: #444;
-  display: block;
-  font-size: 16px;
-  font-weight: 300;
-  letter-spacing: .24px;
-  line-height: 32px;
-  padding: 18px 16px 14px;
-  -webkit-transition: background-color 0.35s cubic-bezier(0.35, 0, 0.25, 1);
-  transition: background-color 0.35s cubic-bezier(0.35, 0, 0.25, 1);
-}
-
-.dac-nav-link:hover, .dac-nav-link:focus {
-  color: rgba(68, 68, 68, 0.7);
-}
-
-.dac-nav-link:focus {
-  background: rgba(63, 81, 181, 0.1);
-  outline: 0;
-}
-
-.dac-nav-link.has-subnav, .dac-nav-link.selected {
-  border-bottom: 3px solid #6ab344;
-  font-weight: 500;
-  padding-bottom: 11px;
-}
-
-.dac-nav-link.has-subnav.ndk, .dac-nav-link.selected.ndk {
-  border-bottom: 3px solid #00BCD4;
-}
-
-.dac-nav-secondary {
-  border-bottom: 1px solid #e5e5e5;
-  display: none;
-  left: -192px;
-  list-style-type: none;
-  margin: 0;
-  position: absolute;
-  top: 64px;
-  right: 0;
+.dac-search-mode .dac-header-search .dac-header-search-close {
+  -webkit-transition: -webkit-transform 200ms ease-out 300ms;
+  transition: transform 200ms ease-out 300ms;
+  -webkit-transform: translateX(0);
+  -ms-transform: translateX(0);
+  transform: translateX(0);
+  visibility: visible;
 }
 
-.dac-nav-link.has-subnav + .dac-nav-secondary, .dac-nav-link.selected + .dac-nav-secondary {
-  display: block;
+.dac-search-mode .dac-header-search .dac-header-search-icon {
+  left: 23px;
 }
 
-.dac-nav-secondary .dac-nav-link {
+.dac-search-mode .dac-header-search .dac-header-search-input {
+  background: #fff;
+  border-radius: 0;
+  font-size: 18px;
   color: #666;
-  padding: 17px 16px 15px;
+  padding-left: 55px;
+  margin-top: 11px;
 }
 
-.dac-nav-secondary .dac-nav-link:hover, .dac-nav-secondary .dac-nav-link:focus {
-  color: rgba(102, 102, 102, 0.7);
+.dac-search-mode .dac-header-search ::-webkit-input-placeholder {
+  color: #505050;
 }
 
-@media (min-width: 720px) and (max-width: 979px) {
-  .dac-nav-secondary .dac-nav-link {
-    padding-left: 8px;
-    padding-right: 8px;
-  }
+.dac-search-mode .dac-header-search :-moz-placeholder {
+  color: #505050;
 }
 
-.dac-nav-secondary .dac-nav-link.selected {
-  border: none;
-  font-weight: 700;
+.dac-search-mode .dac-header-search ::-moz-placeholder {
+  color: #505050;
 }
 
-.dac-nav-secondary .dac-nav-link.selected.ndk {
-  border: none;
-  font-weight: 700;
+.dac-search-mode .dac-header-search :-ms-input-placeholder {
+  color: #505050;
 }
 
-@media (max-width: 719px) {
-  .dac-nav-open {
-    overflow: hidden;
+@media (min-width: 720px) and (max-width: 979px) {
+  .dac-header-search {
+    right: 20px;
+    width: 200px;
+    -webkit-transition: left 200ms, right 200ms, width 200ms;
+    transition: left 200ms, right 200ms, width 200ms;
   }
 
-  .dac-nav-toggle {
-    border-right: 1px solid #e5e5e5;
-    display: inline-block;
-    position: absolute;
-    left: 0;
-    line-height: 64px;
-    text-align: center;
-    width: 64px;
+  .dac-search-mode .dac-header-search {
+    left: 60px;
+    right: 0;
+    width: 100%;
   }
 
-  .dac-nav-head, .dac-nav-secondary, .dac-nav-dimmer {
-    display: block;
+  .dac-search-mode .dac-header-search .dac-header-search-inner {
+    margin: 0;
+    width: calc(100% - 60px - 10px);
   }
 
-  .dac-nav-dimmer.dac-nav-open {
-    opacity: .8;
-    -webkit-transition-delay: 0s;
-    transition-delay: 0s;
-    visibility: visible;
+  .dac-header-search-close {
+    left: -42px;
   }
+}
 
-  .dac-nav-list {
-    background: #fff;
+@media (max-width: 719px) {
+  .dac-header-search {
     bottom: 0;
-    left: auto;
-    max-width: 280px;
-    -webkit-overflow-scrolling: touch;
-    overflow-y: scroll;
-    padding: 0 0 20px 0;
-    position: fixed;
-    right: 100%;
+    border-radius: 0;
+    border-left: 1px solid rgba(0, 0, 0, 0.1);
+    cursor: pointer;
+    left: calc(100% - 64px);
+    margin: 0;
+    overflow: hidden;
+    padding-left: 10px;
+    padding-right: 10px;
+    position: absolute;
+    right: 0;
     top: 0;
-    -webkit-transition: -webkit-transform .3s ease;
-    transition: transform .3s ease;
-    width: 85%;
-    z-index: 52;
   }
 
-  .dac-nav-list.dac-nav-open {
-    -webkit-transform: translate3d(100%, 0, 0);
-    transform: translate3d(100%, 0, 0);
+  .dac-header-search-input {
+    background: none;
+    cursor: pointer;
+    opacity: 0;
   }
 
-  .dac-nav-secondary {
-    border: none;
-    position: static;
+  .dac-search-mode .dac-header-search {
+    background: #b0bec5;
+    cursor: default;
+    overflow: visible;
+    left: 60px;
+    right: 0;
     width: 100%;
+    -webkit-transition: left 200ms, right 200ms, width 200ms;
+    transition: left 200ms, right 200ms, width 200ms;
+    padding: 0;
+    border: none;
   }
 
-  .dac-nav-item {
-    float: none;
+  .dac-search-mode .dac-header-search .dac-header-search-inner {
+    margin: 0;
+    width: calc(100% - 60px - 10px);
   }
 
-  .dac-nav-link {
-    display: block;
-    font-size: 12px;
-    font-weight: 600;
-    color: #333;
-    padding: 0 20px;
+  .dac-search-mode .dac-header-search .dac-header-search-input {
+    opacity: 1;
   }
+}
 
-  .dac-nav-link.selected {
-    color: #09f;
-  }
+.highlighted em {
+  color: #333;
+  font-style: normal;
+  font-weight: 700;
+}
 
-  .dac-nav-secondary .dac-nav-link {
-    font-weight: 400;
-    margin-left: 20px;
-    margin-right: 20px;
-    padding: 0 20px;
-  }
+.card-info .title.highlighted {
+  color: #666;
+}
 
-  .dac-nav-link.has-subnav, .dac-nav-link.selected {
-    border: none;
-    padding: 0 20px;
-  }
+/* Main navigation component */
+.dac-nav-sidebar {
+  background: #f5f8fa;
+  border-right: 1px solid rgba(0, 0, 0, 0.1);
+  bottom: 0;
+  left: 0;
+  overflow: hidden;
+  padding: 0;
+  position: fixed;
+  top: 64px;
+  -webkit-transform: translate(-100%, 0);
+  -ms-transform: translate(-100%, 0);
+  transform: translate(-100%, 0);
+  width: 250px;
+  z-index: 60;
+}
 
-  .dac-nav-link.has-subnav.ndk, .dac-nav-link.selected.ndk {
-    border: none;
-    padding: 0 20px;
-  }
+.dac-nav-animating .dac-nav-sidebar {
+  -webkit-transition: -webkit-transform .3s;
+  transition: transform .3s;
+}
 
-  .dac-logo-image {
-    margin-right: 5px;
-    vertical-align: top;
-  }
+.dac-nav-open .dac-nav-sidebar {
+  -webkit-transform: translate(0, 0);
+  -ms-transform: translate(0, 0);
+  transform: translate(0, 0);
+}
 
-  .dac-nav-logo {
-    box-shadow: 0 2px 2px rgba(0, 0, 0, 0.04);
-    font-size: 20px;
-    font-weight: 300;
-    letter-spacing: .3px;
-    line-height: 36px;
-    padding: 14px 24px;
-  }
+.dac-search-mode .dac-nav-sidebar {
+  -webkit-transition: -webkit-transform .3s;
+  transition: transform .3s;
+  -webkit-transform: translate(-100%, 0);
+  -ms-transform: translate(-100%, 0);
+  transform: translate(-100%, 0);
+}
 
-  .dac-nav-logo, .dac-nav-logo:hover, .dac-nav-logo:focus {
-    color: #444;
-  }
+.dac-nav .dac-swap-section {
+  -webkit-transition-duration: .3s;
+  transition-duration: .3s;
 }
 
-/* Hero carousel */
-.dac-hero {
-  background-color: #fff;
-  background-position: 50% 30%;
-  background-size: cover;
-  box-sizing: border-box;
-  font-size: 16px;
-  min-height: 550px;
-  padding-top: 88px;
+.dac-nav-back {
+  margin-top: -3px;
+  margin-right: 10px;
 }
 
-.dac-hero.dac-darken::before {
-  background: rgba(0, 0, 0, 0.3);
-  bottom: 0;
-  content: '';
-  display: block;
-  left: 0;
+.dac-nav-fullscreen {
+  background: transparent;
+  border: none;
+  bottom: 100%;
+  cursor: pointer;
+  display: none;
+  opacity: .8;
+  outline: none;
+  padding: 20px 15px;
   position: absolute;
   right: 0;
-  top: 0;
 }
 
-@media (max-width: 719px) {
-  .dac-hero.dac-darken::before {
-    background: -webkit-linear-gradient(top, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.9) 80%);
-    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.9) 80%);
+@media (min-width: 980px) {
+  .dac-nav-fullscreen {
+    display: inline-block;
   }
 }
 
-.dac-hero.dac-darken .dac-hero-content {
-  position: relative;
+.dac-nav-fullscreen:hover {
+  opacity: 1;
 }
 
-@media (max-width: 719px) {
-  .dac-hero {
-    padding-bottom: 20px;
-    padding-top: 20px;
-  }
+.dac-nav-sub-slider {
+  cursor: pointer;
+  opacity: .5;
+  position: absolute;
+  right: 7px;
+  top: 5px;
 }
 
-.dac-hero-tag {
-  font-size: 11px;
-  font-weight: 700;
-  letter-spacing: .07em;
-  margin-bottom: 2px;
-  text-transform: uppercase;
+.dac-nav-back-button {
+  background: #546e7a;
+  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
+  display: block;
+  font-weight: 500;
+  font-size: 18px;
+  left: 0;
+  margin: 0;
+  padding: 20px;
+  position: absolute !important;
+  right: 0;
+  top: 0;
+  z-index: 1;
 }
 
-.dac-hero-title {
-  margin: 0 0 14px;
+.dac-nav-back-button, .dac-nav-back-button:hover, .dac-nav-back-button:active {
+  color: rgba(255, 255, 255, 0.7);
 }
 
-@media (max-width: 719px) {
-  .dac-hero-title {
-    font-size: 28px;
-    line-height: 35px;
-  }
+.dac-nav-back-button > .dac-sprite, .dac-nav-back-button > .dac-modal-header-close:before, .paging-links .dac-nav-back-button > .prev-page-link:before, .paging-links .dac-nav-back-button > .next-page-link:before, .paging-links .dac-nav-back-button > .next-class-link:before, .paging-links .dac-nav-back-button > .start-class-link:after {
+  opacity: .7;
 }
 
-.dac-hero-description {
-  margin-bottom: 16px;
+.dac-nav-logo {
+  font-size: 20px;
+  font-weight: 300;
+  letter-spacing: .3px;
+  line-height: 36px;
+  margin: 0;
+  padding: 14px 24px;
 }
 
-@media (max-width: 719px) {
-  .dac-hero-description {
-    font-size: 14px;
-  }
+.dac-nav-logo, .dac-nav-logo:hover, .dac-nav-logo:focus {
+  color: #444;
 }
 
-.dac-hero-cta {
-  display: inline-block;
-  line-height: 40px;
-  margin-right: 20px;
-  -webkit-transition: opacity .3s;
-  transition: opacity .3s;
+.dac-nav-list {
+  bottom: 0;
+  left: 0;
+  list-style-type: none;
+  margin: 0;
+  -webkit-overflow-scrolling: touch;
+  overflow-y: scroll;
+  padding: 16px 0;
+  position: absolute !important;
+  right: 0;
+  top: 0 !important;
+  scrollbar-face-color: #b7baba;
+  scrollbar-track-color: #e5e8e9;
 }
 
-.dac-hero-cta:hover {
-  color: currentColor;
-  opacity: .54;
+.dac-nav-list::-webkit-scrollbar {
+  width: 4px;
+  height: 4px;
 }
 
-.dac-hero-cta .dac-sprite {
-  margin-left: -8px;
+.dac-nav-list::-webkit-scrollbar-thumb {
+  background: #b7baba;
 }
 
-@media (max-width: 719px) {
-  .dac-hero-cta {
-    line-height: 28px;
-  }
+.dac-nav-list::-webkit-scrollbar-track {
+  background: #e5e8e9;
 }
 
-.dac-hero-figure {
-  text-align: center;
+.dac-nav-secondary {
+  margin: 0;
 }
 
-@media (max-width: 719px) {
-  .dac-hero-figure {
-    height: 150px;
-    margin: 15px 0;
-  }
+.dac-nav-item {
+  list-style-type: none;
+  margin: 0 0 10px;
+  position: relative;
+}
 
-  .dac-hero-figure img {
-    max-height: 150px;
-  }
+.dac-nav-secondary .dac-nav-item {
+  margin-bottom: 0;
 }
 
-.dac-hero-carousel {
-  height: 550px;
-  position: relative;
+.dac-nav-head {
+  display: block;
+  font-size: 16px;
+  font-weight: 300;
+  letter-spacing: .24px;
+  line-height: 32px;
+  margin-bottom: 20px;
+  margin-top: 0;
 }
 
-.dac-hero-carousel > .dac-hero {
-  bottom: 0;
+.dac-nav-dimmer {
+  background: #000;
+  display: block;
+  height: 100%;
   left: 0;
-  position: absolute;
-  right: 0;
+  opacity: 0;
+  position: fixed;
   top: 0;
-  will-change: opacity;
+  -webkit-transform: translateZ(0);
+  transform: translateZ(0);
+  visibility: hidden;
+  width: 100%;
+  z-index: 60;
 }
 
-.dac-hero-carousel > .dac-hero, .dac-hero-carousel > .dac-hero .wrap {
-  opacity: 0;
+.dac-nav-animating .dac-nav-dimmer {
+  -webkit-transition: visibility 0s linear .3s, opacity .3s linear;
+  transition: visibility 0s linear .3s, opacity .3s linear;
 }
 
-.dac-hero-carousel > .dac-hero.active {
-  opacity: 1;
-  -webkit-transition: opacity .5s;
-  transition: opacity .5s;
-  z-index: 1;
+.dac-nav-open .dac-nav-dimmer {
+  opacity: .8;
+  -webkit-transition-delay: 0s;
+  transition-delay: 0s;
+  visibility: visible;
 }
 
-.dac-hero-carousel > .dac-hero.active .wrap {
+@media (min-width: 980px) {
+  .dac-nav-dimmer {
+    display: none;
+  }
+}
+
+.dac-nav-hamburger {
+  display: inline-block;
+  float: left;
+  height: 15px;
+  padding: 22px 20px;
+  width: 18px;
+}
+
+@media (max-width: 719px) {
+  .dac-nav-hamburger {
+    border-right: 1px solid rgba(0, 0, 0, 0.1);
+    left: 0;
+    padding-bottom: 27px;
+    position: absolute;
+    top: 0;
+  }
+}
+
+.dac-nav-hamburger-top, .dac-nav-hamburger-mid, .dac-nav-hamburger-bot {
+  background: rgba(0, 0, 0, 0.4);
+  display: block;
+  height: 2px;
+  margin: 3px 0 0;
+  opacity: .5;
+  width: 100%;
+}
+
+.dac-nav-animating .dac-nav-hamburger-top, .dac-nav-animating .dac-nav-hamburger-mid, .dac-nav-animating .dac-nav-hamburger-bot {
+  -webkit-transition: opacity .3s;
+  transition: opacity .3s;
+}
+
+@media (max-width: 719px) {
+  .dac-nav-hamburger-top, .dac-nav-hamburger-mid, .dac-nav-hamburger-bot {
+    background: #fff;
+    opacity: 1;
+  }
+}
+
+.dac-nav-open .dac-nav-hamburger-top,
+  .dac-nav-open .dac-nav-hamburger-mid,
+  .dac-nav-open .dac-nav-hamburger-bot {
   opacity: 1;
-  -webkit-transition: opacity .5s .5s;
-  transition: opacity .5s .5s;
 }
 
-.dac-hero-carousel > .dac-hero.out, .dac-hero-carousel > .dac-hero.out .wrap {
-  -webkit-transition: opacity 0s .5s;
-  transition: opacity 0s .5s;
+.dac-search-mode .dac-nav-hamburger {
   opacity: 0;
+  visibility: hidden;
+  -webkit-transition: visibility 0s linear 200ms, opacity 200ms linear;
+  transition: visibility 0s linear 200ms, opacity 200ms linear;
 }
 
-.dac-hero-carousel-action {
-  bottom: 0;
+.dac-nav-link {
+  color: #444;
   display: block;
-  left: 0;
+  font-size: 18px;
+  font-weight: 500;
+  letter-spacing: .24px;
+  padding: 5px 20px;
+  -webkit-transition: background-color 0.35s cubic-bezier(0.35, 0, 0.25, 1);
+  transition: background-color 0.35s cubic-bezier(0.35, 0, 0.25, 1);
+}
+
+.dac-nav-link:hover, .dac-nav-link:focus {
+  color: rgba(68, 68, 68, 0.7);
+}
+
+.dac-nav-link:focus {
+  background: rgba(63, 81, 181, 0.1);
+  outline: 0;
+}
+
+.dac-nav-secondary .dac-nav-link {
+  font-size: 12px;
+  font-weight: 400;
+  padding-left: 40px;
+}
+
+.dac-nav-link.selected {
+  background: rgba(63, 81, 181, 0.1);
+  color: #039bef;
+  position: relative;
+}
+
+.dac-nav-link-forward {
+  background: #546E7A;
+  color: #fff;
+  cursor: pointer;
+  display: inline-block;
+  line-height: 34px;
+  padding: 0;
   position: absolute;
   right: 0;
   top: 0;
+  text-align: center;
+  width: 34px;
+}
+
+.dac-nav-link-forward > .dac-nav-forward {
+  opacity: .7;
+  vertical-align: -3px;
+}
+
+.dac-nav-sub {
+  bottom: 0;
+  left: 0;
+  position: absolute !important;
+  top: 65px !important;
+  right: 0;
   z-index: 1;
 }
 
-.dac-hero-carousel .dac-hero-cta {
+#body-content {
+  padding-top: 64px;
+}
+
+.dac-nav-animating #body-content {
+  -webkit-transition: padding .3s;
+  transition: padding .3s;
+}
+
+@media (min-width: 980px) {
+  .dac-nav-open #body-content {
+    padding-left: 250px;
+  }
+}
+
+.dac-nav-open {
+  overflow: hidden;
+}
+
+@media (min-width: 980px) {
+  .dac-nav-open {
+    overflow: visible;
+  }
+}
+
+#devdoc-nav {
+  height: 100%;
+}
+
+.dac-reference-nav {
+  height: calc(100% - 36px);
+  overflow: hidden;
   position: relative;
-  z-index: 1;
 }
 
-.dac-hero-carousel-pagination {
-  bottom: 33px;
+.dac-reference-nav ul,
+  .dac-reference-nav li {
+  margin: 0;
+  list-style-type: none;
+}
+
+.dac-reference-nav-list {
+  bottom: 0;
+  overflow: hidden;
+  overflow-y: scroll;
   left: 0;
+  padding: 10px;
+  padding-left: 20px;
   position: absolute;
   right: 0;
+  top: 0;
+  scrollbar-face-color: #9da4a7;
+  scrollbar-track-color: #c4cdd1;
 }
 
-@media (max-width: 719px) {
-  .dac-hero-carousel-pagination {
-    text-align: center;
-    bottom: 20px;
-  }
+.dac-reference-nav-list::-webkit-scrollbar {
+  width: 4px;
+  height: 4px;
 }
 
-.dac-hero-carousel-pagination .dac-pagination-item {
-  position: relative;
-  z-index: 1;
+.dac-reference-nav-list::-webkit-scrollbar-thumb {
+  background: #9da4a7;
 }
 
-.dac-pagination {
-  list-style: none;
-  margin: 0 -6px;
+.dac-reference-nav-list::-webkit-scrollbar-track {
+  background: #c4cdd1;
 }
 
-.dac-pagination-item {
-  background-clip: content-box;
-  background-color: rgba(153, 153, 153, 0.4);
-  border-radius: 50%;
+.dac-reference-nav-resources {
+  display: none;
+  padding: 0 0 0 13px;
+}
+
+.dac-reference-nav-resource, .dac-reference-nav-toggle {
+  color: #505050;
   cursor: pointer;
-  display: inline-block;
-  height: 14px;
+  display: block;
+  font-size: 13px;
+  line-height: 1;
   overflow: hidden;
-  padding: 6px;
-  pointer-events: all;
-  text-indent: 100%;
-  -webkit-transition: background-color .1s ease-in;
-  transition: background-color .1s ease-in;
+  margin: 0;
+  padding: 3px 0;
+  position: relative;
+  text-overflow: ellipsis;
   white-space: nowrap;
-  width: 14px;
-  will-change: background-color;
-}
-
-.dac-pagination-item:hover {
-  background-color: rgba(153, 153, 153, 0.6);
 }
 
-.dac-pagination-item.active, .dac-pagination-item.active:hover {
-  background-color: #6ab344;
+.dac-reference-nav-toggle {
+  margin-left: -12px;
+  padding-left: 12px;
 }
 
-.dac-invert .dac-pagination-item {
-  background-color: rgba(204, 204, 204, 0.2);
+.selected > .dac-reference-nav-resource {
+  color: #039bef;
+  font-weight: 600;
 }
 
-.dac-invert .dac-pagination-item:hover {
-  background-color: rgba(153, 153, 153, 0.4);
+.dac-reference-nav-toggle::before {
+  background: transparent url(../images/styles/disclosure_down.png) no-repeat center center;
+  content: '';
+  display: block;
+  height: 19px;
+  left: 0;
+  position: absolute;
+  top: 0;
+  width: 8px;
 }
 
-@media (max-width: 719px) {
-  .dac-pagination-item {
-    height: 12px;
-    width: 12px;
-  }
+.dac-reference-nav-toggle.dac-closed::before {
+  -webkit-transform: scaleY(-1);
+  -ms-transform: scaleY(-1);
+  transform: scaleY(-1);
 }
 
-/* Form component */
-.dac-form {
-  color: #505050;
-  font-size: 16px;
-  /* Modal Responsive */
+/* nav */
+#nav {
+  background: #cfd8dc;
+  bottom: 0;
+  left: 0;
+  margin: 0;
+  -webkit-overflow-scrolling: touch;
+  overflow-y: scroll;
+  position: absolute !important;
+  right: 0;
+  top: 0 !important;
+  padding: 10px;
+  scrollbar-face-color: #9da4a7;
+  scrollbar-track-color: #c4cdd1;
+  /* section header links */
+  /* nested nav headers */
 }
 
-.dac-form a {
-  color: #000;
+#nav::-webkit-scrollbar {
+  width: 4px;
+  height: 4px;
 }
 
-.dac-form-aside {
-  display: inline-block;
-  font-size: 12px;
-  margin-top: 0;
+#nav::-webkit-scrollbar-thumb {
+  background: #9da4a7;
 }
 
-.dac-form-required {
-  color: #ef4300;
+#nav::-webkit-scrollbar-track {
+  background: #c4cdd1;
 }
 
-.dac-form-fieldset {
+#nav li {
+  font-size: 12px;
+  line-height: 18px;
+  list-style-type: none;
+  margin: 0;
   padding: 0;
 }
 
-.dac-form-legend {
-  display: block;
+#nav a {
+  color: #505050;
+  text-decoration: none;
+  word-wrap: break-word;
+}
+
+#nav .nav-section-header {
+  padding: 0 30px 0 0;
+  position: relative;
+  -webkit-transition: background-color .1s;
+  transition: background-color .1s;
+}
+
+#nav .nav-section-header.empty {
+  padding: 0;
+}
+
+#nav .nav-section-header.empty::after {
+  display: none;
+}
+
+#nav .nav-section-header:after {
+  background: transparent url(../images/styles/disclosure_down.png) no-repeat scroll 50% 50%;
+  content: '';
+  height: 34px;
+  display: block;
+  position: absolute;
+  right: 0;
+  top: 1px;
+  width: 34px;
+}
+
+#nav li.selected a {
+  color: #0288D1;
+}
+
+#nav li.selected ul li a {
+  color: #505050;
+}
+
+#nav li.expanded .nav-section-header {
+  background: #bac2c6;
+}
+
+#nav li.expanded .nav-section-header.empty {
+  background: none;
+}
+
+#nav li.expanded li .nav-section-header {
+  background: none;
+}
+
+#nav li.expanded li ul {
+  padding: 0 10px;
+}
+
+#nav li.expanded > .nav-section-header:after {
+  content: '';
+  background: transparent url(../images/styles/disclosure_up.png) no-repeat scroll 50% 50%;
+  width: 34px;
+  height: 34px;
+}
+
+#nav li.expanded li ul.tree-list-children {
+  padding: 0;
+}
+
+#nav li.expanded li ul.tree-list-children .tree-list-children {
+  padding: 0 0 0 10px;
+}
+
+#nav .nav-section .nav-section .nav-section-header {
+    /* no white line between second level sections */
+  margin-bottom: 0;
+}
+
+#nav > li > div > a {
+  display: block;
+  font-weight: 700;
+  padding: 10px;
+}
+
+#nav .nav-section .nav-section {
+  position: relative;
+  padding: 0;
+  margin: 0;
+}
+
+#nav .nav-section li a {
+    /* first gen child (2nd level li) */
+  display: block;
+  font-weight: 700;
+  text-transform: none;
+  padding: 10px;
+}
+
+#nav .nav-section li li a {
+    /* second gen child (3rd level li) */
+  font-weight: 400;
+  padding: 6px 6px 6px 10px;
+}
+
+#nav li span.tree-list-subtitle {
+  display: inline-block;
+  color: #555;
+  font-size: 12px;
+  padding: 10px;
+  text-transform: uppercase;
+}
+
+#nav li span.tree-list-subtitle:before {
+  content: '—';
+}
+
+#nav li span.tree-list-subtitle:after {
+  content: '—';
+}
+
+#nav li span.tree-list-subtitle.package {
+  padding-top: 15px;
+  cursor: default;
+}
+
+#nav li span.tree-list-subtitle.package:before {
+  content: '';
+}
+
+#nav li span.tree-list-subtitle.package:after {
+  content: '';
+}
+
+#nav li ul.tree-list-children.classes {
+  padding-left: 10px;
+}
+
+#nav li ul {
+  display: none;
+  overflow: hidden;
+  margin: 0;
+}
+
+#nav li ul.animate-height-in {
+  -webkit-transition: height 0.25s ease-in;
+  transition: height 0.25s ease-in;
+}
+
+#nav li ul.animate-height-out {
+  -webkit-transition: height 0.25s ease-out;
+  transition: height 0.25s ease-out;
+}
+
+#nav li ul li {
+  padding: 0;
+}
+
+#nav li li li {
+  padding: 0;
+}
+
+#nav li ul > li {
+  padding: 0;
+}
+
+#nav li ul > li:last-child {
+  padding-bottom: 5px;
+}
+
+#nav li ul.tree-list-children > li:last-child {
+  padding-bottom: 0;
+}
+
+#nav li.expanded ul > li {
+  background: #c4cdd1;
+}
+
+#nav li.expanded ul > li li {
+  background: inherit;
+}
+
+#nav li ul.tree-list-children ul {
+  display: block;
+}
+
+#nav.samples-nav li li li a {
+  padding-top: 3px;
+  padding-bottom: 3px;
+}
+
+#nav.samples-nav li li ul > li:last-child {
+  padding-bottom: 3px;
+}
+
+/* Hero carousel */
+.dac-hero {
+  background-color: #fff;
+  background-position: 50% 30%;
+  background-size: cover;
+  box-sizing: border-box;
+  font-size: 16px;
+  min-height: 550px;
+  padding-top: 88px;
+}
+
+.dac-hero.dac-darken::before {
+  background: rgba(0, 0, 0, 0.3);
+  bottom: 0;
+  content: '';
+  display: block;
+  left: 0;
+  position: absolute;
+  right: 0;
+  top: 0;
+}
+
+@media (max-width: 719px) {
+  .dac-hero.dac-darken::before {
+    background: -webkit-linear-gradient(top, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.9) 80%);
+    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.9) 80%);
+  }
+}
+
+.dac-hero.dac-darken .dac-hero-content {
+  position: relative;
+}
+
+@media (max-width: 719px) {
+  .dac-hero {
+    padding-bottom: 20px;
+    padding-top: 20px;
+  }
+}
+
+.dac-hero-tag {
+  font-size: 11px;
+  font-weight: 700;
+  letter-spacing: .07em;
+  margin-bottom: 2px;
+  text-transform: uppercase;
+}
+
+.dac-hero-title {
+  margin: 0 0 14px;
+}
+
+@media (max-width: 719px) {
+  .dac-hero-title {
+    font-size: 28px;
+    line-height: 35px;
+  }
+}
+
+.dac-hero-description {
+  margin-bottom: 16px;
+}
+
+@media (max-width: 719px) {
+  .dac-hero-description {
+    font-size: 14px;
+  }
+}
+
+.dac-hero-cta {
+  display: inline-block;
+  line-height: 40px;
+  margin-right: 20px;
+  -webkit-transition: opacity .3s;
+  transition: opacity .3s;
+}
+
+.dac-hero-cta:hover {
+  color: currentColor;
+  opacity: .54;
+}
+
+.dac-hero-cta .dac-sprite, .dac-hero-cta .dac-modal-header-close:before, .dac-hero-cta .paging-links .prev-page-link:before, .paging-links .dac-hero-cta .prev-page-link:before, .dac-hero-cta .paging-links .next-page-link:before, .paging-links .dac-hero-cta .next-page-link:before, .dac-hero-cta .paging-links .next-class-link:before, .paging-links .dac-hero-cta .next-class-link:before, .dac-hero-cta .paging-links .start-class-link:after, .paging-links .dac-hero-cta .start-class-link:after {
+  margin-left: -8px;
+}
+
+@media (max-width: 719px) {
+  .dac-hero-cta {
+    line-height: 28px;
+  }
+}
+
+.dac-hero-figure {
+  text-align: center;
+}
+
+@media (max-width: 719px) {
+  .dac-hero-figure {
+    height: 150px;
+    margin: 15px 0;
+  }
+
+  .dac-hero-figure img {
+    max-height: 150px;
+  }
+}
+
+.dac-hero-carousel {
+  height: 550px;
+  position: relative;
+}
+
+.dac-hero-carousel > .dac-hero {
+  bottom: 0;
+  left: 0;
+  position: absolute;
+  right: 0;
+  top: 0;
+  will-change: opacity;
+}
+
+.dac-hero-carousel > .dac-hero,
+    .dac-hero-carousel > .dac-hero .wrap {
+  opacity: 0;
+}
+
+.dac-hero-carousel > .dac-hero.active {
+  opacity: 1;
+  -webkit-transition: opacity .5s;
+  transition: opacity .5s;
+  z-index: 1;
+}
+
+.dac-hero-carousel > .dac-hero.active .wrap {
+  opacity: 1;
+  -webkit-transition: opacity .5s .5s;
+  transition: opacity .5s .5s;
+}
+
+.dac-hero-carousel > .dac-hero.out,
+    .dac-hero-carousel > .dac-hero.out .wrap {
+  -webkit-transition: opacity 0s .5s;
+  transition: opacity 0s .5s;
+  opacity: 0;
+}
+
+.dac-hero-carousel-action {
+  bottom: 0;
+  display: block;
+  left: 0;
+  position: absolute;
+  right: 0;
+  top: 0;
+  z-index: 1;
+}
+
+.dac-hero-carousel .dac-hero-cta {
+  position: relative;
+  z-index: 1;
+}
+
+.dac-hero-carousel-pagination {
+  bottom: 33px;
+  left: 0;
+  position: absolute;
+  right: 0;
+}
+
+@media (max-width: 719px) {
+  .dac-hero-carousel-pagination {
+    text-align: center;
+    bottom: 20px;
+  }
+}
+
+.dac-hero-carousel-pagination .dac-pagination-item {
+  position: relative;
+  z-index: 1;
+}
+
+.dac-pagination {
+  list-style: none;
+  margin: 0 -6px;
+}
+
+.dac-pagination-item {
+  background-clip: content-box;
+  background-color: rgba(153, 153, 153, 0.4);
+  border-radius: 50%;
+  cursor: pointer;
+  display: inline-block;
+  height: 14px;
+  overflow: hidden;
+  padding: 6px;
+  pointer-events: all;
+  text-indent: 100%;
+  -webkit-transition: background-color .1s ease-in;
+  transition: background-color .1s ease-in;
+  white-space: nowrap;
+  width: 14px;
+  will-change: background-color;
+}
+
+.dac-pagination-item:hover {
+  background-color: rgba(153, 153, 153, 0.6);
+}
+
+.dac-pagination-item.active, .dac-pagination-item.active:hover {
+  background-color: #6ab344;
+}
+
+.dac-invert .dac-pagination-item {
+  background-color: rgba(204, 204, 204, 0.2);
+}
+
+.dac-invert .dac-pagination-item:hover {
+  background-color: rgba(153, 153, 153, 0.4);
+}
+
+@media (max-width: 719px) {
+  .dac-pagination-item {
+    height: 12px;
+    width: 12px;
+  }
+}
+
+/* Form component */
+.dac-form {
+  color: #505050;
+  font-size: 16px;
+  /* Modal Responsive */
+}
+
+.dac-form a {
+  color: #000;
+}
+
+.dac-form-aside {
+  display: inline-block;
+  font-size: 12px;
+  margin-top: 0;
+}
+
+.dac-form-required {
+  color: #ef4300;
+}
+
+.dac-form-fieldset {
+  padding: 0;
+}
+
+.dac-form-legend {
+  display: block;
   color: #333;
   font-weight: 500;
   margin: 20px 0 12px;
@@ -7931,418 +7925,912 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-me
   width: 100%;
 }
 
-.dac-form-legend > .dac-form-required {
-  float: right;
-  margin-top: 3px;
-}
+.dac-form-legend > .dac-form-required {
+  float: right;
+  margin-top: 3px;
+}
+
+.dac-form-input {
+  border: 0 solid #e3e3e3;
+  border-bottom-width: 1px;
+  display: block;
+  outline: 0;
+  padding: 1px 0 8px;
+  -webkit-transition: border-color .2s;
+  transition: border-color .2s;
+  width: 100%;
+}
+
+.dac-form-input-group {
+  position: relative;
+}
+
+.dac-form-input-group > .dac-form-required {
+  display: block;
+  bottom: 3px;
+  position: absolute;
+  right: 0;
+}
+
+.dac-form-input:focus {
+  border-bottom-color: #09f;
+}
+
+.dac-form-floatlabel {
+  display: block;
+  cursor: text;
+  margin-top: 5px;
+  pointer-events: none;
+  -webkit-transform-origin: 0 100%;
+  -ms-transform-origin: 0 100%;
+  transform-origin: 0 100%;
+  -webkit-transform: translate3d(0, 22px, 0) scale(1);
+  transform: translate3d(0, 22px, 0) scale(1);
+  -webkit-transition: -webkit-transform .2s;
+  transition: transform .2s;
+}
+
+.dac-focused > .dac-form-floatlabel,
+    .dac-has-value > .dac-form-floatlabel {
+  cursor: default;
+  -webkit-transform: translate3d(0, 0, 0) scale(0.75);
+  transform: translate3d(0, 0, 0) scale(0.75);
+}
+
+.dac-form-radio, .dac-form-checkbox {
+  opacity: 0;
+  position: absolute;
+  visibility: hidden;
+}
+
+.dac-form-radio-group, .dac-form-checkbox-group {
+  display: table;
+}
+
+.dac-form-radio-group + .dac-form-radio-group, .dac-form-checkbox-group + .dac-form-radio-group, .dac-form-radio-group + .dac-form-checkbox-group, .dac-form-checkbox-group + .dac-form-checkbox-group {
+  margin-top: 10px;
+}
+
+.dac-form-radio-button, .dac-form-checkbox-button {
+  box-sizing: border-box;
+  cursor: pointer;
+  display: table-cell;
+  float: left;
+  height: 18px;
+  margin: 2px 10px 0 0;
+  position: relative;
+  width: 18px;
+}
+
+.dac-form-radio-button::after, .dac-form-radio-button::before, .dac-form-checkbox-button::after, .dac-form-checkbox-button::before {
+  box-sizing: border-box;
+  content: '';
+  display: block;
+  position: absolute;
+}
+
+.dac-form-radio-button::after, .dac-form-radio-button::before {
+  border-radius: 50%;
+  height: 100%;
+  width: 100%;
+}
+
+.dac-form-radio-button::before {
+  background: rgba(0, 0, 0, 0.7);
+  -webkit-transform: translateZ(0) scale(0);
+  transform: translateZ(0) scale(0);
+  -webkit-transition: -webkit-transform .3s;
+  transition: transform .3s;
+}
+
+.dac-form-radio-button::after {
+  border: 2px solid rgba(0, 0, 0, 0.7);
+}
+
+.dac-form-radio:checked + .dac-form-radio-button::before {
+  -webkit-transform: translateZ(0) scale(0.5);
+  transform: translateZ(0) scale(0.5);
+}
+
+.dac-form-radio:focus + .dac-form-radio-button::after {
+  border: 2px solid #09f;
+}
+
+.dac-form-checkbox-button::before {
+  border: 1px solid #6c6e6f;
+  border-radius: 3px;
+  height: 100%;
+  -webkit-transition: background .1s ease-out, box-shadow .3s ease-out;
+  transition: background .1s ease-out, box-shadow .3s ease-out;
+  width: 100%;
+}
+
+.dac-form-checkbox-button::after {
+  border-bottom: 2px solid #fff;
+  border-left: 2px solid #fff;
+  bottom: 7px;
+  height: 7px;
+  left: 3px;
+  -webkit-transform: rotate(-45deg);
+  -ms-transform: rotate(-45deg);
+  transform: rotate(-45deg);
+  width: 12px;
+}
+
+.dac-form-checkbox:checked + .dac-form-checkbox-button::before {
+  background: #6c6e6f;
+  -webkit-transition-timing-function: ease-in;
+  transition-timing-function: ease-in;
+}
+
+.dac-form-checkbox:focus + .dac-form-checkbox-button::before,
+  .dac-form-checkbox:active + .dac-form-checkbox-button::before {
+  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
+}
+
+.dac-form-label {
+  cursor: pointer;
+  -webkit-user-select: none;
+  -moz-user-select: none;
+  -ms-user-select: none;
+  user-select: none;
+}
+
+@media (max-width: 719px) {
+  .dac-form-legend {
+    margin-bottom: 0;
+  }
+}
+
+/* Filter Resources Component*/
+.dac-filter {
+  color: #505050;
+  margin-bottom: 20px;
+  position: relative;
+}
+
+.dac-filter.dac-filter-section {
+  margin-top: -45px;
+  text-align: right;
+}
+
+@media (max-width: 719px) {
+  .dac-filter.dac-filter-section {
+    margin-top: 0;
+    text-align: left;
+  }
+}
+
+.dac-filter-title {
+  color: #666;
+  cursor: default;
+  display: inline-block;
+  font-size: 12px;
+  font-weight: 500;
+  line-height: 24px;
+  margin: 0;
+  text-transform: uppercase;
+}
+
+@media (max-width: 719px) {
+  .dac-filter-title {
+    margin-bottom: 20px;
+  }
+}
+
+.dac-filter-message {
+  color: #78868d;
+  font-size: 18px;
+  margin: 0 10px 10px;
+}
+
+.dac-filter-count {
+  background: #6ab344;
+  border-radius: 50%;
+  color: #fff;
+  display: inline-block;
+  font-size: 12px;
+  font-weight: 600;
+  height: 24px;
+  text-align: center;
+  width: 24px;
+}
+
+.dac-filter-count.dac-disabled {
+  visibility: hidden;
+}
+
+.dac-filter-chip {
+  background: #bfc7cb;
+  border-radius: 15px;
+  color: #333;
+  cursor: default;
+  display: inline-block;
+  line-height: 21px;
+  margin: 0 10px 10px 0;
+  padding: 4px 26px 4px 10px;
+  position: relative;
+}
+
+.dac-filter-chip-close {
+  background-color: transparent;
+  border: none;
+  cursor: pointer;
+  outline: 0;
+  padding: 3px;
+  position: absolute;
+  right: 5px;
+  top: 5px;
+}
+
+.dac-filter-chip-close-icon {
+  opacity: .7;
+  margin-top: -2px;
+  -webkit-transform: scale(0.57142857);
+  -ms-transform: scale(0.57142857);
+  transform: scale(0.57142857);
+}
+
+.dac-filter-chip-close:hover > .dac-filter-chip-close-icon {
+  opacity: 1;
+}
+
+.dac-filter-chips {
+  border-top: 1px solid rgba(0, 0, 0, 0.1);
+  margin: 0;
+  list-style-type: none;
+  padding: 10px 0 0;
+  position: relative;
+  text-align: left;
+}
+
+.dac-filter-item {
+  box-sizing: border-box;
+  float: left;
+  margin-bottom: 20px;
+  padding: 0 10px;
+  width: 33.33333333%;
+}
+
+@media (min-width: 720px) and (max-width: 979px) {
+  .dac-filter-item {
+    width: 50%;
+  }
+}
+
+@media (max-width: 719px) {
+  .dac-filter-item {
+    width: 100%;
+  }
+}
+
+/* Media component */
+.dac-media {
+  display: table;
+  width: 100%;
+}
+
+.dac-media-body, .dac-media-figure {
+  display: table-cell;
+  vertical-align: top;
+}
+
+.dac-media-figure {
+  padding: 0;
+}
+
+.dac-media-body {
+  width: 100%;
+}
+
+.dac-swap {
+  overflow: hidden;
+  position: relative;
+}
+
+.dac-swap-section {
+  left: 0;
+  opacity: 0;
+  position: absolute;
+  top: 0;
+  width: 100%;
+  -webkit-transition: opacity 1s, -webkit-transform .5s;
+  transition: opacity 1s, transform .5s;
+}
+
+.dac-swap-section.dac-no-anim {
+  -webkit-transition: none;
+  transition: none;
+}
+
+.dac-swap-section.dac-up {
+  -webkit-transform: translateY(-100%);
+  -ms-transform: translateY(-100%);
+  transform: translateY(-100%);
+}
+
+.dac-swap-section.dac-down {
+  -webkit-transform: translateY(100%);
+  -ms-transform: translateY(100%);
+  transform: translateY(100%);
+}
+
+.dac-swap-section.dac-left {
+  -webkit-transform: translateX(-100%);
+  -ms-transform: translateX(-100%);
+  transform: translateX(-100%);
+}
+
+.dac-swap-section.dac-right {
+  -webkit-transform: translateX(100%);
+  -ms-transform: translateX(100%);
+  transform: translateX(100%);
+}
+
+.dac-swap-section.dac-active {
+  opacity: 1;
+  position: relative;
+  -webkit-transform: translate(0, 0);
+  -ms-transform: translate(0, 0);
+  transform: translate(0, 0);
+  width: auto;
+}
+
+/* Modal component */
+.dac-modal {
+  opacity: 0;
+  visibility: hidden;
+  -webkit-transition: visibility 0s linear 300ms, opacity 300ms linear;
+  transition: visibility 0s linear 300ms, opacity 300ms linear;
+  background: rgba(0, 0, 0, 0.8);
+  bottom: 0;
+  left: 0;
+  overflow-x: hidden;
+  overflow-y: auto;
+  position: fixed;
+  right: 0;
+  top: 0;
+  z-index: 70;
+}
+
+.dac-modal.dac-active {
+  opacity: 1;
+  -webkit-transition-delay: 0s;
+  transition-delay: 0s;
+  visibility: visible;
+}
+
+.dac-modal-open {
+  overflow: hidden;
+}
+
+.dac-modal-container {
+  -webkit-box-align: center;
+  -webkit-align-items: center;
+  -ms-flex-align: center;
+  align-items: center;
+  display: -webkit-box;
+  display: -webkit-flex;
+  display: -ms-flexbox;
+  display: flex;
+  -webkit-filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.4));
+  filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.4));
+  -webkit-box-pack: center;
+  -webkit-justify-content: center;
+  -ms-flex-pack: center;
+  justify-content: center;
+  min-height: 100%;
+  width: 100%;
+}
+
+.dac-modal-window {
+  background: #fff;
+  box-sizing: border-box;
+  margin: 20px auto;
+  -webkit-transition: -webkit-transform .3s;
+  transition: transform .3s;
+  -webkit-transform: translate3d(0, -30px, 0);
+  transform: translate3d(0, -30px, 0);
+  width: 960px;
+}
+
+.dac-modal.dac-active .dac-modal-window {
+  -webkit-transform: translate3d(0, 0, 0);
+  transform: translate3d(0, 0, 0);
+}
+
+.dac-modal-header {
+  background: #00695c;
+  padding: 35px 35px 30px;
+  position: relative;
+}
+
+.dac-has-small-header .dac-modal-header {
+  padding: 10px 20px;
+}
+
+.dac-modal-header-actions {
+  padding: 8px;
+  position: absolute;
+  right: 5px;
+  top: 5px;
+}
+
+.dac-modal-header-open, .dac-modal-header-close {
+  background: none;
+  border: none;
+  cursor: pointer;
+  line-height: 0;
+  outline: 0;
+  opacity: .7;
+  -webkit-transition: background-color .3s;
+  transition: background-color .3s;
+}
+
+.dac-modal-header-open:active, .dac-modal-header-close:active {
+  background: rgba(255, 255, 255, 0.2);
+}
+
+.dac-modal-header-close:before {
+  content: '';
+  top: -1px;
+  position: relative;
+}
+
+.dac-modal-header-open {
+  margin: 10px;
+}
+
+.dac-modal-header-title {
+  color: #fff;
+  font-size: 24px;
+  font-weight: 300;
+  line-height: 32px;
+  padding: 0 150px 0 0;
+}
+
+.dac-has-small-header .dac-modal-header-title {
+  font-size: 16px;
+  font-weight: 500;
+}
+
+.dac-modal-header-subtitle {
+  bottom: 0;
+  color: #fff;
+  display: inline-block;
+  font: inherit;
+  font-size: 14px;
+  margin: 0;
+  opacity: .8;
+  position: absolute;
+  right: 0;
+}
+
+.dac-modal-content {
+  padding: 12px 35px;
+}
+
+.dac-modal-action {
+  margin: 0;
+}
+
+.dac-modal-footer {
+  padding: 24px 35px;
+}
+
+@media (max-width: 1000px) {
+  .dac-modal-window {
+    margin: 20px;
+    width: auto;
+  }
+
+  .dac-modal-container {
+    z-index: auto;
+  }
+}
+
+@media (max-width: 719px) {
+  .dac-modal-window {
+    margin: 10px;
+  }
+
+  .dac-modal-header {
+    padding: 35px 10px 10px;
+  }
+
+  .dac-modal-header-title {
+    font-size: 16px;
+    line-height: 24px;
+    padding: 0;
+  }
+
+  .dac-modal-header-subtitle {
+    display: block;
+    margin: 0;
+    position: static;
+    text-align: right;
+  }
+
+  .dac-modal-header-actions {
+    top: 1px;
+  }
+
+  .dac-modal-content {
+    padding: 10px;
+  }
 
-.dac-form-input {
-  border: 0 solid #e3e3e3;
-  border-bottom-width: 1px;
-  display: block;
-  outline: 0;
-  padding: 1px 0 8px;
-  -webkit-transition: border-color .2s;
-  transition: border-color .2s;
-  width: 100%;
+  .dac-modal-footer {
+    border-top: 1px solid #e3e3e3;
+    padding: 35px 10px;
+  }
 }
 
-.dac-form-input-group {
-  position: relative;
+.newsletter .dac-modal-footer {
+  padding-top: 0;
+  text-align: right;
 }
 
-.dac-form-input-group > .dac-form-required {
-  display: block;
-  bottom: 3px;
-  position: absolute;
-  right: 0;
+.newsletter-checkboxes {
+  padding-top: 20px;
 }
 
-.dac-form-input:focus {
-  border-bottom-color: #09f;
+.newsletter-success-message {
+  font-size: 32px;
+  line-height: 1.4;
+  padding: 40px 30px;
+  text-align: center;
 }
 
-.dac-form-floatlabel {
-  display: block;
-  cursor: text;
-  margin-top: 5px;
-  pointer-events: none;
-  -webkit-transform-origin: 0 100%;
-  -ms-transform-origin: 0 100%;
-  transform-origin: 0 100%;
-  -webkit-transform: translate3d(0, 22px, 0) scale(1);
-  transform: translate3d(0, 22px, 0) scale(1);
-  -webkit-transition: -webkit-transform .2s;
-  transition: transform .2s;
+@media (max-width: 719px) {
+  .newsletter-success-message {
+    font-size: 16px;
+    padding: 12px 0 0;
+  }
 }
 
-.dac-focused > .dac-form-floatlabel, .dac-has-value > .dac-form-floatlabel {
-  cursor: default;
-  -webkit-transform: translate3d(0, 0, 0) scale(.75);
-  transform: translate3d(0, 0, 0) scale(.75);
-}
+@media (min-width: 720px) {
+  .newsletter-checkboxes {
+    padding-top: 46px;
+  }
 
-.dac-form-radio, .dac-form-checkbox {
-  opacity: 0;
-  position: absolute;
-}
+  .newsletter-leftCol {
+    padding-right: 40px;
+  }
 
-.dac-form-radio-group, .dac-form-checkbox-group {
-  display: table;
-  margin-top: 10px;
+  .newsletter-rightCol {
+    padding-left: 40px;
+  }
 }
 
-.dac-form-radio-button, .dac-form-checkbox-button {
-  box-sizing: border-box;
-  cursor: pointer;
-  display: table-cell;
-  float: left;
-  height: 18px;
-  margin: 2px 10px 0 0;
-  position: relative;
-  width: 18px;
+@media (max-width: 719px) {
+  .newsletter .dac-modal-footer {
+    margin-top: 30px;
+    padding: 30px 10px;
+    text-align: center;
+  }
 }
 
-.dac-form-radio-button::after, .dac-form-radio-button::before, .dac-form-checkbox-button::after, .dac-form-checkbox-button::before {
-  box-sizing: border-box;
-  content: '';
-  border-radius: 50%;
-  display: block;
-  height: 100%;
-  position: absolute;
-  width: 100%;
+.dac-blog-reader {
+  padding: 50px 90px;
 }
 
-.dac-form-radio-button::before, .dac-form-checkbox-button::before {
-  background: rgba(0, 0, 0, 0.7);
-  -webkit-transform: translateZ(0) scale(0);
-  transform: translateZ(0) scale(0);
-  -webkit-transition: -webkit-transform .3s;
-  transition: transform .3s;
+.dac-blog-reader-title {
+  color: #333;
+  font-size: 45px;
+  font-weight: 300;
+  line-height: 1.2;
+  padding: 10px 0;
 }
 
-.dac-form-radio-button::after, .dac-form-checkbox-button::after {
-  border: 2px solid rgba(0, 0, 0, 0.7);
+.dac-blog-reader-date {
+  color: #b8b8b8;
+  font-size: 12px;
+  font-weight: 600;
+  line-height: 1;
+  text-transform: uppercase;
 }
 
-.dac-form-radio:checked + .dac-form-radio-button::before, .dac-form-checkbox:checked + .dac-form-checkbox-button::before {
-  -webkit-transform: translateZ(0) scale(.5);
-  transform: translateZ(0) scale(.5);
+.dac-blog-reader-text > p:first-child i {
+  display: inline-block;
+  margin-bottom: 40px;
 }
 
-.dac-form-radio:focus + .dac-form-radio-button::after, .dac-form-checkbox:focus + .dac-form-checkbox-button::after {
-  border: 2px solid #09f;
+.dac-blog-reader-text li {
+  margin-bottom: 0;
 }
 
-.dac-form-checkbox-button::after, .dac-form-checkbox-button::before {
-  border-radius: 0;
+.dac-blog-reader-text iframe {
+  margin-left: auto !important;
+  margin-right: auto !important;
+  max-width: 100%;
 }
 
 @media (max-width: 719px) {
-  .dac-form-legend {
-    margin-bottom: 0;
+  .dac-blog-reader {
+    padding: 30px 20px;
   }
 }
 
-/* Media component */
-.dac-media {
-  display: -webkit-box;
-  display: -webkit-flex;
-  display: -ms-flexbox;
-  display: flex;
-  -webkit-flex-flow: row wrap;
-  -ms-flex-flow: row wrap;
-  flex-flow: row wrap;
+.dac-custom-search {
+  background: #fff;
+  margin: 0 -10px;
+  padding: 20px 10px;
+  z-index: 1;
 }
 
-.dac-media-figure {
-  margin: 0;
+.dac-custom-search .dac-fab, .dac-custom-search .dac-button-social {
+  top: -48px;
 }
 
-.dac-media-body {
-  -webkit-box-flex: 1;
-  -webkit-flex: 1;
-  -ms-flex: 1;
-  flex: 1;
+.dac-custom-search-section-title {
+  color: #505050;
 }
 
-.no-flexbox .dac-media {
-  display: table;
-  width: 100%;
+.dac-custom-search-entry {
+  margin-bottom: 36px;
+  margin-top: 24px;
 }
 
-.no-flexbox .dac-media-body, .no-flexbox .dac-media-figure {
-  display: table-cell;
+.dac-custom-search-image {
+  background-size: cover;
+  height: 112px;
 }
 
-.no-flexbox .dac-media-figure {
+.dac-custom-search-title {
+  color: #333;
+  font-size: 14px;
+  font-weight: 700;
+  line-height: 24px;
   padding: 0;
 }
 
-.no-flexbox .dac-media-body {
-  width: 100%;
+.dac-custom-search-title a {
+  color: inherit;
 }
 
-.dac-swap {
-  overflow: hidden;
-  position: relative;
+.dac-custom-search-section {
+  color: #999;
+  font-size: 16px;
+  font-variant: small-caps;
+  font-weight: 700;
+  margin: -5px 0 0 0;
 }
 
-.dac-swap-section {
-  left: 0;
-  opacity: 0;
-  position: absolute;
-  top: 0;
-  width: 100%;
-  -webkit-transition: opacity 1s, -webkit-transform .5s;
-  transition: opacity 1s, transform .5s;
+.dac-custom-search-snippet {
+  color: #666;
+  margin: 0;
 }
 
-.dac-swap-section.dac-up {
-  -webkit-transform: translateY(-100%);
-  -ms-transform: translateY(-100%);
-  transform: translateY(-100%);
+.dac-custom-search-link {
+  font-weight: 500;
+  word-wrap: break-word;
+  width: 100%;
 }
 
-.dac-swap-section.dac-down {
-  -webkit-transform: translateY(100%);
-  -ms-transform: translateY(100%);
-  transform: translateY(100%);
+.dac-custom-search-load-more {
+  background: none;
+  border: none;
+  color: #333;
+  cursor: pointer;
+  display: block;
+  font-size: 14px;
+  font-weight: 700;
+  margin: 75px auto;
+  outline: none;
+  padding: 10px;
 }
 
-.dac-swap-section.dac-left {
-  -webkit-transform: translateX(-100%);
-  -ms-transform: translateX(-100%);
-  transform: translateX(-100%);
+.dac-custom-search-load-more:hover {
+  opacity: 0.7;
 }
 
-.dac-swap-section.dac-right {
-  -webkit-transform: translateX(100%);
-  -ms-transform: translateX(100%);
-  transform: translateX(100%);
+.dac-custom-search-no-results {
+  color: #999;
 }
 
-.dac-swap-section.dac-active {
-  opacity: 1;
-  position: relative;
-  -webkit-transform: translate(0, 0);
-  -ms-transform: translate(0, 0);
-  transform: translate(0, 0);
-  width: auto;
+.dac-search-hero {
+  font-size: 16px;
+  padding: 50px 0 14px 0;
 }
 
-/* Modal component */
-.dac-modal {
-  background: rgba(0, 0, 0, 0.8);
+.dac-search-results {
+  opacity: 0;
+  visibility: hidden;
+  -webkit-transition: visibility 0s linear 300ms, opacity 300ms linear;
+  transition: visibility 0s linear 300ms, opacity 300ms linear;
+  background-color: #fff;
   bottom: 0;
   left: 0;
-  opacity: 0;
-  overflow-x: hidden;
   overflow-y: auto;
+  padding: 0 10px;
   position: fixed;
   right: 0;
-  top: 0;
-  -webkit-transition: visibility 0s linear .3s, opacity .3s linear;
-  transition: visibility 0s linear .3s, opacity .3s linear;
-  visibility: hidden;
-  z-index: 52;
+  -webkit-transition: opacity 100ms;
+  transition: opacity 100ms;
+  top: 64px;
+  z-index: 50;
 }
 
-.dac-modal.dac-active {
+.dac-nav-animating .dac-search-results {
+  -webkit-transition: opacity 100ms, padding .3s;
+  transition: opacity 100ms, padding .3s;
+}
+
+.dac-search-results * {
+  box-sizing: border-box;
+}
+
+.dac-search-open .dac-search-results {
   opacity: 1;
-  -webkit-transition-delay: 0s;
-  transition-delay: 0s;
   visibility: visible;
 }
 
-.dac-modal-open {
+.dac-search-results-content {
+  background: #eceff1;
+  margin: 0 -10px;
+  padding: 0 10px;
+}
+
+.dac-search-results-for {
+  margin-bottom: -5px;
   overflow: hidden;
+  padding-top: 5px;
 }
 
-.dac-modal-container {
-  -webkit-box-align: center;
-  -webkit-align-items: center;
-  -ms-flex-align: center;
-  align-items: center;
-  display: -webkit-box;
-  display: -webkit-flex;
-  display: -ms-flexbox;
-  display: flex;
-  -webkit-filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.4));
-  filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.4));
-  -webkit-box-pack: center;
-  -webkit-justify-content: center;
-  -ms-flex-pack: center;
-  justify-content: center;
-  min-height: 100%;
-  width: 100%;
+.dac-search-results-for span {
+  color: #039bef;
 }
 
-.dac-modal-window {
-  background: #fff;
-  border-radius: 5px;
-  box-sizing: border-box;
-  margin: 20px auto;
-  -webkit-transition: -webkit-transform .3s;
-  transition: transform .3s;
-  -webkit-transform: translate(0, -30px);
-  -ms-transform: translate(0, -30px);
-  transform: translate(0, -30px);
-  width: 960px;
+.dac-search-mode .dac-search-results-for {
+  display: none;
 }
 
-.dac-modal.dac-active .dac-modal-window {
-  -webkit-transform: translate(0, 0);
-  -ms-transform: translate(0, 0);
-  transform: translate(0, 0);
+.dac-search-results-history {
+  background: #eceff1;
+  min-height: 100%;
+  margin: 0 -10px;
+  padding: 0 10px;
+}
+
+.dac-search-results-hero {
+  padding-top: 20px;
+}
+
+.dac-search-results-metadata {
+  padding-bottom: 40px;
 }
 
-.dac-modal-header {
-  background: #00695c;
-  border-top-left-radius: 5px;
-  border-top-right-radius: 5px;
-  padding: 35px 35px 30px;
-  position: relative;
+.dac-search-results-reference {
+  background: white;
+  box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.21);
+  margin: 0 0 20px 0;
+  height: 340px;
+  overflow: hidden;
+  padding: 6px 0 4px;
 }
 
-.dac-modal-header-close {
-  background: none;
-  border: none;
-  cursor: pointer;
-  line-height: 0;
-  outline: 0;
-  opacity: .7;
-  padding: 8px;
-  position: absolute;
-  right: 5px;
-  -webkit-transition: background-color .3s;
-  transition: background-color .3s;
-  top: 5px;
+.dac-search-results-reference .namespace {
+  color: #666;
 }
 
-.dac-modal-header-close:active {
-  background: rgba(255, 255, 255, 0.2);
+.dac-search-results-reference.is-expanded {
+  height: auto;
 }
 
-.dac-modal-header-title {
-  color: #fff;
-  font-size: 24px;
-  font-weight: 300;
-  line-height: 32px;
+.dac-search-results-reference-header {
+  color: #999;
+  font-size: 16px;
+  font-variant: small-caps;
+  font-weight: 700;
   margin: 0;
-  padding-right: 150px;
+  padding: 18px 12px 0;
+  text-transform: lowercase;
 }
 
-.dac-modal-header-subtitle {
-  bottom: 0;
-  color: #fff;
-  display: inline-block;
-  font: inherit;
-  font-size: 14px;
+.dac-search-results-reference-header:first-child {
+  padding-top: 0;
+}
+
+.dac-search-results-reference-entry {
   margin: 0;
-  opacity: .8;
-  position: absolute;
-  right: 0;
 }
 
-.dac-modal-content {
-  padding: 12px 35px;
+.dac-search-results-reference-entry a {
+  color: #333;
+  display: block;
+  font-size: 0.81em;
+  line-height: 1.2em;
+  padding: 0 12px 5px 12px;
+  width: 100%;
+  white-space: nowrap;
 }
 
-.dac-modal-action {
-  margin: 0;
+.dac-search-results-reference-entry a:hover {
+  background-color: #eceff1;
 }
 
-.dac-modal-footer {
-  padding: 24px 35px;
+.dac-search-results-reference-entry em {
+  font-style: normal;
+  font-weight: 700;
 }
 
-@media (max-width: 1000px) {
-  .dac-modal-window {
-    margin: 20px;
-    width: auto;
-  }
+.dac-search-results-reference-entry-empty {
+  color: #999;
+  font-size: 0.81em;
+  margin: 0;
+  padding: 2px 12px 14px;
+}
 
-  .dac-modal-container {
-    z-index: auto;
-  }
+.dac-search-results-resources {
+  margin: 0;
 }
 
-@media (max-width: 719px) {
-  .dac-modal-window {
-    margin: 10px;
-  }
+.dac-search-results-resources .resource-card {
+  border-right: 2px solid #999;
+}
 
-  .dac-modal-header {
-    padding: 35px 10px 10px;
-  }
+.dac-search-results-resources .resource-card-about {
+  border-right: 2px solid #6ab344;
+}
 
-  .dac-modal-header-title {
-    font-size: 16px;
-    line-height: 24px;
-    padding: 0;
-  }
+.dac-search-results-resources .resource-card-about .section {
+  color: #6ab344;
+}
 
-  .dac-modal-header-subtitle {
-    display: block;
-    margin: 0;
-    position: static;
-    text-align: right;
-  }
+.dac-search-results-resources .resource-card-develop {
+  border-right: 2px solid #ff7043;
+}
 
-  .dac-modal-content {
-    padding: 10px;
-  }
+.dac-search-results-resources .resource-card-develop .section {
+  color: #ff7043;
+}
 
-  .dac-modal-footer {
-    border-top: 1px solid #e3e3e3;
-    padding: 35px 10px;
-  }
+.dac-search-results-resources .resource-card-design {
+  border-right: 2px solid #00bcd4;
 }
 
-.newsletter .dac-modal-footer {
-  padding-top: 0;
-  text-align: right;
+.dac-search-results-resources .resource-card-design .section {
+  color: #00bcd4;
 }
 
-.newsletter-checkboxes {
-  padding-top: 20px;
+.dac-search-results-resources .resource-card-distribute {
+  border-right: 2px solid #afb42b;
 }
 
-.newsletter-success-message {
-  font-size: 32px;
-  line-height: 1.4;
-  padding: 40px 30px;
-  text-align: center;
+.dac-search-results-resources .resource-card-distribute .section {
+  color: #afb42b;
 }
 
 @media (max-width: 719px) {
-  .newsletter-success-message {
-    font-size: 16px;
-    padding: 12px 0 0;
+  .dac-search-results-reference.no-results {
+    display: none;
   }
 }
 
-@media (min-width: 720px) {
-  .newsletter-checkboxes {
-    padding-top: 46px;
+@media (min-width: 980px) {
+  .dac-nav-open.dac-search-open .dac-search-results {
+    padding-left: 260px;
   }
 
-  .newsletter-leftCol {
-    padding-right: 40px;
+  .dac-search-mode.dac-search-open .dac-search-results {
+    padding-left: 10px;
   }
+}
 
-  .newsletter-rightCol {
-    padding-left: 40px;
-  }
+.dac-selected {
+  color: #039bef !important;
 }
 
-@media (max-width: 719px) {
-  .newsletter .dac-modal-footer {
-    margin-top: 30px;
-    padding: 30px 10px;
-    text-align: center;
-  }
+.dac-selected em {
+  color: #039bef;
+}
+
+.resource-card.dac-selected {
+  box-shadow: 0px 1px 10px 0px rgba(3, 155, 239, 0.7);
+}
+
+.resource-card.dac-selected em {
+  color: #333;
 }
 
 .dac-expand, .dac-section {
@@ -8362,7 +8850,7 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-me
 }
 
 .dac-invert {
-  color: #b2b2b2;
+  color: #b3b3b3;
   color: rgba(255, 255, 255, 0.7);
 }
 
@@ -8375,7 +8863,11 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-me
 }
 
 .dac-gray.dac-hero, .dac-gray.dac-section {
-  background-color: #b0bec5;
+  background-color: #d8dfe2;
+}
+
+.dac-gray-dark.dac-hero, .dac-gray-dark.dac-section {
+   background-color: #b0bec5; 
 }
 
 .dac-dark.dac-hero, .dac-dark.dac-section {
@@ -8395,11 +8887,11 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-me
   color: white;
 }
 
-.dac-hero-cta .dac-sprite, .dac-section-title .dac-sprite, .dac-section-links .dac-sprite {
+.dac-hero-cta .dac-sprite, .dac-section-title .dac-sprite, .dac-section-links .dac-sprite, .dac-hero-cta .dac-modal-header-close:before, .dac-section-title .dac-modal-header-close:before, .dac-section-links .dac-modal-header-close:before, .dac-hero-cta .paging-links .prev-page-link:before, .paging-links .dac-hero-cta .prev-page-link:before, .dac-section-title .paging-links .prev-page-link:before, .paging-links .dac-section-title .prev-page-link:before, .dac-section-links .paging-links .prev-page-link:before, .paging-links .dac-section-links .prev-page-link:before, .dac-hero-cta .paging-links .next-page-link:before, .paging-links .dac-hero-cta .next-page-link:before, .dac-section-title .paging-links .next-page-link:before, .paging-links .dac-section-title .next-page-link:before, .dac-section-links .paging-links .next-page-link:before, .paging-links .dac-section-links .next-page-link:before, .dac-hero-cta .paging-links .next-class-link:before, .paging-links .dac-hero-cta .next-class-link:before, .dac-section-title .paging-links .next-class-link:before, .paging-links .dac-section-title .next-class-link:before, .dac-section-links .paging-links .next-class-link:before, .paging-links .dac-section-links .next-class-link:before, .dac-hero-cta .paging-links .start-class-link:after, .paging-links .dac-hero-cta .start-class-link:after, .dac-section-title .paging-links .start-class-link:after, .paging-links .dac-section-title .start-class-link:after, .dac-section-links .paging-links .start-class-link:after, .paging-links .dac-section-links .start-class-link:after {
   opacity: .87;
 }
 
-.dac-invert .dac-hero-cta .dac-sprite, .dac-invert .dac-section-title .dac-sprite, .dac-invert .dac-section-links .dac-sprite {
+.dac-invert .dac-hero-cta .dac-sprite, .dac-invert .dac-section-title .dac-sprite, .dac-invert .dac-section-links .dac-sprite, .dac-invert .dac-hero-cta .dac-modal-header-close:before, .dac-invert .dac-section-title .dac-modal-header-close:before, .dac-invert .dac-section-links .dac-modal-header-close:before, .dac-invert .dac-hero-cta .paging-links .prev-page-link:before, .paging-links .dac-invert .dac-hero-cta .prev-page-link:before, .dac-invert .dac-section-title .paging-links .prev-page-link:before, .paging-links .dac-invert .dac-section-title .prev-page-link:before, .dac-invert .dac-section-links .paging-links .prev-page-link:before, .paging-links .dac-invert .dac-section-links .prev-page-link:before, .dac-invert .dac-hero-cta .paging-links .next-page-link:before, .paging-links .dac-invert .dac-hero-cta .next-page-link:before, .dac-invert .dac-section-title .paging-links .next-page-link:before, .paging-links .dac-invert .dac-section-title .next-page-link:before, .dac-invert .dac-section-links .paging-links .next-page-link:before, .paging-links .dac-invert .dac-section-links .next-page-link:before, .dac-invert .dac-hero-cta .paging-links .next-class-link:before, .paging-links .dac-invert .dac-hero-cta .next-class-link:before, .dac-invert .dac-section-title .paging-links .next-class-link:before, .paging-links .dac-invert .dac-section-title .next-class-link:before, .dac-invert .dac-section-links .paging-links .next-class-link:before, .paging-links .dac-invert .dac-section-links .next-class-link:before, .dac-invert .dac-hero-cta .paging-links .start-class-link:after, .paging-links .dac-invert .dac-hero-cta .start-class-link:after, .dac-invert .dac-section-title .paging-links .start-class-link:after, .paging-links .dac-invert .dac-section-title .start-class-link:after, .dac-invert .dac-section-links .paging-links .start-class-link:after, .paging-links .dac-invert .dac-section-links .start-class-link:after {
   opacity: 1;
 }
 
@@ -8409,7 +8901,7 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-me
 }
 
 .dac-invert .dac-hero-tag, .dac-invert .dac-hero-description, .dac-invert .dac-section-subtitle {
-  color: #b2b2b2;
+  color: #b3b3b3;
   color: rgba(255, 255, 255, 0.7);
 }
 
@@ -8433,15 +8925,20 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-me
   padding-top: 32px;
 }
 
+.dac-section.dac-slim {
+  padding-bottom: 0;
+  padding-top: 0;
+}
+
 .dac-section-title {
   text-align: center;
-  margin-bottom: 40px;
-  margin-top: 0;
+  padding-bottom: 40px;
+  padding-top: 0;
 }
 
 .dac-section-subtitle {
   font-size: 16px;
-  margin-bottom: 40px;
+  padding-bottom: 40px;
   margin-top: -24px;
   text-align: center;
 }
@@ -8462,6 +8959,7 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-me
 }
 
 .dac-section-link {
+  cursor: pointer;
   display: inline-block;
   margin: 0 32px;
   -webkit-transition: opacity .3s;
@@ -8496,184 +8994,395 @@ $icon-home: x y offset_x offset_y width height total_width total_height image_pa
 At the bottom of this section, we provide information about the spritesheet itself
 $spritesheet: width height image $spritesheet-sprites;
 */
-.dac-sprite, #tb li:before, #qv li:before {
+.dac-sprite, .dac-modal-header-close:before, .paging-links .prev-page-link:before, .paging-links .next-page-link:before, .paging-links .next-class-link:before, .paging-links .start-class-link:after, .Video-button--picture-in-picture, .Video-button--close, a.video-shadowbox-button.white::after, #tb li:before,
+#qv li:before {
   background-image: url(/assets/images/sprite.png);
   display: inline-block;
   vertical-align: middle; }
-  @media screen and (min-device-pixel-ratio: 1.5) {
-    .dac-sprite, #tb li:before, #qv li:before {
-      background-image: url(/assets/images/sprite-2x.png);
-      background-size: 50% 50%; } }
-
-.dac-sprite.dac-auto-chevron {
-  background-position: 0px -196px;
+  @media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 1.5dppx), (min-resolution: 144px) {
+    .dac-sprite, .dac-modal-header-close:before, .paging-links .prev-page-link:before, .paging-links .next-page-link:before, .paging-links .next-class-link:before, .paging-links .start-class-link:after, .Video-button--picture-in-picture, .Video-button--close, a.video-shadowbox-button.white::after, #tb li:before,
+    #qv li:before {
+      background-image: url(/assets/images/sprite@2x.png);
+      background-size: 36px 883px; } }
+
+.dac-sprite.dac-auto-chevron, .dac-auto-chevron.dac-modal-header-close:before, .paging-links .dac-auto-chevron.prev-page-link:before, .paging-links .dac-auto-chevron.next-page-link:before, .paging-links .dac-auto-chevron.next-class-link:before, .paging-links .dac-auto-chevron.start-class-link:after {
+  background-position: 0px -669px;
   height: 24px;
   width: 24px;
   vertical-align: -6px; }
-  .dac-invert .dac-sprite.dac-auto-chevron {
-    background-position: 0px -222px;
+  .dac-invert .dac-sprite.dac-auto-chevron, .dac-invert .dac-auto-chevron.dac-modal-header-close:before, .dac-invert .paging-links .dac-auto-chevron.prev-page-link:before, .paging-links .dac-invert .dac-auto-chevron.prev-page-link:before, .dac-invert .paging-links .dac-auto-chevron.next-page-link:before, .paging-links .dac-invert .dac-auto-chevron.next-page-link:before, .dac-invert .paging-links .dac-auto-chevron.next-class-link:before, .paging-links .dac-invert .dac-auto-chevron.next-class-link:before, .dac-invert .paging-links .dac-auto-chevron.start-class-link:after, .paging-links .dac-invert .dac-auto-chevron.start-class-link:after {
+    background-position: 0px -513px;
     height: 24px;
     width: 24px; }
-.dac-sprite.dac-auto-chevron-large {
-  background-position: 0px -404px;
+
+.dac-sprite.dac-auto-chevron-large, .dac-auto-chevron-large.dac-modal-header-close:before, .paging-links .dac-auto-chevron-large.prev-page-link:before, .paging-links .dac-auto-chevron-large.next-page-link:before, .paging-links .dac-auto-chevron-large.next-class-link:before, .paging-links .dac-auto-chevron-large.start-class-link:after {
+  background-position: 0px -695px;
   height: 36px;
   width: 36px;
   vertical-align: -10px; }
-  .dac-invert .dac-sprite.dac-auto-chevron-large {
-    background-position: 0px -442px;
+  .dac-invert .dac-sprite.dac-auto-chevron-large, .dac-invert .dac-auto-chevron-large.dac-modal-header-close:before, .dac-invert .paging-links .dac-auto-chevron-large.prev-page-link:before, .paging-links .dac-invert .dac-auto-chevron-large.prev-page-link:before, .dac-invert .paging-links .dac-auto-chevron-large.next-page-link:before, .paging-links .dac-invert .dac-auto-chevron-large.next-page-link:before, .dac-invert .paging-links .dac-auto-chevron-large.next-class-link:before, .paging-links .dac-invert .dac-auto-chevron-large.next-class-link:before, .dac-invert .paging-links .dac-auto-chevron-large.start-class-link:after, .paging-links .dac-invert .dac-auto-chevron-large.start-class-link:after {
+    background-position: 0px -771px;
     height: 36px;
     width: 36px; }
-.dac-sprite.dac-auto-unfold-less {
-  background-position: 0px -352px;
+
+.dac-sprite.dac-auto-unfold-less, .dac-auto-unfold-less.dac-modal-header-close:before, .paging-links .dac-auto-unfold-less.prev-page-link:before, .paging-links .dac-auto-unfold-less.next-page-link:before, .paging-links .dac-auto-unfold-less.next-class-link:before, .paging-links .dac-auto-unfold-less.start-class-link:after {
+  background-position: 0px -487px;
   height: 24px;
   width: 24px;
   vertical-align: -6px; }
-  .dac-invert .dac-sprite.dac-auto-unfold-less {
-    background-position: 0px -326px;
+  .dac-invert .dac-sprite.dac-auto-unfold-less, .dac-invert .dac-auto-unfold-less.dac-modal-header-close:before, .dac-invert .paging-links .dac-auto-unfold-less.prev-page-link:before, .paging-links .dac-invert .dac-auto-unfold-less.prev-page-link:before, .dac-invert .paging-links .dac-auto-unfold-less.next-page-link:before, .paging-links .dac-invert .dac-auto-unfold-less.next-page-link:before, .dac-invert .paging-links .dac-auto-unfold-less.next-class-link:before, .paging-links .dac-invert .dac-auto-unfold-less.next-class-link:before, .dac-invert .paging-links .dac-auto-unfold-less.start-class-link:after, .paging-links .dac-invert .dac-auto-unfold-less.start-class-link:after {
+    background-position: 0px -565px;
     height: 24px;
     width: 24px; }
-.dac-sprite.dac-auto-unfold-more {
-  background-position: 0px -300px;
+
+.dac-sprite.dac-auto-unfold-more, .dac-auto-unfold-more.dac-modal-header-close:before, .paging-links .dac-auto-unfold-more.prev-page-link:before, .paging-links .dac-auto-unfold-more.next-page-link:before, .paging-links .dac-auto-unfold-more.next-class-link:before, .paging-links .dac-auto-unfold-more.start-class-link:after {
+  background-position: 0px -539px;
   height: 24px;
   width: 24px;
   vertical-align: -6px; }
-  .dac-invert .dac-sprite.dac-auto-unfold-more {
-    background-position: 0px -378px;
+  .dac-invert .dac-sprite.dac-auto-unfold-more, .dac-invert .dac-auto-unfold-more.dac-modal-header-close:before, .dac-invert .paging-links .dac-auto-unfold-more.prev-page-link:before, .paging-links .dac-invert .dac-auto-unfold-more.prev-page-link:before, .dac-invert .paging-links .dac-auto-unfold-more.next-page-link:before, .paging-links .dac-invert .dac-auto-unfold-more.next-page-link:before, .dac-invert .paging-links .dac-auto-unfold-more.next-class-link:before, .paging-links .dac-invert .dac-auto-unfold-more.next-class-link:before, .dac-invert .paging-links .dac-auto-unfold-more.start-class-link:after, .paging-links .dac-invert .dac-auto-unfold-more.start-class-link:after {
+    background-position: 0px -305px;
     height: 24px;
     width: 24px; }
 
-.dac-sprite.dac-arrow-down-gray {
+.dac-sprite.dac-arrow-down-gray, .dac-arrow-down-gray.dac-modal-header-close:before, .paging-links .dac-arrow-down-gray.prev-page-link:before, .paging-links .dac-arrow-down-gray.next-page-link:before, .paging-links .dac-arrow-down-gray.next-class-link:before, .paging-links .dac-arrow-down-gray.start-class-link:after {
   background-position: 0px 0px;
   height: 11px;
   width: 19px; }
 
-.dac-sprite.dac-arrow-right {
-  background-position: 0px -128px;
+.dac-sprite.dac-arrow-right, .dac-arrow-right.dac-modal-header-close:before, .paging-links .dac-arrow-right.prev-page-link:before, .paging-links .dac-arrow-right.next-page-link:before, .paging-links .dac-arrow-right.next-class-link:before, .paging-links .dac-arrow-right.start-class-link:after {
+  background-position: 0px -215px;
   height: 18px;
   width: 11px; }
 
-.dac-sprite.dac-chevron-large-right-black {
-  background-position: 0px -404px;
+.dac-sprite.dac-back-arrow, .dac-back-arrow.dac-modal-header-close:before, .paging-links .dac-back-arrow.prev-page-link:before, .paging-links .dac-back-arrow.next-page-link:before, .paging-links .dac-back-arrow.next-class-link:before, .paging-links .dac-back-arrow.start-class-link:after {
+  background-position: 0px -123px;
+  height: 16px;
+  width: 16px; }
+
+.dac-sprite.dac-chevron-large-right-black, .dac-chevron-large-right-black.dac-modal-header-close:before, .paging-links .dac-chevron-large-right-black.prev-page-link:before, .paging-links .dac-chevron-large-right-black.next-page-link:before, .paging-links .dac-chevron-large-right-black.next-class-link:before, .paging-links .dac-chevron-large-right-black.start-class-link:after {
+  background-position: 0px -695px;
   height: 36px;
   width: 36px; }
 
-.dac-sprite.dac-chevron-large-right-white {
-  background-position: 0px -442px;
+.dac-sprite.dac-chevron-large-right-white, .dac-chevron-large-right-white.dac-modal-header-close:before, .paging-links .dac-chevron-large-right-white.prev-page-link:before, .paging-links .dac-chevron-large-right-white.next-page-link:before, .paging-links .dac-chevron-large-right-white.next-class-link:before, .paging-links .dac-chevron-large-right-white.start-class-link:after {
+  background-position: 0px -771px;
   height: 36px;
   width: 36px; }
 
-.dac-sprite.dac-chevron-right-black {
-  background-position: 0px -196px;
+.dac-sprite.dac-chevron-right-black, .dac-chevron-right-black.dac-modal-header-close:before, .paging-links .dac-chevron-right-black.prev-page-link:before, .paging-links .dac-chevron-right-black.next-page-link:before, .paging-links .dac-chevron-right-black.next-class-link:before, .paging-links .dac-chevron-right-black.start-class-link:after {
+  background-position: 0px -669px;
+  height: 24px;
+  width: 24px; }
+
+.dac-sprite.dac-chevron-right-white, .dac-chevron-right-white.dac-modal-header-close:before, .paging-links .dac-chevron-right-white.prev-page-link:before, .paging-links .dac-chevron-right-white.next-page-link:before, .paging-links .dac-chevron-right-white.next-class-link:before, .paging-links .dac-chevron-right-white.start-class-link:after {
+  background-position: 0px -513px;
   height: 24px;
   width: 24px; }
 
-.dac-sprite.dac-chevron-right-white {
-  background-position: 0px -222px;
+.dac-sprite.dac-close-black, .dac-close-black.dac-modal-header-close:before, .paging-links .dac-close-black.prev-page-link:before, .paging-links .dac-close-black.next-page-link:before, .paging-links .dac-close-black.next-class-link:before, .paging-links .dac-close-black.start-class-link:after {
+  background-position: 0px -89px;
+  height: 14px;
+  width: 14px; }
+
+.dac-sprite.dac-close-video-white, .dac-modal-header-close:before, .paging-links .dac-close-video-white.prev-page-link:before, .paging-links .prev-page-link.dac-modal-header-close:before, .paging-links .dac-close-video-white.next-page-link:before, .paging-links .next-page-link.dac-modal-header-close:before, .paging-links .dac-close-video-white.next-class-link:before, .paging-links .next-class-link.dac-modal-header-close:before, .paging-links .dac-close-video-white.start-class-link:after {
+  background-position: 0px -435px;
   height: 24px;
   width: 24px; }
 
-.dac-sprite.dac-close {
+.dac-sprite.dac-close, .dac-close.dac-modal-header-close:before, .paging-links .dac-close.prev-page-link:before, .paging-links .dac-close.next-page-link:before, .paging-links .dac-close.next-class-link:before, .paging-links .dac-close.start-class-link:after {
   background-position: 0px -27px;
   height: 12px;
   width: 12px; }
 
-.dac-sprite.dac-expand-less-black {
-  background-position: 0px -248px;
+.dac-sprite.dac-enlarge-video-white, .dac-enlarge-video-white.dac-modal-header-close:before, .paging-links .dac-enlarge-video-white.prev-page-link:before, .paging-links .dac-enlarge-video-white.next-page-link:before, .paging-links .dac-enlarge-video-white.next-class-link:before, .paging-links .dac-enlarge-video-white.start-class-link:after {
+  background-position: 0px -409px;
   height: 24px;
   width: 24px; }
 
-.dac-sprite.dac-expand-more-black {
-  background-position: 0px -170px;
+.dac-sprite.dac-expand-less-black, .dac-expand-less-black.dac-modal-header-close:before, .paging-links .dac-expand-less-black.prev-page-link:before, .paging-links .dac-expand-less-black.next-page-link:before, .paging-links .dac-expand-less-black.next-class-link:before, .paging-links .dac-expand-less-black.start-class-link:after {
+  background-position: 0px -383px;
   height: 24px;
   width: 24px; }
 
-.dac-sprite.dac-google-play {
-  background-position: 0px -108px;
-  height: 18px;
-  width: 16px; }
+.dac-sprite.dac-expand-more-black, .dac-expand-more-black.dac-modal-header-close:before, .paging-links .dac-expand-more-black.prev-page-link:before, .paging-links .dac-expand-more-black.next-page-link:before, .paging-links .dac-expand-more-black.next-class-link:before, .paging-links .dac-expand-more-black.start-class-link:after {
+  background-position: 0px -357px;
+  height: 24px;
+  width: 24px; }
 
-.dac-sprite.dac-gplus {
-  background-position: 0px -89px;
-  height: 17px;
-  width: 16px; }
+.dac-sprite.dac-fullscreen-exit, .dac-fullscreen-exit.dac-modal-header-close:before, .paging-links .dac-fullscreen-exit.prev-page-link:before, .paging-links .dac-fullscreen-exit.next-page-link:before, .paging-links .dac-fullscreen-exit.next-class-link:before, .paging-links .dac-fullscreen-exit.start-class-link:after {
+  background-position: 0px -331px;
+  height: 24px;
+  width: 24px; }
 
-.dac-sprite.dac-mail {
+.dac-sprite.dac-fullscreen, .dac-fullscreen.dac-modal-header-close:before, .paging-links .dac-fullscreen.prev-page-link:before, .paging-links .dac-fullscreen.next-page-link:before, .paging-links .dac-fullscreen.next-class-link:before, .paging-links .dac-fullscreen.start-class-link:after {
+  background-position: 0px -279px;
+  height: 24px;
+  width: 24px; }
+
+.dac-sprite.dac-google-play, .dac-google-play.dac-modal-header-close:before, .paging-links .dac-google-play.prev-page-link:before, .paging-links .dac-google-play.next-page-link:before, .paging-links .dac-google-play.next-class-link:before, .paging-links .dac-google-play.start-class-link:after {
+  background-position: 0px -235px;
+  height: 20px;
+  width: 17px; }
+
+.dac-sprite.dac-gplus, .dac-gplus.dac-modal-header-close:before, .paging-links .dac-gplus.prev-page-link:before, .paging-links .dac-gplus.next-page-link:before, .paging-links .dac-gplus.next-class-link:before, .paging-links .dac-gplus.start-class-link:after {
+  background-position: 0px -809px;
+  height: 36px;
+  width: 36px; }
+
+.dac-sprite.dac-mail, .dac-mail.dac-modal-header-close:before, .paging-links .dac-mail.prev-page-link:before, .paging-links .dac-mail.next-page-link:before, .paging-links .dac-mail.next-class-link:before, .paging-links .dac-mail.start-class-link:after {
   background-position: 0px -13px;
   height: 12px;
   width: 16px; }
 
-.dac-sprite.dac-play-white {
-  background-position: 0px -148px;
+.dac-sprite.dac-nav-back-blue, .dac-nav-back-blue.dac-modal-header-close:before, .paging-links .prev-page-link:before, .paging-links .dac-nav-back-blue.next-page-link:before, .paging-links .dac-nav-back-blue.next-class-link:before, .paging-links .dac-nav-back-blue.start-class-link:after {
+  background-position: 0px -105px;
+  height: 16px;
+  width: 16px; }
+
+.dac-sprite.dac-nav-back, .dac-nav-back.dac-modal-header-close:before, .paging-links .dac-nav-back.prev-page-link:before, .paging-links .dac-nav-back.next-page-link:before, .paging-links .dac-nav-back.next-class-link:before, .paging-links .dac-nav-back.start-class-link:after {
+  background-position: 0px -177px;
+  height: 16px;
+  width: 16px; }
+
+.dac-sprite.dac-nav-forward-blue, .dac-nav-forward-blue.dac-modal-header-close:before, .paging-links .dac-nav-forward-blue.prev-page-link:before, .paging-links .next-page-link:before, .paging-links .next-class-link:before, .paging-links .start-class-link:after {
+  background-position: 0px -159px;
+  height: 16px;
+  width: 16px; }
+
+.dac-sprite.dac-nav-forward, .dac-nav-forward.dac-modal-header-close:before, .paging-links .dac-nav-forward.prev-page-link:before, .paging-links .dac-nav-forward.next-page-link:before, .paging-links .dac-nav-forward.next-class-link:before, .paging-links .dac-nav-forward.start-class-link:after {
+  background-position: 0px -141px;
+  height: 16px;
+  width: 16px; }
+
+.dac-sprite.dac-open-in-new, .dac-open-in-new.dac-modal-header-close:before, .paging-links .dac-open-in-new.prev-page-link:before, .paging-links .dac-open-in-new.next-page-link:before, .paging-links .dac-open-in-new.next-class-link:before, .paging-links .dac-open-in-new.start-class-link:after {
+  background-position: 0px -195px;
+  height: 18px;
+  width: 18px; }
+
+.dac-sprite.dac-picture-in-picture-white, .dac-picture-in-picture-white.dac-modal-header-close:before, .paging-links .dac-picture-in-picture-white.prev-page-link:before, .paging-links .dac-picture-in-picture-white.next-page-link:before, .paging-links .dac-picture-in-picture-white.next-class-link:before, .paging-links .dac-picture-in-picture-white.start-class-link:after {
+  background-position: 0px -461px;
+  height: 24px;
+  width: 24px; }
+
+.dac-sprite.dac-play-circle-grey, .dac-play-circle-grey.dac-modal-header-close:before, .paging-links .dac-play-circle-grey.prev-page-link:before, .paging-links .dac-play-circle-grey.next-page-link:before, .paging-links .dac-play-circle-grey.next-class-link:before, .paging-links .dac-play-circle-grey.start-class-link:after {
+  background-position: 0px -733px;
+  height: 36px;
+  width: 36px; }
+
+.dac-sprite.dac-play-circle-white, .dac-play-circle-white.dac-modal-header-close:before, .paging-links .dac-play-circle-white.prev-page-link:before, .paging-links .dac-play-circle-white.next-page-link:before, .paging-links .dac-play-circle-white.next-class-link:before, .paging-links .dac-play-circle-white.start-class-link:after {
+  background-position: 0px -847px;
+  height: 36px;
+  width: 36px; }
+
+.dac-sprite.dac-play-white, .dac-play-white.dac-modal-header-close:before, .paging-links .dac-play-white.prev-page-link:before, .paging-links .dac-play-white.next-page-link:before, .paging-links .dac-play-white.next-class-link:before, .paging-links .dac-play-white.start-class-link:after {
+  background-position: 0px -257px;
   height: 20px;
   width: 16px; }
 
-.dac-sprite.dac-rss {
-  background-position: 0px -41px;
-  height: 14px;
-  width: 14px; }
+.dac-sprite.dac-rss, .dac-rss.dac-modal-header-close:before, .paging-links .dac-rss.prev-page-link:before, .paging-links .dac-rss.next-page-link:before, .paging-links .dac-rss.next-class-link:before, .paging-links .dac-rss.start-class-link:after {
+  background-position: 0px -41px;
+  height: 14px;
+  width: 14px; }
+
+.dac-sprite.dac-search-white, .dac-search-white.dac-modal-header-close:before, .paging-links .dac-search-white.prev-page-link:before, .paging-links .dac-search-white.next-page-link:before, .paging-links .dac-search-white.next-class-link:before, .paging-links .dac-search-white.start-class-link:after {
+  background-position: 0px -591px;
+  height: 24px;
+  width: 24px; }
+
+.dac-sprite.dac-search, .dac-search.dac-modal-header-close:before, .paging-links .dac-search.prev-page-link:before, .paging-links .dac-search.next-page-link:before, .paging-links .dac-search.next-class-link:before, .paging-links .dac-search.start-class-link:after {
+  background-position: 0px -617px;
+  height: 24px;
+  width: 24px; }
+
+.dac-sprite.dac-star-outline, .dac-star-outline.dac-modal-header-close:before, .paging-links .dac-star-outline.prev-page-link:before, .paging-links .dac-star-outline.next-page-link:before, .paging-links .dac-star-outline.next-class-link:before, .paging-links .dac-star-outline.start-class-link:after {
+  background-position: 0px -643px;
+  height: 24px;
+  width: 24px; }
+
+.dac-sprite.dac-twitter, .dac-twitter.dac-modal-header-close:before, .paging-links .dac-twitter.prev-page-link:before, .paging-links .dac-twitter.next-page-link:before, .paging-links .dac-twitter.next-class-link:before, .paging-links .dac-twitter.start-class-link:after {
+  background-position: 0px -73px;
+  height: 14px;
+  width: 16px; }
+
+.dac-sprite.dac-unfold-less-white, .dac-unfold-less-white.dac-modal-header-close:before, .paging-links .dac-unfold-less-white.prev-page-link:before, .paging-links .dac-unfold-less-white.next-page-link:before, .paging-links .dac-unfold-less-white.next-class-link:before, .paging-links .dac-unfold-less-white.start-class-link:after {
+  background-position: 0px -565px;
+  height: 24px;
+  width: 24px; }
+
+.dac-sprite.dac-unfold-less, .dac-unfold-less.dac-modal-header-close:before, .paging-links .dac-unfold-less.prev-page-link:before, .paging-links .dac-unfold-less.next-page-link:before, .paging-links .dac-unfold-less.next-class-link:before, .paging-links .dac-unfold-less.start-class-link:after {
+  background-position: 0px -487px;
+  height: 24px;
+  width: 24px; }
+
+.dac-sprite.dac-unfold-more-white, .dac-unfold-more-white.dac-modal-header-close:before, .paging-links .dac-unfold-more-white.prev-page-link:before, .paging-links .dac-unfold-more-white.next-page-link:before, .paging-links .dac-unfold-more-white.next-class-link:before, .paging-links .dac-unfold-more-white.start-class-link:after {
+  background-position: 0px -305px;
+  height: 24px;
+  width: 24px; }
+
+.dac-sprite.dac-unfold-more, .dac-unfold-more.dac-modal-header-close:before, .paging-links .dac-unfold-more.prev-page-link:before, .paging-links .dac-unfold-more.next-page-link:before, .paging-links .dac-unfold-more.next-class-link:before, .paging-links .dac-unfold-more.start-class-link:after {
+  background-position: 0px -539px;
+  height: 24px;
+  width: 24px; }
+
+.dac-sprite.dac-youtube, .dac-youtube.dac-modal-header-close:before, .paging-links .dac-youtube.prev-page-link:before, .paging-links .dac-youtube.next-page-link:before, .paging-links .dac-youtube.next-class-link:before, .paging-links .dac-youtube.start-class-link:after {
+  background-position: 0px -57px;
+  height: 14px;
+  width: 18px; }
+
+/* Toast Component */
+.dac-toast {
+  background: #ffebc3;
+  border-top: 1px solid #e5d4a1;
+  display: none;
+  color: rgba(0, 0, 0, 0.87);
+  line-height: 1.4;
+  padding: 10px; }
+  .dac-toast.dac-visible {
+    display: block; }
+  .dac-toast-wrap {
+    box-sizing: border-box;
+    margin: 0 auto;
+    max-width: 940px;
+    padding-right: 20px;
+    position: relative; }
+  .dac-toast-close-btn {
+    background-color: transparent;
+    border: none;
+    border-radius: 0;
+    cursor: pointer;
+    opacity: .4;
+    padding: 0;
+    position: absolute;
+    right: 0;
+    top: 1px; }
+    .dac-toast-close-btn:hover, .dac-toast-close-btn:focus, .dac-toast-close-btn:active {
+      outline: none;
+      opacity: 1; }
+  .dac-toast-group {
+    bottom: 0;
+    left: 0;
+    position: fixed;
+    right: 0;
+    z-index: 60; }
+  .dac-toast.dac-danger {
+    background-color: #ffccbc;
+    border-top-color: #e5b7a9; }
+  .dac-toast.dac-success {
+    background-color: #cdedc8;
+    border-top-color: #c6d5b4; }
+
+.dac-tab-item {
+  box-sizing: border-box;
+  cursor: pointer;
+  display: table-cell;
+  margin: 0;
+  padding: 8px 12px;
+  position: relative;
+  text-align: left; }
+  @media (max-width: 719px) {
+    .dac-tab-item {
+      padding-right: 12px;
+      text-align: center;
+      width: 33.33333333%; } }
+
+.dac-tab-title {
+  color: #333;
+  display: inline-block;
+  font-size: 16px;
+  font-weight: 500;
+  margin: 0; }
 
-.dac-sprite.dac-search {
-  background-position: 0px -274px;
-  height: 24px;
-  width: 24px; }
+.dac-tab-arrow {
+  margin-top: -2px; }
+  @media (max-width: 719px) {
+    .dac-tab-arrow {
+      position: absolute;
+      visibility: hidden; } }
 
-.dac-sprite.dac-twitter {
-  background-position: 0px -73px;
-  height: 14px;
-  width: 16px; }
+.dac-tab-bar {
+  display: inline-block;
+  list-style-type: none;
+  margin: 0 0 0 12px;
+  vertical-align: middle;
+  overflow: hidden; }
+  @media (max-width: 719px) {
+    .dac-tab-bar {
+      display: table;
+      margin-left: 0;
+      width: 100%; } }
 
-.dac-sprite.dac-unfold-less-white {
-  background-position: 0px -326px;
-  height: 24px;
-  width: 24px; }
+.dac-tab-views {
+  list-style-type: none;
+  margin: 0; }
 
-.dac-sprite.dac-unfold-less {
-  background-position: 0px -352px;
-  height: 24px;
-  width: 24px; }
+.dac-tab-view {
+  background: #fff;
+  display: none;
+  overflow: hidden;
+  margin: 0 0 10px;
+  padding: 20px 10px 0;
+  text-align: left; }
 
-.dac-sprite.dac-unfold-more-white {
-  background-position: 0px -378px;
-  height: 24px;
-  width: 24px; }
+.dac-tab-item.dac-active {
+  background: #fff; }
 
-.dac-sprite.dac-unfold-more {
-  background-position: 0px -300px;
-  height: 24px;
-  width: 24px; }
+.dac-tab-item.dac-active .dac-tab-arrow {
+  -webkit-transform: scaleY(-1);
+      -ms-transform: scaleY(-1);
+          transform: scaleY(-1); }
 
-.dac-sprite.dac-youtube {
-  background-position: 0px -57px;
-  height: 14px;
-  width: 18px; }
+.dac-tab-view.dac-active {
+  display: block; }
 
 .dac-toggle-expand {
   cursor: pointer;
   display: inline-block; }
+
 .dac-toggle-collapse {
   cursor: pointer;
   display: none; }
+
 .dac-toggle.is-expanded .dac-toggle-expand {
   display: none; }
+
 .dac-toggle.is-expanded .dac-toggle-collapse {
   display: inline-block; }
+
 .dac-toggle-content {
   clear: left;
   overflow: hidden;
   max-height: 0;
   -webkit-transition: .3s max-height;
           transition: .3s max-height; }
+
 .dac-toggle.is-expanded .dac-toggle-content {
   max-height: none; }
+
 .dac-toggle.dac-mobile .dac-toggle-content {
   max-height: none; }
+
 @media (max-width: 719px) {
   .dac-toggle.dac-mobile .dac-toggle-content {
     max-height: 0; }
   .dac-toggle.is-expanded .dac-toggle-content {
     max-height: none; } }
 
-.dac-visible-mobile-block, .dac-mobile-only, .dac-visible-mobile-inline, .dac-visible-mobile-inline-block, .dac-visible-tablet-block, .dac-visible-tablet-inline, .dac-visible-tablet-inline-block, .dac-visible-desktop-block, .dac-visible-desktop-inline, .dac-visible-desktop-inline-block {
+/**
+ * Fades out an element.
+ * Applies visibility hidden when the transition is finished.
+ *
+ * Use opacity: 1; to show the element.
+ */
+.dac-visible-mobile-block, .dac-mobile-only,
+.dac-visible-mobile-inline,
+.dac-visible-mobile-inline-block,
+.dac-visible-tablet-block,
+.dac-visible-tablet-inline,
+.dac-visible-tablet-inline-block,
+.dac-visible-desktop-block,
+.dac-visible-desktop-inline,
+.dac-visible-desktop-inline-block {
   display: none !important; }
 
 @media (max-width: 719px) {
@@ -8710,6 +9419,12 @@ $spritesheet: width height image $spritesheet-sprites;
   position: relative !important; }
 
 /**
+ * Hide from browsers/screenreaders on all sizes.
+ */
+.dac-hidden {
+  display: none !important; }
+
+/**
  * Break strings when their length exceeds the width of their container.
  */
 .dac-text-break {
@@ -8777,88 +9492,270 @@ $spritesheet: width height image $spritesheet-sprites;
   width: 10000px !important;
 }
 
-#tb li:before, #qv li:before {
-  background-position: 0px -196px;
-  height: 24px;
-  width: 24px;
-  content: '';
-  left: -8px;
-  opacity: .7;
-  position: absolute;
-  top: -4px;
+.Video {
+  display: none;
 }
 
-/* CHANGE EXISTING SELECTOR FOR ANDROID M HERO ONLY
-   REMOVE THE BELOW STYLES WHEN THE ANDROID M CAROUSEL
-   GRAPHIC ON THE MAIN LANDING IS TAKEN DOWN */
-.dac-hero.mprev {
-  background-color: #fff;
-  background-position: 50% 53%;
-  background-size: cover;
-  background-image: url(../../assets/images/home/android_m_hero_1200.jpg);
-  box-sizing: border-box;
-  font-size: 16px;
-  min-height: 550px;
-  padding-top: 88px;
+.Video-overlay {
+  background-color: rgba(0, 0, 0, 0.8);
+  width: 100%;
+  height: 100%;
+  position: fixed;
+  top: 0;
+  left: 0;
+  z-index: 9999;
 }
 
-.dac-hero.summit {
-  background-image: url(../../images/ads_hero_17@2x.jpg);
+.Video-container {
+  width: 90vw;
+  height: 50.625vw;
+  max-height: calc(90vh - 29.25px);
+  max-width: calc(160vh - 52px);
+  margin: auto;
+  position: fixed;
+  top: -52px;
+  right: 0;
+  bottom: 0;
+  left: 0;
+  z-index: 9999;
 }
 
-.dac-hero.dac-darken.mprev::before {
-  background: rgba(0, 0, 0, 0.3);
+@media (min-width: 1422.22222222px) and (min-height: 800px) {
+  .Video-container {
+    width: 1280px;
+    height: 720px;
+  }
+}
+
+.Video-controls {
+  background: #28655F;
+  height: 52px;
+  margin: 0 auto;
+  position: relative;
+  box-shadow: 2px 3px 12px 0px rgba(0, 0, 0, 0.4);
+}
+
+.Video-frame {
+  position: relative;
+  height: 100%;
+  background: black;
+  box-shadow: 2px 3px 12px 0px rgba(0, 0, 0, 0.4);
+}
+
+.Video-loading {
+  color: rgba(255, 255, 255, 0.35);
+  font-size: 16px;
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  -webkit-transform: translate(-50%, -50%);
+  -ms-transform: translate(-50%, -50%);
+  transform: translate(-50%, -50%);
+}
+
+#youTubePlayer {
+  max-height: 720px;
+  position: absolute;
+  top: 0;
+  right: 0;
   bottom: 0;
-  content: '';
-  display: block;
   left: 0;
+  width: 100%;
+  height: 100%;
+}
+
+.Video-button {
+  background-color: transparent;
+  border: none;
+  display: inline-block;
+  height: 100%;
+  width: 52px;
+  outline: none;
+  cursor: pointer;
+  -webkit-transition: opacity 200ms;
+  transition: opacity 200ms;
+}
+
+.Video-button:hover {
+  opacity: 0.8;
+}
+
+.Video-button--picture-in-picture {
+  background-position: 0px -461px;
+  height: 24px;
+  width: 24px;
+  display: none;
   position: absolute;
-  right: 0;
-  top: 0;
+  right: 64px;
+  top: 14px;
 }
 
-.dac-hero.dac-darken.mprev::before {
-  background: -webkit-linear-gradient(top, rgba(0, 0, 0, .05), rgba(0, 0, 0, .05), #000 950px);
-  background: linear-gradient(to bottom, rgba(0, 0, 0, .05), rgba(0, 0, 0, 0.05), #000 950px);
+.Video-button--close {
+  background-position: 0px -435px;
+  height: 24px;
+  width: 24px;
+  position: absolute;
+  right: 14px;
+  top: 14px;
 }
 
-@media (max-width: 719px) {
+@media (min-width: 720px) {
+  .Video--picture-in-picture .Video-overlay {
+    display: none;
+  }
 
-  .dac-hero.dac-darken.mprev {
-    background-size: auto 600px;
-    background-position: 55% 0;
-    background-repeat: no-repeat;
+  .Video--picture-in-picture .Video-container {
+    top: auto;
+    left: auto;
+    bottom: 20px;
+    right: 20px;
+    width: 40%;
+    max-width: 420px;
+    height: auto;
   }
 
-  .dac-hero-figure.mprev {
-    height: 10px;
-    margin: 15px 0;
+  .Video--picture-in-picture .Video-button--picture-in-picture {
+    background-position: 0px -409px;
+    height: 24px;
+    width: 24px;
+  }
+
+  .Video--picture-in-picture .Video-frame {
+    padding-bottom: 56.25%;
+  }
+
+  .Video-button--picture-in-picture {
+    display: inline-block;
   }
 }
 
-@media (max-width: 719px) {
+a.video-shadowbox-button.white {
+  padding: 16px 42px 16px 8px;
+  font-size: 18px;
+  font-weight: 500;
+  line-height: 24px;
+  color: #fff;
+  text-decoration: none;
+}
 
-  .dac-hero.dac-darken.mprev {
-    background-size: auto 600px;
-    background-position: 55% 0;
-    background-repeat: no-repeat;
+a.video-shadowbox-button.white::after {
+  content: '';
+  background-position: 0px -847px;
+  height: 36px;
+  width: 36px;
+}
+
+a.video-shadowbox-button.white:hover {
+  color: #bababa !important;
+}
+
+a.video-shadowbox-button.white:hover::after {
+  background-position: 0px -733px;
+  height: 36px;
+  width: 36px;
+}
+
+#video-frame, #video-container {
+  display: none;
+}
+
+@media (max-width: 720px) {
+  .wide-table {
+    overflow-x: auto;
   }
 
-  .dac-hero-figure.mprev {
-    height: 10px;
-    margin: 15px 0;
+  .wide-table table {
+    display: inline-table;
+    margin-right: 0;
   }
 }
 
-@media (max-width: 1200px) {
+/* New CSS that isn't part of a component */
+.paging-links {
+  box-shadow: 0px 2px 6px 0px rgba(0, 0, 0, 0.2);
+  margin: 30px 0;
+  padding: 0 40px;
+  /* Start class link doesn't have a caption */ }
 
-  .dac-hero.dac-darken.mprev {
-    background-size: auto 700px;
-    background-position: 55% 0;
-    background-repeat: no-repeat;
+.paging-links .start-class-link, .paging-links .next-class-link, .paging-links .prev-page-link, .paging-links .next-page-link {
+  font-size: 20px;
+  font-weight: 500;
+  display: inline-block;
+  width: calc(50% - 2px);
+  position: relative;
+  padding: 46px 0 36px 0;
+}
+
+@media (max-width: 719px) {
+  .paging-links .start-class-link, .paging-links .next-class-link, .paging-links .prev-page-link, .paging-links .next-page-link {
+    width: 100%;
   }
+}
 
-  .dac-hero-cta.mprev {
-  white-space:nowrap;
+.paging-links .start-class-link {
+  padding: 36px 0;
+}
+
+.paging-links .start-class-link, .paging-links .next-class-link {
+  text-align: center;
+  width: 100%;
+}
+
+.paging-links .prev-page-link .page-link-caption {
+  left: 0;
+}
+
+.paging-links .prev-page-link:before {
+  content: '';
+  left: -24px;
+  position: absolute;
+  bottom: 41px;
+}
+
+@media (max-width: 719px) {
+  .paging-links .prev-page-link {
+    display: none;
   }
-}
\ No newline at end of file
+}
+
+.paging-links .next-page-link, .paging-links .next-class-link {
+  text-align: right;
+}
+
+.paging-links .next-page-link .page-link-caption, .paging-links .next-class-link .page-link-caption {
+  right: 0;
+}
+
+.paging-links .next-page-link:before, .paging-links .next-class-link:before {
+  content: '';
+  right: -24px;
+  position: absolute;
+  bottom: 41px;
+}
+
+.paging-links .start-class-link:after {
+  content: '';
+  right: -12px;
+  position: relative;
+  bottom: 3px;
+}
+
+.paging-links .page-link-caption {
+  position: absolute;
+  top: 26px;
+  font-size: 14px;
+  font-weight: 700;
+  opacity: 0.54;
+}
+
+#tb li:before,
+#qv li:before {
+  background-position: 0px -669px;
+  height: 24px;
+  width: 24px;
+  content: '';
+  left: -8px;
+  opacity: .7;
+  position: absolute;
+  top: -4px;
+}
index 5f19215..53f59c6 100644 (file)
Binary files a/tools/droiddoc/templates-sdk-dev/assets/images/android_logo.png and b/tools/droiddoc/templates-sdk-dev/assets/images/android_logo.png differ
index 04132cc..85b9211 100644 (file)
Binary files a/tools/droiddoc/templates-sdk-dev/assets/images/android_logo@2x.png and b/tools/droiddoc/templates-sdk-dev/assets/images/android_logo@2x.png differ
diff --git a/tools/droiddoc/templates-sdk-dev/assets/images/play-circle-grey.png b/tools/droiddoc/templates-sdk-dev/assets/images/play-circle-grey.png
deleted file mode 100644 (file)
index 5e7e7ba..0000000
Binary files a/tools/droiddoc/templates-sdk-dev/assets/images/play-circle-grey.png and /dev/null differ
diff --git a/tools/droiddoc/templates-sdk-dev/assets/images/play-circle-grey_2x.png b/tools/droiddoc/templates-sdk-dev/assets/images/play-circle-grey_2x.png
deleted file mode 100644 (file)
index 3e01635..0000000
Binary files a/tools/droiddoc/templates-sdk-dev/assets/images/play-circle-grey_2x.png and /dev/null differ
diff --git a/tools/droiddoc/templates-sdk-dev/assets/images/play-circle-white.png b/tools/droiddoc/templates-sdk-dev/assets/images/play-circle-white.png
deleted file mode 100644 (file)
index 017d846..0000000
Binary files a/tools/droiddoc/templates-sdk-dev/assets/images/play-circle-white.png and /dev/null differ
diff --git a/tools/droiddoc/templates-sdk-dev/assets/images/play-circle-white_2x.png b/tools/droiddoc/templates-sdk-dev/assets/images/play-circle-white_2x.png
deleted file mode 100644 (file)
index e48c1fd..0000000
Binary files a/tools/droiddoc/templates-sdk-dev/assets/images/play-circle-white_2x.png and /dev/null differ
index 7fef43e..562b23c 100644 (file)
Binary files a/tools/droiddoc/templates-sdk-dev/assets/images/sprite.png and b/tools/droiddoc/templates-sdk-dev/assets/images/sprite.png differ
diff --git a/tools/droiddoc/templates-sdk-dev/assets/images/sprite@2x.png b/tools/droiddoc/templates-sdk-dev/assets/images/sprite@2x.png
new file mode 100644 (file)
index 0000000..2019e02
Binary files /dev/null and b/tools/droiddoc/templates-sdk-dev/assets/images/sprite@2x.png differ
index a67b5b0..70d6c2f 100644 (file)
@@ -2763,4 +2763,10 @@ jQuery.effects||function(a,b){function c(b){var c;return b&&b.constructor==Array
 * https://github.com/jquery/jquery-ui
 * Includes: jquery.effects.transfer.js
 * Copyright (c) 2012 AUTHORS.txt; Licensed MIT, GPL */
-(function(a,b){a.effects.transfer=function(b){return this.queue(function(){var c=a(this),d=a(b.options.to),e=d.offset(),f={top:e.top,left:e.left,height:d.innerHeight(),width:d.innerWidth()},g=c.offset(),h=a('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(b.options.className).css({top:g.top,left:g.left,height:c.innerHeight(),width:c.innerWidth(),position:"absolute"}).animate(f,b.duration,b.options.easing,function(){h.remove(),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);;
\ No newline at end of file
+(function(a,b){a.effects.transfer=function(b){return this.queue(function(){var c=a(this),d=a(b.options.to),e=d.offset(),f={top:e.top,left:e.left,height:d.innerHeight(),width:d.innerWidth()},g=c.offset(),h=a('<div class="ui-effects-transfer"></div>').appendTo(document.body).addClass(b.options.className).css({top:g.top,left:g.left,height:c.innerHeight(),width:c.innerWidth(),position:"absolute"}).animate(f,b.duration,b.options.easing,function(){h.remove(),b.callback&&b.callback.apply(c[0],arguments),c.dequeue()})})}})(jQuery);;
+/*! (c) 2012 Airbnb, Inc.
+*
+* polyglot.js 0.4.3 may be freely distributed under the terms of the BSD
+* license. For all licensing information, details, and documention:
+* http://airbnb.github.com/polyglot.js */
+(function(e,t){typeof define=="function"&&define.amd?define([],function(){return t(e)}):typeof exports=="object"?module.exports=t(e):e.Polyglot=t(e)})(this,function(e){"use strict";function t(e){e=e||{},this.phrases={},this.extend(e.phrases||{}),this.currentLocale=e.locale||"en",this.allowMissing=!!e.allowMissing,this.warn=e.warn||c}function s(e){var t,n,r,i={};for(t in e)if(e.hasOwnProperty(t)){n=e[t];for(r in n)i[n[r]]=t}return i}function o(e){var t=/^\s+|\s+$/g;return e.replace(t,"")}function u(e,t,r){var i,s,u;return r!=null&&e?(s=e.split(n),u=s[f(t,r)]||s[0],i=o(u)):i=e,i}function a(e){var t=s(i);return t[e]||t.en}function f(e,t){return r[a(e)](t)}function l(e,t){for(var n in t)n!=="_"&&t.hasOwnProperty(n)&&(e=e.replace(new RegExp("%\\{"+n+"\\}","g"),t[n]));return e}function c(t){e.console&&e.console.warn&&e.console.warn("WARNING: "+t)}function h(e){var t={};for(var n in e)t[n]=e[n];return t}t.VERSION="0.4.3",t.prototype.locale=function(e){return e&&(this.currentLocale=e),this.currentLocale},t.prototype.extend=function(e,t){var n;for(var r in e)e.hasOwnProperty(r)&&(n=e[r],t&&(r=t+"."+r),typeof n=="object"?this.extend(n,r):this.phrases[r]=n)},t.prototype.clear=function(){this.phrases={}},t.prototype.replace=function(e){this.clear(),this.extend(e)},t.prototype.t=function(e,t){var n,r;return t=t==null?{}:t,typeof t=="number"&&(t={smart_count:t}),typeof this.phrases[e]=="string"?n=this.phrases[e]:typeof t._=="string"?n=t._:this.allowMissing?n=e:(this.warn('Missing translation for key: "'+e+'"'),r=e),typeof n=="string"&&(t=h(t),r=u(n,this.currentLocale,t.smart_count),r=l(r,t)),r},t.prototype.has=function(e){return e in this.phrases};var n="||||",r={chinese:function(e){return 0},german:function(e){return e!==1?1:0},french:function(e){return e>1?1:0},russian:function(e){return e%10===1&&e%100!==11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},czech:function(e){return e===1?0:e>=2&&e<=4?1:2},polish:function(e){return e===1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2},icelandic:function(e){return e%10!==1||e%100===11?1:0}},i={chinese:["fa","id","ja","ko","lo","ms","th","tr","zh"],german:["da","de","en","es","fi","el","he","hu","it","nl","no","pt","sv"],french:["fr","tl","pt-br"],russian:["hr","ru"],czech:["cs"],polish:["pl"],icelandic:["is"]};return t});
index c30284b..21dec54 100644 (file)
@@ -1,16 +1,9 @@
-var classesNav;
-var devdocNav;
-var sidenav;
 var cookie_namespace = 'android_developer';
-var NAV_PREF_TREE = "tree";
-var NAV_PREF_PANELS = "panels";
-var nav_pref;
 var isMobile = false; // true if mobile, so we can adjust some layout
 var mPagePath; // initialized in ready() function
 
 var basePath = getBaseUri(location.pathname);
-var SITE_ROOT = toRoot + basePath.substring(1,basePath.indexOf("/",1));
-var GOOGLE_DATA; // combined data for google service apis, used for search suggest
+var SITE_ROOT = toRoot + basePath.substring(1, basePath.indexOf("/", 1));
 
 // Ensure that all ajax getScript() requests allow caching
 $.ajaxSetup({
@@ -21,102 +14,11 @@ $.ajaxSetup({
 
 $(document).ready(function() {
 
-  // show lang dialog if the URL includes /intl/
-  //if (location.pathname.substring(0,6) == "/intl/") {
-  //  var lang = location.pathname.split('/')[2];
-   // if (lang != getLangPref()) {
-   //   $("#langMessage a.yes").attr("onclick","changeLangPref('" + lang
-   //       + "', true); $('#langMessage').hide(); return false;");
-  //    $("#langMessage .lang." + lang).show();
-   //   $("#langMessage").show();
-   // }
-  //}
-
-  // load json file for JD doc search suggestions
-  $.getScript(toRoot + 'jd_lists_unified.js');
-  // load json file for Android API search suggestions
-  $.getScript(toRoot + 'reference/lists.js');
-  // load json files for Google services API suggestions
-  $.getScript(toRoot + 'reference/gcm_lists.js', function(data, textStatus, jqxhr) {
-      // once the GCM json (GCM_DATA) is loaded, load the GMS json (GMS_DATA) and merge the data
-      if(jqxhr.status === 200) {
-          $.getScript(toRoot + 'reference/gms_lists.js', function(data, textStatus, jqxhr) {
-              if(jqxhr.status === 200) {
-                  // combine GCM and GMS data
-                  GOOGLE_DATA = GMS_DATA;
-                  var start = GOOGLE_DATA.length;
-                  for (var i=0; i<GCM_DATA.length; i++) {
-                      GOOGLE_DATA.push({id:start+i, label:GCM_DATA[i].label,
-                              link:GCM_DATA[i].link, type:GCM_DATA[i].type});
-                  }
-              }
-          });
-      }
-  });
-
-  // setup keyboard listener for search shortcut
-  $('body').keyup(function(event) {
-    if (event.which == 191 && $(event.target).is(':not(:input)')) {
-      $('#search_autocomplete').focus();
-    }
-  });
-
-  // init the fullscreen toggle click event
-  $('#nav-swap .fullscreen').click(function(){
-    if ($(this).hasClass('disabled')) {
-      toggleFullscreen(true);
-    } else {
-      toggleFullscreen(false);
-    }
-  });
-
-  // initialize the divs with custom scrollbars
-  if (window.innerWidth >= 720) {
-    $('.scroll-pane').jScrollPane({verticalGutter: 0});
-  }
-
-  // set up the search close button
-  $('#search-close').on('click touchend', function() {
-    $searchInput = $('#search_autocomplete');
-    $searchInput.attr('value', '');
-    $(this).addClass("hide");
-    $("#search-container").removeClass('active');
-    $("#search_autocomplete").blur();
-    search_focus_changed($searchInput.get(), false);
-    hideResults();
-  });
-
-
-  //Set up search
-  $("#search_autocomplete").focus(function() {
-    $("#search-container").addClass('active');
-  })
-  $("#search-container").on('mouseover touchend', function(e) {
-    if ($(e.target).is('#search-close')) { return; }
-    $("#search-container").addClass('active');
-    $("#search_autocomplete").focus();
-  })
-  $("#search-container").mouseout(function() {
-    if ($("#search_autocomplete").is(":focus")) return;
-    if ($("#search_autocomplete").val() == '') {
-      setTimeout(function(){
-        $("#search-container").removeClass('active');
-        $("#search_autocomplete").blur();
-      },250);
-    }
-  })
-  $("#search_autocomplete").blur(function() {
-    if ($("#search_autocomplete").val() == '') {
-      $("#search-container").removeClass('active');
-    }
-  })
-
-
   // prep nav expandos
   var pagePath = document.location.pathname;
   // account for intl docs by removing the intl/*/ path
   if (pagePath.indexOf("/intl/") == 0) {
-    pagePath = pagePath.substr(pagePath.indexOf("/",6)); // start after intl/ to get last /
+    pagePath = pagePath.substr(pagePath.indexOf("/", 6)); // start after intl/ to get last /
   }
 
   if (pagePath.indexOf(SITE_ROOT) == 0) {
@@ -147,95 +49,10 @@ $(document).ready(function() {
     // Otherwise the page path is already an absolute URL
   }
 
-  // Highlight the header tabs...
-  // highlight Design tab
-  var urlSegments = pagePathOriginal.split('/');
-  var navEl = $(".dac-nav-list");
-  var subNavEl = navEl.find(".dac-nav-secondary");
-  var parentNavEl;
-
-  if ($("body").hasClass("design")) {
-    navEl.find("> li.design > a").addClass("selected");
-  // highlight About tabs
-  } else if ($("body").hasClass("about")) {
-    if (urlSegments[1] == "about" || urlSegments[1] == "wear" || urlSegments[1] == "tv" || urlSegments[1] == "auto") {
-      navEl.find("> li.home > a").addClass('has-subnav');
-      subNavEl.find("li." + urlSegments[1] + " > a").addClass("selected");
-    } else {
-      navEl.find("> li.home > a").addClass('selected');
-    }
-
-// highlight NDK tabs
-  } else if ($("body").hasClass("ndk")) {
-    parentNavEl = navEl.find("> li.ndk > a");
-    parentNavEl.addClass('has-subnav');
-    if ($("body").hasClass("guide")) {
-      navEl.find("> li.guides > a").addClass("selected ndk");
-    } else if ($("body").hasClass("reference")) {
-      navEl.find("> li.reference > a").addClass("selected ndk");
-    } else if ($("body").hasClass("samples")) {
-      navEl.find("> li.samples > a").addClass("selected ndk");
-    } else if ($("body").hasClass("downloads")) {
-      navEl.find("> li.downloads > a").addClass("selected ndk");
-    }
-
-  // highlight Develop tab
-  } else if ($("body").hasClass("develop") || $("body").hasClass("google")) {
-    parentNavEl = navEl.find("> li.develop > a");
-    parentNavEl.addClass('has-subnav');
-
-    // In Develop docs, also highlight appropriate sub-tab
-    if (urlSegments[1] == "training") {
-      subNavEl.find("li.training > a").addClass("selected");
-    } else if (urlSegments[1] == "guide") {
-      subNavEl.find("li.guide > a").addClass("selected");
-    } else if (urlSegments[1] == "reference") {
-      // If the root is reference, but page is also part of Google Services, select Google
-      if ($("body").hasClass("google")) {
-        subNavEl.find("li.google > a").addClass("selected");
-      } else {
-        subNavEl.find("li.reference > a").addClass("selected");
-      }
-    } else if ((urlSegments[1] == "tools") || (urlSegments[1] == "sdk")) {
-      subNavEl.find("li.tools > a").addClass("selected");
-    } else if ($("body").hasClass("google")) {
-      subNavEl.find("li.google > a").addClass("selected");
-    } else if ($("body").hasClass("samples")) {
-      subNavEl.find("li.samples > a").addClass("selected");
-    } else {
-      parentNavEl.removeClass('has-subnav').addClass("selected");
-    }
-  // highlight Distribute tab
-  } else if ($("body").hasClass("distribute")) {
-    parentNavEl = navEl.find("> li.distribute > a");
-    parentNavEl.addClass('has-subnav');
-
-    if (urlSegments[2] == "users") {
-      subNavEl.find("li.users > a").addClass("selected");
-    } else if (urlSegments[2] == "engage") {
-      subNavEl.find("li.engage > a").addClass("selected");
-    } else if (urlSegments[2] == "monetize") {
-      subNavEl.find("li.monetize > a").addClass("selected");
-    } else if (urlSegments[2] == "analyze") {
-      subNavEl.find("li.analyze > a").addClass("selected");
-    } else if (urlSegments[2] == "tools") {
-      subNavEl.find("li.essentials > a").addClass("selected");
-    } else if (urlSegments[2] == "stories") {
-      subNavEl.find("li.stories > a").addClass("selected");
-    } else if (urlSegments[2] == "essentials") {
-      subNavEl.find("li.essentials > a").addClass("selected");
-    } else if (urlSegments[2] == "googleplay") {
-      subNavEl.find("li.googleplay > a").addClass("selected");
-    } else {
-      parentNavEl.removeClass('has-subnav').addClass("selected");
-    }
-  }
-
   // set global variable so we can highlight the sidenav a bit later (such as for google reference)
   // and highlight the sidenav
   mPagePath = pagePath;
   highlightSidenav();
-  buildBreadcrumbs();
 
   // set up prev/next links if they exist
   var $selNavLink = $('#nav').find('a[href="' + pagePath + '"]');
@@ -264,8 +81,8 @@ false; // navigate across topic boundaries only in design docs
 
       // except if cross boundaries aren't allowed, and we're at the top of a section already
       // (and there's another parent)
-      if (!crossBoundaries && $parentListItem.hasClass('nav-section')
-                           && $selListItem.hasClass('nav-section')) {
+      if (!crossBoundaries && $parentListItem.hasClass('nav-section') &&
+                           $selListItem.hasClass('nav-section')) {
         $prevLink = [];
       }
     }
@@ -280,7 +97,7 @@ false; // navigate across topic boundaries only in design docs
       $nextLink = $selListItem.find('ul:eq(0)').find('a:eq(0)');
 
       // if there aren't any children, go to the next section (required for About pages)
-      if($nextLink.length == 0) {
+      if ($nextLink.length == 0) {
         $nextLink = $selListItem.next('li').find('a');
       } else if ($('.topic-start-link').length) {
         // as long as there's a child link and there is a "topic start link" (we're on a landing)
@@ -304,7 +121,7 @@ false; // navigate across topic boundaries only in design docs
           $nextLink = $selListItem.parents('li:eq(1)').next('li.nav-section').find('a:eq(0)');
           if ($nextLink.length == 0) {
             // if that doesn't work, we're at the end of the list, so disable NEXT link
-            $('.next-page-link').attr('href','').addClass("disabled")
+            $('.next-page-link').attr('href', '').addClass("disabled")
                                 .click(function() { return false; });
             // and completely hide the one in the footer
             $('.content-footer .next-page-link').hide();
@@ -323,22 +140,27 @@ false; // navigate across topic boundaries only in design docs
       }
     } else if (isCrossingBoundary && !$('body.design').length) {  // Design always crosses boundaries
       $('.content-footer.next-class').show();
-      $('.next-page-link').attr('href','')
+      $('.next-page-link').attr('href', '')
                           .removeClass("hide").addClass("disabled")
                           .click(function() { return false; });
       // and completely hide the one in the footer
       $('.content-footer .next-page-link').hide();
+      $('.content-footer .prev-page-link').hide();
+
       if ($nextLink.length) {
-        $('.next-class-link').attr('href',$nextLink.attr('href'))
-                             .removeClass("hide")
-                             .append(": " + $nextLink.html());
+        $('.next-class-link').attr('href', $nextLink.attr('href'))
+                             .removeClass("hide");
+
+        $('.content-footer .next-class-link').append($nextLink.html());
+
         $('.next-class-link').find('.new').empty();
       }
     } else {
       $('.next-page-link').attr('href', $nextLink.attr('href'))
                           .removeClass("hide");
-      // for the footer link, also add the next page title
-      $('.content-footer .next-page-link').append(": " + $nextLink.html());
+      // for the footer link, also add the previous and next page titles
+      $('.content-footer .prev-page-link').append($prevLink.html());
+      $('.content-footer .next-page-link').append($nextLink.html());
     }
 
     if (!startClass && $prevLink.length) {
@@ -352,8 +174,6 @@ false; // navigate across topic boundaries only in design docs
 
   }
 
-
-
   // Set up the course landing pages for Training with class names and descriptions
   if ($('body.trainingcourse').length) {
     var $classLinks = $selListItem.find('ul li a').not('#nav .nav-section .nav-section ul a');
@@ -380,7 +200,7 @@ false; // navigate across topic boundaries only in design docs
     var $liLesson;
     $classLinks.each(function(index) {
       $liClass  = $('<li class="clearfix"></li>');
-      $h2Title  = $('<a class="title" href="'+$(this).attr('href')+'"><h2 class="norule">' + $(this).html()+'</h2><span></span></a>');
+      $h2Title  = $('<a class="title" href="' + $(this).attr('href') + '"><h2 class="norule">' + $(this).html() + '</h2><span></span></a>');
       $pSummary = $('<p class="description">' + $classDescriptions[index] + '</p>');
 
       $olLessons  = $('<ol class="lesson-list"></ol>');
@@ -389,7 +209,7 @@ false; // navigate across topic boundaries only in design docs
 
       if ($lessons.length) {
         $lessons.each(function(index) {
-          $olLessons.append('<li><a href="'+$(this).attr('href')+'">' + $(this).html()+'</a></li>');
+          $olLessons.append('<li><a href="' + $(this).attr('href') + '">' + $(this).html() + '</a></li>');
         });
       } else {
         $pSummary.addClass('article');
@@ -398,35 +218,14 @@ false; // navigate across topic boundaries only in design docs
       $liClass.append($h2Title).append($pSummary).append($olLessons);
       $olClasses.append($liClass);
     });
-    $('.jd-descr').append($olClasses);
+    $('#classes').append($olClasses);
   }
 
   // Set up expand/collapse behavior
   initExpandableNavItems("#nav");
 
-
-  $(".scroll-pane").scroll(function(event) {
-      event.preventDefault();
-      return false;
-  });
-
-  /* Resize nav height when window height changes */
-  $(window).resize(function() {
-    if ($('#side-nav').length == 0) return;
-    setNavBarDimensions(); // do this even if sidenav isn't fixed because it could become fixed
-    // make sidenav behave when resizing the window and side-scolling is a concern
-    updateSideNavDimensions();
-    checkSticky();
-    resizeNav(250);
-  });
-
-  if ($('#devdoc-nav').length) {
-    setNavBarDimensions();
-  }
-
-
   // Set up play-on-hover <video> tags.
-  $('video.play-on-hover').bind('click', function(){
+  $('video.play-on-hover').bind('click', function() {
     $(this).get(0).load(); // in case the video isn't seekable
     $(this).get(0).play();
   });
@@ -474,220 +273,31 @@ false; // navigate across topic boundaries only in design docs
   });
 
   //Loads the +1 button
-  var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
-  po.src = 'https://apis.google.com/js/plusone.js';
-  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
-
-  $(".scroll-pane").removeAttr("tabindex"); // get rid of tabindex added by jscroller
-
-  if ($(".scroll-pane").length > 1) {
-    // Check if there's a user preference for the panel heights
-    var cookieHeight = readCookie("reference_height");
-    if (cookieHeight) {
-      restoreHeight(cookieHeight);
-    }
-  }
-
-  // Resize once loading is finished
-  resizeNav();
-  // Check if there's an anchor that we need to scroll into view.
-  // A delay is needed, because some browsers do not immediately scroll down to the anchor
-  window.setTimeout(offsetScrollForSticky, 100);
-
-  /* init the language selector based on user cookie for lang */
-  loadLangPref();
-  changeNavLang(getLangPref());
-
-  /* setup event handlers to ensure the overflow menu is visible while picking lang */
-  $("#language select")
-      .mousedown(function() {
-        $("div.morehover").addClass("hover"); })
-      .blur(function() {
-        $("div.morehover").removeClass("hover"); });
-
-  /* some global variable setup */
-  resizePackagesNav = $("#resize-packages-nav");
-  classesNav = $("#classes-nav");
-  devdocNav = $("#devdoc-nav");
-
-  var cookiePath = "";
-  if (location.href.indexOf("/reference/") != -1) {
-    cookiePath = "reference_";
-  } else if (location.href.indexOf("/guide/") != -1) {
-    cookiePath = "guide_";
-  } else if (location.href.indexOf("/tools/") != -1) {
-    cookiePath = "tools_";
-  } else if (location.href.indexOf("/training/") != -1) {
-    cookiePath = "training_";
-  } else if (location.href.indexOf("/design/") != -1) {
-    cookiePath = "design_";
-  } else if (location.href.indexOf("/distribute/") != -1) {
-    cookiePath = "distribute_";
-  }
-
-
-  /* setup shadowbox for any videos that want it */
-  var $videoLinks = $("a.video-shadowbox-button, a.notice-developers-video");
-  if ($videoLinks.length) {
-    // if there's at least one, add the shadowbox HTML to the body
-    $('body').prepend(
-'<div id="video-container">'+
-  '<div id="video-frame">'+
-    '<div class="video-close">'+
-      '<span id="icon-video-close" onclick="closeVideo()">&nbsp;</span>'+
-    '</div>'+
-    '<div id="youTubePlayer"></div>'+
-  '</div>'+
-'</div>');
-
-    // loads the IFrame Player API code asynchronously.
-    $.getScript("https://www.youtube.com/iframe_api");
-
-    $videoLinks.each(function() {
-      var videoId = $(this).attr('href').split('?v=')[1];
-      $(this).click(function(event) {
-        event.preventDefault();
-        startYouTubePlayer(videoId);
-      });
-    });
-  }
+  //var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
+  //po.src = 'https://apis.google.com/js/plusone.js';
+  //var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
 });
 // END of the onload event
 
-
-var youTubePlayer;
-function onYouTubeIframeAPIReady() {
-}
-
-/* Returns the height the shadowbox video should be. It's based on the current
-   height of the "video-frame" element, which is 100% height for the window.
-   Then minus the margin so the video isn't actually the full window height. */
-function getVideoHeight() {
-  var frameHeight = $("#video-frame").height();
-  var marginTop = $("#video-frame").css('margin-top').split('px')[0];
-  return frameHeight - (marginTop * 2);
-}
-
-var mPlayerPaused = false;
-
-function startYouTubePlayer(videoId) {
-  $("#video-container").show();
-  $("#video-frame").show();
-  mPlayerPaused = false;
-
-  // compute the size of the player so it's centered in window
-  var maxWidth = 940;  // the width of the web site content
-  var videoAspect = .5625; // based on 1280x720 resolution
-  var maxHeight = maxWidth * videoAspect;
-  var videoHeight = getVideoHeight();
-  var videoWidth = videoHeight / videoAspect;
-  if (videoWidth > maxWidth) {
-    videoWidth = maxWidth;
-    videoHeight = maxHeight;
-  }
-  $("#video-frame").css('width', videoWidth);
-
-  // check if we've already created this player
-  if (youTubePlayer == null) {
-    // check if there's a start time specified
-    var idAndHash = videoId.split("#");
-    var startTime = 0;
-    if (idAndHash.length > 1) {
-      startTime = idAndHash[1].split("t=")[1] != undefined ? idAndHash[1].split("t=")[1] : 0;
-    }
-    // enable localized player
-    var lang = getLangPref();
-    var captionsOn = lang == 'en' ? 0 : 1;
-
-    youTubePlayer = new YT.Player('youTubePlayer', {
-      height: videoHeight,
-      width: videoWidth,
-      videoId: idAndHash[0],
-      playerVars: {start: startTime, hl: lang, cc_load_policy: captionsOn},
-      events: {
-        'onReady': onPlayerReady,
-        'onStateChange': onPlayerStateChange
-      }
-    });
-  } else {
-    // reset the size in case the user adjusted the window since last play
-    youTubePlayer.setSize(videoWidth, videoHeight);
-    // if a video different from the one already playing was requested, cue it up
-    if (videoId != youTubePlayer.getVideoUrl().split('?v=')[1].split('&')[0].split('%')[0]) {
-      youTubePlayer.cueVideoById(videoId);
-    }
-    youTubePlayer.playVideo();
-  }
-}
-
-function onPlayerReady(event) {
-  event.target.playVideo();
-  mPlayerPaused = false;
-}
-
-function closeVideo() {
-  try {
-    youTubePlayer.pauseVideo();
-  } catch(e) {
-  }
-  $("#video-container").fadeOut(200);
-}
-
-/* Track youtube playback for analytics */
-function onPlayerStateChange(event) {
-    // Video starts, send the video ID
-    if (event.data == YT.PlayerState.PLAYING) {
-      if (mPlayerPaused) {
-        ga('send', 'event', 'Videos', 'Resume',
-            youTubePlayer.getVideoUrl().split('?v=')[1].split('&')[0].split('%')[0]);
-      } else {
-        // track the start playing event so we know from which page the video was selected
-        ga('send', 'event', 'Videos', 'Start: ' +
-            youTubePlayer.getVideoUrl().split('?v=')[1].split('&')[0].split('%')[0],
-            'on: ' + document.location.href);
-      }
-      mPlayerPaused = false;
-    }
-    // Video paused, send video ID and video elapsed time
-    if (event.data == YT.PlayerState.PAUSED) {
-      ga('send', 'event', 'Videos', 'Paused',
-            youTubePlayer.getVideoUrl().split('?v=')[1].split('&')[0].split('%')[0],
-            youTubePlayer.getCurrentTime());
-      mPlayerPaused = true;
-    }
-    // Video finished, send video ID and video elapsed time
-    if (event.data == YT.PlayerState.ENDED) {
-      ga('send', 'event', 'Videos', 'Finished',
-            youTubePlayer.getVideoUrl().split('?v=')[1].split('&')[0].split('%')[0],
-            youTubePlayer.getCurrentTime());
-      mPlayerPaused = true;
-    }
-}
-
-
-
 function initExpandableNavItems(rootTag) {
   $(rootTag + ' li.nav-section .nav-section-header').click(function() {
     var section = $(this).closest('li.nav-section');
     if (section.hasClass('expanded')) {
-    /* hide me and descendants */
+      /* hide me and descendants */
       section.find('ul').slideUp(250, function() {
         // remove 'expanded' class from my section and any children
         section.closest('li').removeClass('expanded');
         $('li.nav-section', section).removeClass('expanded');
-        resizeNav();
       });
     } else {
-    /* show me */
+      /* show me */
       // first hide all other siblings
       var $others = $('li.nav-section.expanded', $(this).closest('ul')).not('.sticky');
       $others.removeClass('expanded').children('ul').slideUp(250);
 
       // now expand me
       section.closest('li').addClass('expanded');
-      section.children('ul').slideDown(250, function() {
-        resizeNav();
-      });
+      section.children('ul').slideDown(250);
     }
   });
 
@@ -700,35 +310,6 @@ function initExpandableNavItems(rootTag) {
   });
 }
 
-
-/** Create the list of breadcrumb links in the sticky header */
-function buildBreadcrumbs() {
-  var $breadcrumbUl =  $(".dac-header-crumbs");
-  var primaryNavLink = ".dac-nav-list > .dac-nav-item > .dac-nav-link";
-
-  // Add the secondary horizontal nav item, if provided
-  var $selectedSecondNav = $(".dac-nav-secondary .dac-nav-link.selected").clone()
-    .attr('class', 'dac-header-crumbs-link');
-
-  if ($selectedSecondNav.length) {
-    $breadcrumbUl.prepend($('<li class="dac-header-crumbs-item">').append($selectedSecondNav));
-  }
-
-  // Add the primary horizontal nav
-  var $selectedFirstNav = $(primaryNavLink + ".selected, " + primaryNavLink + ".has-subnav").clone()
-    .attr('class', 'dac-header-crumbs-link');
-
-  // If there's no header nav item, use the logo link and title from alt text
-  if ($selectedFirstNav.length < 1) {
-    $selectedFirstNav = $('<a class="dac-header-crumbs-link">')
-        .attr('href', $("div#header .logo a").attr('href'))
-        .text($("div#header .logo img").attr('alt'));
-  }
-  $breadcrumbUl.prepend($('<li class="dac-header-crumbs-item">').append($selectedFirstNav));
-}
-
-
-
 /** Highlight the current page in sidenav, expanding children as appropriate */
 function highlightSidenav() {
   // if something is already highlighted, undo it. This is for dynamic navigation (Samples index)
@@ -744,6 +325,8 @@ function highlightSidenav() {
   }
 
   var $selListItem;
+  var breadcrumb = [];
+
   if ($selNavLink.length) {
     // Find this page's <li> in sidenav and set selected
     $selListItem = $selNavLink.closest('li');
@@ -753,8 +336,20 @@ function highlightSidenav() {
     $selNavLink.parents('li.nav-section').each(function() {
       $(this).addClass('expanded');
       $(this).children('ul').show();
+
+      var link = $(this).find('a').first();
+
+      if (!$(this).is($selListItem)) {
+        breadcrumb.unshift(link)
+      }
     });
+
+    $('#nav').scrollIntoView($selNavLink);
   }
+
+  breadcrumb.forEach(function(link) {
+    link.dacCrumbs();
+  });
 }
 
 function unHighlightSidenav() {
@@ -762,59 +357,6 @@ function unHighlightSidenav() {
   $('ul#nav li.nav-section.expanded').removeClass('expanded').children('ul').hide();
 }
 
-function toggleFullscreen(enable) {
-  var delay = 20;
-  var enabled = true;
-  var stylesheet = $('link[rel="stylesheet"][class="fullscreen"]');
-  if (enable) {
-    // Currently NOT USING fullscreen; enable fullscreen
-    stylesheet.removeAttr('disabled');
-    $('#nav-swap .fullscreen').removeClass('disabled');
-    $('#devdoc-nav').css({left:''});
-    setTimeout(updateSidenavFullscreenWidth,delay); // need to wait a moment for css to switch
-    enabled = true;
-  } else {
-    // Currently USING fullscreen; disable fullscreen
-    stylesheet.attr('disabled', 'disabled');
-    $('#nav-swap .fullscreen').addClass('disabled');
-    setTimeout(updateSidenavFixedWidth,delay); // need to wait a moment for css to switch
-    enabled = false;
-  }
-  writeCookie("fullscreen", enabled, null);
-  setNavBarDimensions();
-  resizeNav(delay);
-  updateSideNavDimensions();
-  setTimeout(initSidenavHeightResize,delay);
-}
-
-// TODO: Refactor into a closure.
-var navBarLeftPos;
-var navBarWidth;
-function setNavBarDimensions() {
-  navBarLeftPos = $('#body-content').offset().left;
-  navBarWidth = $('#side-nav').width();
-}
-
-
-function updateSideNavDimensions() {
-  var newLeft = $(window).scrollLeft() - navBarLeftPos;
-  $('#devdoc-nav').css({left: -newLeft, width: navBarWidth});
-  $('#devdoc-nav .totop').css({left: -(newLeft - parseInt($('#side-nav').css('padding-left')))});
-}
-
-// TODO: use $(document).ready instead
-function addLoadEvent(newfun) {
-  var current = window.onload;
-  if (typeof window.onload != 'function') {
-    window.onload = newfun;
-  } else {
-    window.onload = function() {
-      current();
-      newfun();
-    }
-  }
-}
-
 var agent = navigator['userAgent'].toLowerCase();
 // If a mobile phone, set flag and do mobile setup
 if ((agent.indexOf("mobile") != -1) ||      // android, iphone, ipod
@@ -824,195 +366,23 @@ if ((agent.indexOf("mobile") != -1) ||      // android, iphone, ipod
   isMobile = true;
 }
 
-
 $(document).ready(function() {
   $("pre:not(.no-pretty-print)").addClass("prettyprint");
   prettyPrint();
 });
 
-
-
-
-/* ######### RESIZE THE SIDENAV ########## */
-
-function resizeNav(delay) {
-  var $nav = $("#devdoc-nav");
-  var $window = $(window);
-  var navHeight;
-
-  // Get the height of entire window and the total header height.
-  // Then figure out based on scroll position whether the header is visible
-  var windowHeight = $window.height();
-  var scrollTop = $window.scrollTop();
-  var headerHeight = $('#header-wrapper').outerHeight();
-  var headerVisible = scrollTop < stickyTop;
-
-  // get the height of space between nav and top of window.
-  // Could be either margin or top position, depending on whether the nav is fixed.
-  var topMargin = (parseInt($nav.css('top')) || 20) + 1;
-  // add 1 for the #side-nav bottom margin
-
-  // Depending on whether the header is visible, set the side nav's height.
-  if (headerVisible) {
-    // The sidenav height grows as the header goes off screen
-    navHeight = windowHeight - (headerHeight - scrollTop) - topMargin;
-  } else {
-    // Once header is off screen, the nav height is almost full window height
-    navHeight = windowHeight - topMargin;
-  }
-
-
-
-  $scrollPanes = $(".scroll-pane");
-  if ($window.width() < 720) {
-    $nav.css('height', '');
-  } else if ($scrollPanes.length > 1) {
-    // subtract the height of the api level widget and nav swapper from the available nav height
-    navHeight -= ($('#api-nav-header').outerHeight(true) + $('#nav-swap').outerHeight(true));
-
-    $("#swapper").css({height:navHeight + "px"});
-    if ($("#nav-tree").is(":visible")) {
-      $("#nav-tree").css({height:navHeight});
-    }
-
-    var classesHeight = navHeight - parseInt($("#resize-packages-nav").css("height")) - 10 + "px";
-    //subtract 10px to account for drag bar
-
-    // if the window becomes small enough to make the class panel height 0,
-    // then the package panel should begin to shrink
-    if (parseInt(classesHeight) <= 0) {
-      $("#resize-packages-nav").css({height:navHeight - 10}); //subtract 10px for drag bar
-      $("#packages-nav").css({height:navHeight - 10});
-    }
-
-    $("#classes-nav").css({'height':classesHeight, 'margin-top':'10px'});
-    $("#classes-nav .jspContainer").css({height:classesHeight});
-
-
-  } else {
-    $nav.height(navHeight);
-  }
-
-  if (delay) {
-    updateFromResize = true;
-    delayedReInitScrollbars(delay);
-  } else {
-    reInitScrollbars();
-  }
-
-}
-
-var updateScrollbars = false;
-var updateFromResize = false;
-
-/* Re-initialize the scrollbars to account for changed nav size.
- * This method postpones the actual update by a 1/4 second in order to optimize the
- * scroll performance while the header is still visible, because re-initializing the
- * scroll panes is an intensive process.
- */
-function delayedReInitScrollbars(delay) {
-  // If we're scheduled for an update, but have received another resize request
-  // before the scheduled resize has occured, just ignore the new request
-  // (and wait for the scheduled one).
-  if (updateScrollbars && updateFromResize) {
-    updateFromResize = false;
-    return;
-  }
-
-  // We're scheduled for an update and the update request came from this method's setTimeout
-  if (updateScrollbars && !updateFromResize) {
-    reInitScrollbars();
-    updateScrollbars = false;
-  } else {
-    updateScrollbars = true;
-    updateFromResize = false;
-    setTimeout('delayedReInitScrollbars()',delay);
-  }
-}
-
-/* Re-initialize the scrollbars to account for changed nav size. */
-function reInitScrollbars() {
-  var pane = $(".scroll-pane").each(function(){
-    var api = $(this).data('jsp');
-    if (!api) {return;}
-    api.reinitialise( {verticalGutter:0} );
-  });
-  $(".scroll-pane").removeAttr("tabindex"); // get rid of tabindex added by jscroller
-}
-
-
-/* Resize the height of the nav panels in the reference,
- * and save the new size to a cookie */
-function saveNavPanels() {
-  var basePath = getBaseUri(location.pathname);
-  var section = basePath.substring(1,basePath.indexOf("/",1));
-  writeCookie("height", resizePackagesNav.css("height"), section);
-}
-
-
-
-function restoreHeight(packageHeight) {
-    $("#resize-packages-nav").height(packageHeight);
-    $("#packages-nav").height(packageHeight);
-  //  var classesHeight = navHeight - packageHeight;
- //   $("#classes-nav").css({height:classesHeight});
-  //  $("#classes-nav .jspContainer").css({height:classesHeight});
-}
-
-
-
-/* ######### END RESIZE THE SIDENAV HEIGHT ########## */
-
-
-
-
-
-/** Scroll the jScrollPane to make the currently selected item visible
-    This is called when the page finished loading. */
-function scrollIntoView(nav) {
-  return;
-  var $nav = $("#"+nav);
-  var element = $nav.jScrollPane({/* ...settings... */});
-  var api = element.data('jsp');
-
-  if ($nav.is(':visible')) {
-    var $selected = $(".selected", $nav);
-    if ($selected.length == 0) {
-      // If no selected item found, exit
-      return;
-    }
-    // get the selected item's offset from its container nav by measuring the item's offset
-    // relative to the document then subtract the container nav's offset relative to the document
-    var selectedOffset = $selected.offset().top - $nav.offset().top;
-    if (selectedOffset > $nav.height() * .8) { // multiply nav height by .8 so we move up the item
-                                               // if it's more than 80% down the nav
-      // scroll the item up by an amount equal to 80% the container nav's height
-      api.scrollTo(0, selectedOffset - ($nav.height() * .8), false);
-    }
-  }
-}
-
-
-
-
-
-
 /* Show popup dialogs */
 function showDialog(id) {
-  $dialog = $("#"+id);
+  $dialog = $("#" + id);
   $dialog.prepend('<div class="box-border"><div class="top"> <div class="left"></div> <div class="right"></div></div><div class="bottom"> <div class="left"></div> <div class="right"></div> </div> </div>');
   $dialog.wrapInner('<div/>');
   $dialog.removeClass("hide");
 }
 
-
-
-
-
 /* #########    COOKIES!     ########## */
 
 function readCookie(cookie) {
-  var myCookie = cookie_namespace+"_"+cookie+"=";
+  var myCookie = cookie_namespace + "_" + cookie + "=";
   if (document.cookie) {
     var index = document.cookie.indexOf(myCookie);
     if (index != -1) {
@@ -1029,98 +399,16 @@ function readCookie(cookie) {
 }
 
 function writeCookie(cookie, val, section) {
-  if (val==undefined) return;
-  section = section == null ? "_" : "_"+section+"_";
-  var age = 2*365*24*60*60; // set max-age to 2 years
-  var cookieValue = cookie_namespace + section + cookie + "=" + val
-                    + "; max-age=" + age +"; path=/";
+  if (val == undefined) return;
+  section = section == null ? "_" : "_" + section + "_";
+  var age = 2 * 365 * 24 * 60 * 60; // set max-age to 2 years
+  var cookieValue = cookie_namespace + section + cookie + "=" + val +
+                    "; max-age=" + age + "; path=/";
   document.cookie = cookieValue;
 }
 
 /* #########     END COOKIES!     ########## */
 
-
-var sticky = false;
-var stickyTop;
-var prevScrollLeft = 0; // used to compare current position to previous position of horiz scroll
-/* Sets the vertical scoll position at which the sticky bar should appear.
-   This method is called to reset the position when search results appear or hide */
-function setStickyTop() {
-  stickyTop = $('#header-wrapper').outerHeight() - $('#header > .dac-header-inner').outerHeight();
-}
-
-/*
- * Displays sticky nav bar on pages when dac header scrolls out of view
- */
-$(window).scroll(function(event) {
-  // Exit if the mouse target is a DIV, because that means the event is coming
-  // from a scrollable div and so there's no need to make adjustments to our layout
-  if ($(event.target).nodeName == "DIV") {
-    return;
-  }
-
-  checkSticky();
-});
-
-function checkSticky() {
-  setStickyTop();
-  var $headerEl = $('#header');
-  // Exit if there's no sidenav
-  if ($('#side-nav').length == 0) return;
-
-  var top = $(window).scrollTop();
-  // we set the navbar fixed when the scroll position is beyond the height of the site header...
-  var shouldBeSticky = top > stickyTop;
-  // ... except if the document content is shorter than the sidenav height.
-  // (this is necessary to avoid crazy behavior on OSX Lion due to overscroll bouncing)
-  if ($("#doc-col").height() < $("#side-nav").height()) {
-    shouldBeSticky = false;
-  }
-  // Nor on mobile
-  if (window.innerWidth < 720) {
-    shouldBeSticky = false;
-  }
-  // Account for horizontal scroll
-  var scrollLeft = $(window).scrollLeft();
-  // When the sidenav is fixed and user scrolls horizontally, reposition the sidenav to match
-  if (sticky && (scrollLeft != prevScrollLeft)) {
-    updateSideNavDimensions();
-    prevScrollLeft = scrollLeft;
-  }
-
-  // Don't continue if the header is sufficently far away
-  // (to avoid intensive resizing that slows scrolling)
-  if (sticky == shouldBeSticky) {
-    return;
-  }
-
-  // If sticky header visible and position is now near top, hide sticky
-  if (sticky && !shouldBeSticky) {
-    sticky = false;
-    // make the sidenav static again
-    $('#devdoc-nav')
-      .removeClass('fixed')
-      .css({'width':'auto','margin':''});
-    // delay hide the sticky
-    $headerEl.removeClass('is-sticky');
-
-    // update the sidenaav position for side scrolling
-    updateSideNavDimensions();
-  } else if (!sticky && shouldBeSticky) {
-    sticky = true;
-    $headerEl.addClass('is-sticky');
-
-    // make the sidenav fixed
-    $('#devdoc-nav')
-      .addClass('fixed');
-
-    // update the sidenaav position for side scrolling
-    updateSideNavDimensions();
-
-  }
-  resizeNav(250); // pass true in order to delay the scrollbar re-initialization for performance
-}
-
 /*
  * Manages secion card states and nav resize to conclude loading
  */
@@ -1130,7 +418,7 @@ function checkSticky() {
     // Stack hover states
     $('.section-card-menu').each(function(index, el) {
       var height = $(el).height();
-      $(el).css({height:height+'px', position:'relative'});
+      $(el).css({height:height + 'px', position:'relative'});
       var $cardInfo = $(el).find('.card-info');
 
       $cardInfo.css({position: 'absolute', bottom:'0px', left:'0px', right:'0px', overflow:'visible'});
@@ -1140,25 +428,8 @@ function checkSticky() {
 
 })();
 
-
-
-
-
-
-
-
-
-
-
-
-
-
 /*      MISC LIBRARY FUNCTIONS     */
 
-
-
-
-
 function toggle(obj, slide) {
   var ul = $("ul:first", obj);
   var li = ul.parent();
@@ -1179,7 +450,6 @@ function toggle(obj, slide) {
   }
 }
 
-
 function buildToggleLists() {
   $(".toggle-list").each(
     function(i) {
@@ -1188,12 +458,10 @@ function buildToggleLists() {
     });
 }
 
-
-
 function hideNestedItems(list, toggle) {
   $list = $(list);
   // hide nested lists
-  if($list.hasClass('showing')) {
+  if ($list.hasClass('showing')) {
     $("li ol", $list).hide('fast');
     $list.removeClass('showing');
   // show nested lists
@@ -1201,223 +469,59 @@ function hideNestedItems(list, toggle) {
     $("li ol", $list).show('fast');
     $list.addClass('showing');
   }
-  $(".more,.less",$(toggle)).toggle();
+  $(".more,.less", $(toggle)).toggle();
 }
 
-
 /* Call this to add listeners to a <select> element for Studio/Eclipse/Other docs */
 function setupIdeDocToggle() {
-  $( "select.ide" ).change(function() {
+  $("select.ide").change(function() {
     var selected = $(this).find("option:selected").attr("value");
     $(".select-ide").hide();
-    $(".select-ide."+selected).show();
+    $(".select-ide." + selected).show();
 
     $("select.ide").val(selected);
   });
 }
 
+/* Used to hide and reveal supplemental content, such as long code samples.
+   See the companion CSS in android-developer-docs.css */
+function toggleContent(obj) {
+  var div = $(obj).closest(".toggle-content");
+  var toggleMe = $(".toggle-content-toggleme:eq(0)", div);
+  if (div.hasClass("closed")) { // if it's closed, open it
+    toggleMe.slideDown();
+    $(".toggle-content-text:eq(0)", obj).toggle();
+    div.removeClass("closed").addClass("open");
+    $(".toggle-content-img:eq(0)", div).attr("title", "hide").attr("src", toRoot +
+                  "assets/images/triangle-opened.png");
+  } else { // if it's open, close it
+    toggleMe.slideUp('fast', function() {  // Wait until the animation is done before closing arrow
+      $(".toggle-content-text:eq(0)", obj).toggle();
+      div.removeClass("open").addClass("closed");
+      div.find(".toggle-content").removeClass("open").addClass("closed")
+              .find(".toggle-content-toggleme").hide();
+      $(".toggle-content-img", div).attr("title", "show").attr("src", toRoot +
+                  "assets/images/triangle-closed.png");
+    });
+  }
+  return false;
+}
 
+/* New version of expandable content */
+function toggleExpandable(link, id) {
+  if ($(id).is(':visible')) {
+    $(id).slideUp();
+    $(link).removeClass('expanded');
+  } else {
+    $(id).slideDown();
+    $(link).addClass('expanded');
+  }
+}
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/*      REFERENCE NAV SWAP     */
-
-
-function getNavPref() {
-  var v = readCookie('reference_nav');
-  if (v != NAV_PREF_TREE) {
-    v = NAV_PREF_PANELS;
-  }
-  return v;
-}
-
-function chooseDefaultNav() {
-  nav_pref = getNavPref();
-  if (nav_pref == NAV_PREF_TREE) {
-    $("#nav-panels").toggle();
-    $("#panel-link").toggle();
-    $("#nav-tree").toggle();
-    $("#tree-link").toggle();
-  }
-}
-
-function swapNav() {
-  if (nav_pref == NAV_PREF_TREE) {
-    nav_pref = NAV_PREF_PANELS;
-  } else {
-    nav_pref = NAV_PREF_TREE;
-    init_default_navtree(toRoot);
-  }
-  writeCookie("nav", nav_pref, "reference");
-
-  $("#nav-panels").toggle();
-  $("#panel-link").toggle();
-  $("#nav-tree").toggle();
-  $("#tree-link").toggle();
-
-  resizeNav();
-
-  // Gross nasty hack to make tree view show up upon first swap by setting height manually
-  $("#nav-tree .jspContainer:visible")
-      .css({'height':$("#nav-tree .jspContainer .jspPane").height() +'px'});
-  // Another nasty hack to make the scrollbar appear now that we have height
-  resizeNav();
-
-  if ($("#nav-tree").is(':visible')) {
-    scrollIntoView("nav-tree");
-  } else {
-    scrollIntoView("packages-nav");
-    scrollIntoView("classes-nav");
-  }
-}
-
-
-
-/* ############################################ */
-/* ##########     LOCALIZATION     ############ */
-/* ############################################ */
-
-function getBaseUri(uri) {
-  var intlUrl = (uri.substring(0,6) == "/intl/");
-  if (intlUrl) {
-    base = uri.substring(uri.indexOf('intl/')+5,uri.length);
-    base = base.substring(base.indexOf('/')+1, base.length);
-      //alert("intl, returning base url: /" + base);
-    return ("/" + base);
-  } else {
-      //alert("not intl, returning uri as found.");
-    return uri;
-  }
-}
-
-function requestAppendHL(uri) {
-//append "?hl=<lang> to an outgoing request (such as to blog)
-  var lang = getLangPref();
-  if (lang) {
-    var q = 'hl=' + lang;
-    uri += '?' + q;
-    window.location = uri;
-    return false;
-  } else {
-    return true;
-  }
-}
-
-
-function changeNavLang(lang) {
-  if (lang === 'en') { return; }
-
-  var $links = $("a[" + lang + "-lang],p[" + lang + "-lang]");
-  $links.each(function(){ // for each link with a translation
-    var $link = $(this);
-    // put the desired language from the attribute as the text
-    $link.text($link.attr(lang + '-lang'))
-  });
-}
-
-function changeLangPref(lang, submit) {
-  writeCookie("pref_lang", lang, null);
-
-  //  #######  TODO:  Remove this condition once we're stable on devsite #######
-  //  This condition is only needed if we still need to support legacy GAE server
-  if (devsite) {
-    // Switch language when on Devsite server
-    if (submit) {
-      $("#setlang").submit();
-    }
-  } else {
-    // Switch language when on legacy GAE server
-    if (submit) {
-      window.location = getBaseUri(location.pathname);
-    }
-  }
-}
-
-function loadLangPref() {
-  var lang = readCookie("pref_lang");
-  if (lang != 0) {
-    $("#language").find("option[value='"+lang+"']").attr("selected",true);
-  }
-}
-
-function getLangPref() {
-  var lang = $("#language").find(":selected").attr("value");
-  if (!lang) {
-    lang = readCookie("pref_lang");
-  }
-  return (lang != 0) ? lang : 'en';
-}
-
-/* ##########     END LOCALIZATION     ############ */
-
-
-
-
-
-
-/* Used to hide and reveal supplemental content, such as long code samples.
-   See the companion CSS in android-developer-docs.css */
-function toggleContent(obj) {
-  var div = $(obj).closest(".toggle-content");
-  var toggleMe = $(".toggle-content-toggleme:eq(0)",div);
-  if (div.hasClass("closed")) { // if it's closed, open it
-    toggleMe.slideDown();
-    $(".toggle-content-text:eq(0)", obj).toggle();
-    div.removeClass("closed").addClass("open");
-    $(".toggle-content-img:eq(0)", div).attr("title", "hide").attr("src", toRoot
-                  + "assets/images/triangle-opened.png");
-  } else { // if it's open, close it
-    toggleMe.slideUp('fast', function() {  // Wait until the animation is done before closing arrow
-      $(".toggle-content-text:eq(0)", obj).toggle();
-      div.removeClass("open").addClass("closed");
-      div.find(".toggle-content").removeClass("open").addClass("closed")
-              .find(".toggle-content-toggleme").hide();
-      $(".toggle-content-img", div).attr("title", "show").attr("src", toRoot
-                  + "assets/images/triangle-closed.png");
-    });
-  }
-  return false;
-}
-
-
-/* New version of expandable content */
-function toggleExpandable(link,id) {
-  if($(id).is(':visible')) {
-    $(id).slideUp();
-    $(link).removeClass('expanded');
-  } else {
-    $(id).slideDown();
-    $(link).addClass('expanded');
-  }
-}
-
-function hideExpandable(ids) {
-  $(ids).slideUp();
-  $(ids).prev('h4').find('a.expandable').removeClass('expanded');
-}
-
-
-
-
+function hideExpandable(ids) {
+  $(ids).slideUp();
+  $(ids).prev('h4').find('a.expandable').removeClass('expanded');
+}
 
 /*
  *  Slideshow 1.0
@@ -1458,169 +562,164 @@ function hideExpandable(ids) {
  *
  */
 
- (function($) {
- $.fn.dacSlideshow = function(o) {
-
-     //Options - see above
-     o = $.extend({
-         btnPrev:   null,
-         btnNext:   null,
-         btnPause:  null,
-         auto:      true,
-         speed:     500,
-         autoTime:  12000,
-         easing:    null,
-         start:     0,
-         scroll:    1,
-         pagination: true
-
-     }, o || {});
-
-     //Set up a carousel for each
-     return this.each(function() {
-
-         var running = false;
-         var animCss = o.vertical ? "top" : "left";
-         var sizeCss = o.vertical ? "height" : "width";
-         var div = $(this);
-         var ul = $("ul", div);
-         var tLi = $("li", ul);
-         var tl = tLi.size();
-         var timer = null;
-
-         var li = $("li", ul);
-         var itemLength = li.size();
-         var curr = o.start;
-
-         li.css({float: o.vertical ? "none" : "left"});
-         ul.css({margin: "0", padding: "0", position: "relative", "list-style-type": "none", "z-index": "1"});
-         div.css({position: "relative", "z-index": "2", left: "0px"});
-
-         var liSize = o.vertical ? height(li) : width(li);
-         var ulSize = liSize * itemLength;
-         var divSize = liSize;
-
-         li.css({width: li.width(), height: li.height()});
-         ul.css(sizeCss, ulSize+"px").css(animCss, -(curr*liSize));
-
-         div.css(sizeCss, divSize+"px");
-
-         //Pagination
-         if (o.pagination) {
-             var pagination = $("<div class='pagination'></div>");
-             var pag_ul = $("<ul></ul>");
-             if (tl > 1) {
-               for (var i=0;i<tl;i++) {
-                    var li = $("<li>"+i+"</li>");
-                    pag_ul.append(li);
-                    if (i==o.start) li.addClass('active');
-                        li.click(function() {
-                        go(parseInt($(this).text()));
-                    })
-                }
-                pagination.append(pag_ul);
-                div.append(pagination);
-             }
-         }
-
-         //Previous button
-         if(o.btnPrev)
+(function($) {
 $.fn.dacSlideshow = function(o) {
+
+    //Options - see above
+    o = $.extend({
+      btnPrev:   null,
+      btnNext:   null,
+      btnPause:  null,
+      auto:      true,
+      speed:     500,
+      autoTime:  12000,
+      easing:    null,
+      start:     0,
+      scroll:    1,
+      pagination: true
+
+    }, o || {});
+
+    //Set up a carousel for each
+    return this.each(function() {
+
+      var running = false;
+      var animCss = o.vertical ? "top" : "left";
+      var sizeCss = o.vertical ? "height" : "width";
+      var div = $(this);
+      var ul = $("ul", div);
+      var tLi = $("li", ul);
+      var tl = tLi.size();
+      var timer = null;
+
+      var li = $("li", ul);
+      var itemLength = li.size();
+      var curr = o.start;
+
+      li.css({float: o.vertical ? "none" : "left"});
+      ul.css({margin: "0", padding: "0", position: "relative", "list-style-type": "none", "z-index": "1"});
+      div.css({position: "relative", "z-index": "2", left: "0px"});
+
+      var liSize = o.vertical ? height(li) : width(li);
+      var ulSize = liSize * itemLength;
+      var divSize = liSize;
+
+      li.css({width: li.width(), height: li.height()});
+      ul.css(sizeCss, ulSize + "px").css(animCss, -(curr * liSize));
+
+      div.css(sizeCss, divSize + "px");
+
+      //Pagination
+      if (o.pagination) {
+        var pagination = $("<div class='pagination'></div>");
+        var pag_ul = $("<ul></ul>");
+        if (tl > 1) {
+          for (var i = 0; i < tl; i++) {
+            var li = $("<li>" + i + "</li>");
+            pag_ul.append(li);
+            if (i == o.start) li.addClass('active');
+            li.click(function() {
+              go(parseInt($(this).text()));
+            })
+          }
+          pagination.append(pag_ul);
+          div.append(pagination);
+        }
+      }
+
+      //Previous button
+      if (o.btnPrev)
              $(o.btnPrev).click(function(e) {
-                 e.preventDefault();
-                 return go(curr-o.scroll);
+               e.preventDefault();
+               return go(curr - o.scroll);
              });
 
-         //Next button
-         if(o.btnNext)
+      //Next button
+      if (o.btnNext)
              $(o.btnNext).click(function(e) {
-                 e.preventDefault();
-                 return go(curr+o.scroll);
+               e.preventDefault();
+               return go(curr + o.scroll);
              });
 
-         //Pause button
-         if(o.btnPause)
+      //Pause button
+      if (o.btnPause)
              $(o.btnPause).click(function(e) {
-                 e.preventDefault();
-                 if ($(this).hasClass('paused')) {
-                     startRotateTimer();
-                 } else {
-                     pauseRotateTimer();
-                 }
+               e.preventDefault();
+               if ($(this).hasClass('paused')) {
+                 startRotateTimer();
+               } else {
+                 pauseRotateTimer();
+               }
              });
 
-         //Auto rotation
-         if(o.auto) startRotateTimer();
-
-         function startRotateTimer() {
-             clearInterval(timer);
-             timer = setInterval(function() {
-                  if (curr == tl-1) {
-                    go(0);
-                  } else {
-                    go(curr+o.scroll);
-                  }
-              }, o.autoTime);
-             $(o.btnPause).removeClass('paused');
-         }
-
-         function pauseRotateTimer() {
-             clearInterval(timer);
-             $(o.btnPause).addClass('paused');
-         }
-
-         //Go to an item
-         function go(to) {
-             if(!running) {
-
-                 if(to<0) {
-                    to = itemLength-1;
-                 } else if (to>itemLength-1) {
-                    to = 0;
-                 }
-                 curr = to;
-
-                 running = true;
-
-                 ul.animate(
-                     animCss == "left" ? { left: -(curr*liSize) } : { top: -(curr*liSize) } , o.speed, o.easing,
-                     function() {
-                         running = false;
-                     }
-                 );
+      //Auto rotation
+      if (o.auto) startRotateTimer();
+
+      function startRotateTimer() {
+        clearInterval(timer);
+        timer = setInterval(function() {
+          if (curr == tl - 1) {
+            go(0);
+          } else {
+            go(curr + o.scroll);
+          }
+        }, o.autoTime);
+        $(o.btnPause).removeClass('paused');
+      }
+
+      function pauseRotateTimer() {
+        clearInterval(timer);
+        $(o.btnPause).addClass('paused');
+      }
 
-                 $(o.btnPrev + "," + o.btnNext).removeClass("disabled");
-                 $( (curr-o.scroll<0 && o.btnPrev)
-                     ||
-                    (curr+o.scroll > itemLength && o.btnNext)
-                     ||
-                    []
-                  ).addClass("disabled");
+      //Go to an item
+      function go(to) {
+        if (!running) {
 
+          if (to < 0) {
+            to = itemLength - 1;
+          } else if (to > itemLength - 1) {
+            to = 0;
+          }
+          curr = to;
+
+          running = true;
 
-                 var nav_items = $('li', pagination);
-                 nav_items.removeClass('active');
-                 nav_items.eq(to).addClass('active');
+          ul.animate(
+              animCss == "left" ? {left: -(curr * liSize)} : {top: -(curr * liSize)} , o.speed, o.easing,
+                     function() {
+                       running = false;
+                     }
+                 );
 
+          $(o.btnPrev + "," + o.btnNext).removeClass("disabled");
+          $((curr - o.scroll < 0 && o.btnPrev)              ||
+             (curr + o.scroll > itemLength && o.btnNext)              ||
+             []
+           ).addClass("disabled");
 
-             }
-             if(o.auto) startRotateTimer();
-             return false;
-         };
-     });
- };
+          var nav_items = $('li', pagination);
+          nav_items.removeClass('active');
+          nav_items.eq(to).addClass('active');
 
- function css(el, prop) {
-     return parseInt($.css(el[0], prop)) || 0;
- };
- function width(el) {
-     return  el[0].offsetWidth + css(el, 'marginLeft') + css(el, 'marginRight');
- };
- function height(el) {
-     return el[0].offsetHeight + css(el, 'marginTop') + css(el, 'marginBottom');
- };
+        }
+        if (o.auto) startRotateTimer();
+        return false;
+      };
+    });
+  };
 
- })(jQuery);
+  function css(el, prop) {
+    return parseInt($.css(el[0], prop)) || 0;
+  };
+  function width(el) {
+    return el[0].offsetWidth + css(el, 'marginLeft') + css(el, 'marginRight');
+  };
+  function height(el) {
+    return el[0].offsetHeight + css(el, 'marginTop') + css(el, 'marginBottom');
+  };
 
+})(jQuery);
 
 /*
  *  dacSlideshow 1.0
@@ -1659,2271 +758,4133 @@ function hideExpandable(ids) {
  *  pagination: whether or not to include dotted pagination
  *
  */
- (function($) {
- $.fn.dacTabbedList = function(o) {
-
-     //Options - see above
-     o = $.extend({
-         speed : 250,
-         easing: null,
-         nav_id: null,
-         frame_id: null
-     }, o || {});
-
-     //Set up a carousel for each
-     return this.each(function() {
-
-         var curr = 0;
-         var running = false;
-         var animCss = "margin-left";
-         var sizeCss = "width";
-         var div = $(this);
-
-         var nav = $(o.nav_id, div);
-         var nav_li = $("li", nav);
-         var nav_size = nav_li.size();
-         var frame = div.find(o.frame_id);
-         var content_width = $(frame).find('ul').width();
-         //Buttons
-         $(nav_li).click(function(e) {
+(function($) {
 $.fn.dacTabbedList = function(o) {
+
+    //Options - see above
+    o = $.extend({
+      speed : 250,
+      easing: null,
+      nav_id: null,
+      frame_id: null
+    }, o || {});
+
+    //Set up a carousel for each
+    return this.each(function() {
+
+      var curr = 0;
+      var running = false;
+      var animCss = "margin-left";
+      var sizeCss = "width";
+      var div = $(this);
+
+      var nav = $(o.nav_id, div);
+      var nav_li = $("li", nav);
+      var nav_size = nav_li.size();
+      var frame = div.find(o.frame_id);
+      var content_width = $(frame).find('ul').width();
+      //Buttons
+      $(nav_li).click(function(e) {
            go($(nav_li).index($(this)));
          })
 
-         //Go to an item
-         function go(to) {
-             if(!running) {
-                 curr = to;
-                 running = true;
+      //Go to an item
+      function go(to) {
+        if (!running) {
+          curr = to;
+          running = true;
 
-                 frame.animate({ 'margin-left' : -(curr*content_width) }, o.speed, o.easing,
+          frame.animate({'margin-left' : -(curr * content_width)}, o.speed, o.easing,
                      function() {
-                         running = false;
+                       running = false;
                      }
                  );
 
+          nav_li.removeClass('active');
+          nav_li.eq(to).addClass('active');
 
-                 nav_li.removeClass('active');
-                 nav_li.eq(to).addClass('active');
-
-
-             }
-             return false;
-         };
-     });
- };
-
- function css(el, prop) {
-     return parseInt($.css(el[0], prop)) || 0;
- };
- function width(el) {
-     return  el[0].offsetWidth + css(el, 'marginLeft') + css(el, 'marginRight');
- };
- function height(el) {
-     return el[0].offsetHeight + css(el, 'marginTop') + css(el, 'marginBottom');
- };
-
- })(jQuery);
-
-
+        }
+        return false;
+      };
+    });
+  };
 
+  function css(el, prop) {
+    return parseInt($.css(el[0], prop)) || 0;
+  };
+  function width(el) {
+    return el[0].offsetWidth + css(el, 'marginLeft') + css(el, 'marginRight');
+  };
+  function height(el) {
+    return el[0].offsetHeight + css(el, 'marginTop') + css(el, 'marginBottom');
+  };
 
+})(jQuery);
 
 /* ######################################################## */
-/* ################  SEARCH SUGGESTIONS  ################## */
+/* #################  JAVADOC REFERENCE ################### */
 /* ######################################################## */
 
+/* Initialize some droiddoc stuff, but only if we're in the reference */
+if (location.pathname.indexOf("/reference") == 0) {
+  if (!(location.pathname.indexOf("/reference-gms/packages.html") == 0) &&
+    !(location.pathname.indexOf("/reference-gcm/packages.html") == 0) &&
+    !(location.pathname.indexOf("/reference/com/google") == 0)) {
+    $(document).ready(function() {
+      // init available apis based on user pref
+      changeApiLevel();
+    });
+  }
+}
 
+var API_LEVEL_COOKIE = "api_level";
+var minLevel = 1;
+var maxLevel = 1;
 
-var gSelectedIndex = -1;  // the index position of currently highlighted suggestion
-var gSelectedColumn = -1;  // which column of suggestion lists is currently focused
-
-var gMatches = new Array();
-var gLastText = "";
-var gInitialized = false;
-var ROW_COUNT_FRAMEWORK = 20;       // max number of results in list
-var gListLength = 0;
-
-
-var gGoogleMatches = new Array();
-var ROW_COUNT_GOOGLE = 15;          // max number of results in list
-var gGoogleListLength = 0;
-
-var gDocsMatches = new Array();
-var ROW_COUNT_DOCS = 100;          // max number of results in list
-var gDocsListLength = 0;
+function buildApiLevelSelector() {
+  maxLevel = SINCE_DATA.length;
+  var userApiLevel = parseInt(readCookie(API_LEVEL_COOKIE));
+  userApiLevel = userApiLevel == 0 ? maxLevel : userApiLevel; // If there's no cookie (zero), use the max by default
 
-function onSuggestionClick(link) {
-  // When user clicks a suggested document, track it
-  ga('send', 'event', 'Suggestion Click', 'clicked: ' + $(link).attr('href'),
-                'query: ' + $("#search_autocomplete").val().toLowerCase());
-}
+  minLevel = parseInt($("#doc-api-level").attr("class"));
+  // Handle provisional api levels; the provisional level will always be the highest possible level
+  // Provisional api levels will also have a length; other stuff that's just missing a level won't,
+  // so leave those kinds of entities at the default level of 1 (for example, the R.styleable class)
+  if (isNaN(minLevel) && minLevel.length) {
+    minLevel = maxLevel;
+  }
+  var select = $("#apiLevelSelector").html("").change(changeApiLevel);
+  for (var i = maxLevel - 1; i >= 0; i--) {
+    var option = $("<option />").attr("value", "" + SINCE_DATA[i]).append("" + SINCE_DATA[i]);
+    //  if (SINCE_DATA[i] < minLevel) option.addClass("absent"); // always false for strings (codenames)
+    select.append(option);
+  }
 
-function set_item_selected($li, selected)
-{
-    if (selected) {
-        $li.attr('class','jd-autocomplete jd-selected');
-    } else {
-        $li.attr('class','jd-autocomplete');
-    }
+  // get the DOM element and use setAttribute cuz IE6 fails when using jquery .attr('selected',true)
+  var selectedLevelItem = $("#apiLevelSelector option[value='" + userApiLevel + "']").get(0);
+  selectedLevelItem.setAttribute('selected', true);
 }
 
-function set_item_values(toroot, $li, match)
-{
-    var $link = $('a',$li);
-    $link.html(match.__hilabel || match.label);
-    $link.attr('href',toroot + match.link);
-}
+function changeApiLevel() {
+  maxLevel = SINCE_DATA.length;
+  var selectedLevel = maxLevel;
 
-function set_item_values_jd(toroot, $li, match)
-{
-    var $link = $('a',$li);
-    $link.html(match.title);
-    $link.attr('href',toroot + match.url);
-}
+  selectedLevel = parseInt($("#apiLevelSelector option:selected").val());
+  toggleVisisbleApis(selectedLevel, "body");
 
-function new_suggestion($list) {
-    var $li = $("<li class='jd-autocomplete'></li>");
-    $list.append($li);
+  writeCookie(API_LEVEL_COOKIE, selectedLevel, null);
 
-    $li.mousedown(function() {
-        window.location = this.firstChild.getAttribute("href");
-    });
-    $li.mouseover(function() {
-        $('.search_filtered_wrapper li').removeClass('jd-selected');
-        $(this).addClass('jd-selected');
-        gSelectedColumn = $(".search_filtered:visible").index($(this).closest('.search_filtered'));
-        gSelectedIndex = $("li", $(".search_filtered:visible")[gSelectedColumn]).index(this);
-    });
-    $li.append("<a onclick='onSuggestionClick(this)'></a>");
-    $li.attr('class','show-item');
-    return $li;
+  if (selectedLevel < minLevel) {
+    var thing = ($("#jd-header").html().indexOf("package") != -1) ? "package" : "class";
+    $("#naMessage").show().html("<div><p><strong>This " + thing +
+              " requires API level " + minLevel + " or higher.</strong></p>" +
+              "<p>This document is hidden because your selected API level for the documentation is " +
+              selectedLevel + ". You can change the documentation API level with the selector " +
+              "above the left navigation.</p>" +
+              "<p>For more information about specifying the API level your app requires, " +
+              "read <a href='" + toRoot + "training/basics/supporting-devices/platforms.html'" +
+              ">Supporting Different Platform Versions</a>.</p>" +
+              "<input type='button' value='OK, make this page visible' " +
+              "title='Change the API level to " + minLevel + "' " +
+              "onclick='$(\"#apiLevelSelector\").val(\"" + minLevel + "\");changeApiLevel();' />" +
+              "</div>");
+  } else {
+    $("#naMessage").hide();
+  }
 }
 
-function sync_selection_table(toroot)
-{
-    var $li; //list item jquery object
-    var i; //list item iterator
+function toggleVisisbleApis(selectedLevel, context) {
+  var apis = $(".api", context);
+  apis.each(function(i) {
+    var obj = $(this);
+    var className = obj.attr("class");
+    var apiLevelIndex = className.lastIndexOf("-") + 1;
+    var apiLevelEndIndex = className.indexOf(" ", apiLevelIndex);
+    apiLevelEndIndex = apiLevelEndIndex != -1 ? apiLevelEndIndex : className.length;
+    var apiLevel = className.substring(apiLevelIndex, apiLevelEndIndex);
+    if (apiLevel.length == 0) { // for odd cases when the since data is actually missing, just bail
+      return;
+    }
+    apiLevel = parseInt(apiLevel);
 
-    // if there are NO results at all, hide all columns
-    if (!(gMatches.length > 0) && !(gGoogleMatches.length > 0) && !(gDocsMatches.length > 0)) {
-        $('.suggest-card').hide(300);
-        return;
+    // Handle provisional api levels; if this item's level is the provisional one, set it to the max
+    var selectedLevelNum = parseInt(selectedLevel)
+    var apiLevelNum = parseInt(apiLevel);
+    if (isNaN(apiLevelNum)) {
+      apiLevelNum = maxLevel;
     }
 
-    // if there are api results
-    if ((gMatches.length > 0) || (gGoogleMatches.length > 0)) {
-      // reveal suggestion list
-      $('.suggest-card.reference').show();
-      var listIndex = 0; // list index position
+    // Grey things out that aren't available and give a tooltip title
+    if (apiLevelNum > selectedLevelNum) {
+      obj.addClass("absent").attr("title", "Requires API Level \"" +
+            apiLevel + "\" or higher. To reveal, change the target API level " +
+              "above the left navigation.");
+    } else obj.removeClass("absent").removeAttr("title");
+  });
+}
 
-      // reset the lists
-      $(".suggest-card.reference li").remove();
+/* #################  SIDENAV TREE VIEW ################### */
+/* TODO: eliminate redundancy with non-google functions */
+function init_google_navtree(navtree_id, toroot, root_nodes) {
+  var me = new Object();
+  me.toroot = toroot;
+  me.node = new Object();
 
-      // ########### ANDROID RESULTS #############
-      if (gMatches.length > 0) {
+  me.node.li = document.getElementById(navtree_id);
+  if (!me.node.li) {
+    return;
+  }
 
-          // determine android results to show
-          gListLength = gMatches.length < ROW_COUNT_FRAMEWORK ?
-                        gMatches.length : ROW_COUNT_FRAMEWORK;
-          for (i=0; i<gListLength; i++) {
-              var $li = new_suggestion($(".suggest-card.reference ul"));
-              set_item_values(toroot, $li, gMatches[i]);
-              set_item_selected($li, i == gSelectedIndex);
-          }
-      }
+  me.node.children_data = root_nodes;
+  me.node.children = new Array();
+  me.node.children_ul = document.createElement("ul");
+  me.node.get_children_ul = function() { return me.node.children_ul; };
+  //me.node.children_ul.className = "children_ul";
+  me.node.li.appendChild(me.node.children_ul);
+  me.node.depth = 0;
 
-      // ########### GOOGLE RESULTS #############
-      if (gGoogleMatches.length > 0) {
-          // show header for list
-          $(".suggest-card.reference ul").append("<li class='header'>in Google Services:</li>");
-
-          // determine google results to show
-          gGoogleListLength = gGoogleMatches.length < ROW_COUNT_GOOGLE ? gGoogleMatches.length : ROW_COUNT_GOOGLE;
-          for (i=0; i<gGoogleListLength; i++) {
-              var $li = new_suggestion($(".suggest-card.reference ul"));
-              set_item_values(toroot, $li, gGoogleMatches[i]);
-              set_item_selected($li, i == gSelectedIndex);
-          }
+  get_google_node(me, me.node);
+}
+
+function new_google_node(me, mom, text, link, children_data, api_level) {
+  var node = new Object();
+  var child;
+  node.children = Array();
+  node.children_data = children_data;
+  node.depth = mom.depth + 1;
+  node.get_children_ul = function() {
+      if (!node.children_ul) {
+        node.children_ul = document.createElement("ul");
+        node.children_ul.className = "tree-list-children";
+        node.li.appendChild(node.children_ul);
+      }
+      return node.children_ul;
+    };
+  node.li = document.createElement("li");
+
+  mom.get_children_ul().appendChild(node.li);
+
+  if (link) {
+    child = document.createElement("a");
+
+  } else {
+    child = document.createElement("span");
+    child.className = "tree-list-subtitle";
+
+  }
+  if (children_data != null) {
+    node.li.className = "nav-section";
+    node.label_div = document.createElement("div");
+    node.label_div.className = "nav-section-header-ref";
+    node.li.appendChild(node.label_div);
+    get_google_node(me, node);
+    node.label_div.appendChild(child);
+  } else {
+    node.li.appendChild(child);
+  }
+  if (link) {
+    child.href = me.toroot + link;
+  }
+  node.label = document.createTextNode(text);
+  child.appendChild(node.label);
+
+  node.children_ul = null;
+
+  return node;
+}
+
+function get_google_node(me, mom) {
+  mom.children_visited = true;
+  var linkText;
+  for (var i in mom.children_data) {
+    var node_data = mom.children_data[i];
+    linkText = node_data[0];
+
+    if (linkText.match("^" + "com.google.android") == "com.google.android") {
+      linkText = linkText.substr(19, linkText.length);
+    }
+    mom.children[i] = new_google_node(me, mom, linkText, node_data[1],
+        node_data[2], node_data[3]);
+  }
+}
+
+/****** NEW version of script to build google and sample navs dynamically ******/
+// TODO: update Google reference docs to tolerate this new implementation
+
+var NODE_NAME = 0;
+var NODE_HREF = 1;
+var NODE_GROUP = 2;
+var NODE_TAGS = 3;
+var NODE_CHILDREN = 4;
+
+function init_google_navtree2(navtree_id, data) {
+  var $containerUl = $("#" + navtree_id);
+  for (var i in data) {
+    var node_data = data[i];
+    $containerUl.append(new_google_node2(node_data));
+  }
+
+  // Make all third-generation list items 'sticky' to prevent them from collapsing
+  $containerUl.find('li li li.nav-section').addClass('sticky');
+
+  initExpandableNavItems("#" + navtree_id);
+}
+
+function new_google_node2(node_data) {
+  var linkText = node_data[NODE_NAME];
+  if (linkText.match("^" + "com.google.android") == "com.google.android") {
+    linkText = linkText.substr(19, linkText.length);
+  }
+  var $li = $('<li>');
+  var $a;
+  if (node_data[NODE_HREF] != null) {
+    $a = $('<a href="' + toRoot + node_data[NODE_HREF] + '" title="' + linkText + '" >' +
+        linkText + '</a>');
+  } else {
+    $a = $('<a href="#" onclick="return false;" title="' + linkText + '" >' +
+        linkText + '/</a>');
+  }
+  var $childUl = $('<ul>');
+  if (node_data[NODE_CHILDREN] != null) {
+    $li.addClass("nav-section");
+    $a = $('<div class="nav-section-header">').append($a);
+    if (node_data[NODE_HREF] == null) $a.addClass('empty');
+
+    for (var i in node_data[NODE_CHILDREN]) {
+      var child_node_data = node_data[NODE_CHILDREN][i];
+      $childUl.append(new_google_node2(child_node_data));
+    }
+    $li.append($childUl);
+  }
+  $li.prepend($a);
+
+  return $li;
+}
+
+function showGoogleRefTree() {
+  init_default_google_navtree(toRoot);
+  init_default_gcm_navtree(toRoot);
+}
+
+function init_default_google_navtree(toroot) {
+  // load json file for navtree data
+  $.getScript(toRoot + 'gms_navtree_data.js', function(data, textStatus, jqxhr) {
+    // when the file is loaded, initialize the tree
+    if (jqxhr.status === 200) {
+      init_google_navtree("gms-tree-list", toroot, GMS_NAVTREE_DATA);
+      highlightSidenav();
+    }
+  });
+}
+
+function init_default_gcm_navtree(toroot) {
+  // load json file for navtree data
+  $.getScript(toRoot + 'gcm_navtree_data.js', function(data, textStatus, jqxhr) {
+    // when the file is loaded, initialize the tree
+    if (jqxhr.status === 200) {
+      init_google_navtree("gcm-tree-list", toroot, GCM_NAVTREE_DATA);
+      highlightSidenav();
+    }
+  });
+}
+
+/* TOGGLE INHERITED MEMBERS */
+
+/* Toggle an inherited class (arrow toggle)
+ * @param linkObj  The link that was clicked.
+ * @param expand  'true' to ensure it's expanded. 'false' to ensure it's closed.
+ *                'null' to simply toggle.
+ */
+function toggleInherited(linkObj, expand) {
+  var base = linkObj.getAttribute("id");
+  var list = document.getElementById(base + "-list");
+  var summary = document.getElementById(base + "-summary");
+  var trigger = document.getElementById(base + "-trigger");
+  var a = $(linkObj);
+  if ((expand == null && a.hasClass("closed")) || expand) {
+    list.style.display = "none";
+    summary.style.display = "block";
+    trigger.src = toRoot + "assets/images/triangle-opened.png";
+    a.removeClass("closed");
+    a.addClass("opened");
+  } else if ((expand == null && a.hasClass("opened")) || (expand == false)) {
+    list.style.display = "block";
+    summary.style.display = "none";
+    trigger.src = toRoot + "assets/images/triangle-closed.png";
+    a.removeClass("opened");
+    a.addClass("closed");
+  }
+  return false;
+}
+
+/* Toggle all inherited classes in a single table (e.g. all inherited methods)
+ * @param linkObj  The link that was clicked.
+ * @param expand  'true' to ensure it's expanded. 'false' to ensure it's closed.
+ *                'null' to simply toggle.
+ */
+function toggleAllInherited(linkObj, expand) {
+  var a = $(linkObj);
+  var table = $(a.parent().parent().parent()); // ugly way to get table/tbody
+  var expandos = $(".jd-expando-trigger", table);
+  if ((expand == null && a.text() == "[Expand]") || expand) {
+    expandos.each(function(i) {
+      toggleInherited(this, true);
+    });
+    a.text("[Collapse]");
+  } else if ((expand == null && a.text() == "[Collapse]") || (expand == false)) {
+    expandos.each(function(i) {
+      toggleInherited(this, false);
+    });
+    a.text("[Expand]");
+  }
+  return false;
+}
+
+/* Toggle all inherited members in the class (link in the class title)
+ */
+function toggleAllClassInherited() {
+  var a = $("#toggleAllClassInherited"); // get toggle link from class title
+  var toggles = $(".toggle-all", $("#body-content"));
+  if (a.text() == "[Expand All]") {
+    toggles.each(function(i) {
+      toggleAllInherited(this, true);
+    });
+    a.text("[Collapse All]");
+  } else {
+    toggles.each(function(i) {
+      toggleAllInherited(this, false);
+    });
+    a.text("[Expand All]");
+  }
+  return false;
+}
+
+/* Expand all inherited members in the class. Used when initiating page search */
+function ensureAllInheritedExpanded() {
+  var toggles = $(".toggle-all", $("#body-content"));
+  toggles.each(function(i) {
+    toggleAllInherited(this, true);
+  });
+  $("#toggleAllClassInherited").text("[Collapse All]");
+}
+
+/* HANDLE KEY EVENTS
+ * - Listen for Ctrl+F (Cmd on Mac) and expand all inherited members (to aid page search)
+ */
+var agent = navigator['userAgent'].toLowerCase();
+var mac = agent.indexOf("macintosh") != -1;
+
+$(document).keydown(function(e) {
+  var control = mac ? e.metaKey && !e.ctrlKey : e.ctrlKey; // get ctrl key
+  if (control && e.which == 70) {  // 70 is "F"
+    ensureAllInheritedExpanded();
+  }
+});
+
+/* On-demand functions */
+
+/** Move sample code line numbers out of PRE block and into non-copyable column */
+function initCodeLineNumbers() {
+  var numbers = $("#codesample-block a.number");
+  if (numbers.length) {
+    $("#codesample-line-numbers").removeClass("hidden").append(numbers);
+  }
+
+  $(document).ready(function() {
+    // select entire line when clicked
+    $("span.code-line").click(function() {
+      if (!shifted) {
+        selectText(this);
+      }
+    });
+    // invoke line link on double click
+    $(".code-line").dblclick(function() {
+      document.location.hash = $(this).attr('id');
+    });
+    // highlight the line when hovering on the number
+    $("#codesample-line-numbers a.number").mouseover(function() {
+      var id = $(this).attr('href');
+      $(id).css('background', '#e7e7e7');
+    });
+    $("#codesample-line-numbers a.number").mouseout(function() {
+      var id = $(this).attr('href');
+      $(id).css('background', 'none');
+    });
+  });
+}
+
+// create SHIFT key binder to avoid the selectText method when selecting multiple lines
+var shifted = false;
+$(document).bind('keyup keydown', function(e) {
+  shifted = e.shiftKey; return true;
+});
+
+// courtesy of jasonedelman.com
+function selectText(element) {
+  var doc = document      ,
+        range, selection
+  ;
+  if (doc.body.createTextRange) { //ms
+    range = doc.body.createTextRange();
+    range.moveToElementText(element);
+    range.select();
+  } else if (window.getSelection) { //all others
+    selection = window.getSelection();
+    range = doc.createRange();
+    range.selectNodeContents(element);
+    selection.removeAllRanges();
+    selection.addRange(range);
+  }
+}
+
+/** Display links and other information about samples that match the
+    group specified by the URL */
+function showSamples() {
+  var group = $("#samples").attr('class');
+  $("#samples").html("<p>Here are some samples for <b>" + group + "</b> apps:</p>");
+
+  var $ul = $("<ul>");
+  $selectedLi = $("#nav li.selected");
+
+  $selectedLi.children("ul").children("li").each(function() {
+    var $li = $("<li>").append($(this).find("a").first().clone());
+    $ul.append($li);
+  });
+
+  $("#samples").append($ul);
+
+}
+
+/* ########################################################## */
+/* ###################  RESOURCE CARDS  ##################### */
+/* ########################################################## */
+
+/** Handle resource queries, collections, and grids (sections). Requires
+    jd_tag_helpers.js and the *_unified_data.js to be loaded. */
+
+(function() {
+  $(document).ready(function() {
+    // Need to initialize hero carousel before other sections for dedupe
+    // to work correctly.
+    $('[data-carousel-query]').dacCarouselQuery();
+
+    // Iterate over all instances and initialize a resource widget.
+    $('.resource-widget').resourceWidget();
+  });
+
+  $.fn.widgetOptions = function() {
+    return {
+      cardSizes: (this.data('cardsizes') || '').split(','),
+      maxResults: parseInt(this.data('maxresults'), 10) || Infinity,
+      initialResults: this.data('initialResults'),
+      itemsPerPage: this.data('itemsPerPage'),
+      sortOrder: this.data('sortorder'),
+      query: this.data('query'),
+      section: this.data('section'),
+      /* Added by LFL 6/6/14 */
+      resourceStyle: this.data('resourcestyle') || 'card',
+      stackSort: this.data('stacksort') || 'true',
+      // For filter based resources
+      allowDuplicates: this.data('allow-duplicates') || 'false'
+    };
+  };
+
+  $.fn.deprecateOldGridStyles = function() {
+    var m = this.get(0).className.match(/\bcol-(\d+)\b/);
+    if (m && !this.is('.cols > *')) {
+      this.removeClass('col-' + m[1]);
+    }
+    return this;
+  }
+
+  /*
+   * Three types of resource layouts:
+   * Flow - Uses a fixed row-height flow using float left style.
+   * Carousel - Single card slideshow all same dimension absolute.
+   * Stack - Uses fixed columns and flexible element height.
+   */
+  function initResourceWidget(widget, resources, opts) {
+    var $widget = $(widget).deprecateOldGridStyles();
+    var isFlow = $widget.hasClass('resource-flow-layout');
+    var isCarousel = $widget.hasClass('resource-carousel-layout');
+    var isStack = $widget.hasClass('resource-stack-layout');
+
+    opts = opts || $widget.widgetOptions();
+    resources = resources || metadata.query(opts);
+
+    if (opts.maxResults !== undefined) {
+      resources = resources.slice(0, opts.maxResults);
+    }
+
+    if (isFlow) {
+      drawResourcesFlowWidget($widget, opts, resources);
+    } else if (isCarousel) {
+      drawResourcesCarouselWidget($widget, opts, resources);
+    } else if (isStack) {
+      opts.numStacks = $widget.data('numstacks');
+      drawResourcesStackWidget($widget, opts, resources);
+    }
+  }
+
+  $.fn.resourceWidget = function(resources, options) {
+    return this.each(function() {
+      initResourceWidget(this, resources, options);
+    });
+  };
+
+  /* Initializes a Resource Carousel Widget */
+  function drawResourcesCarouselWidget($widget, opts, resources) {
+    $widget.empty();
+    var plusone = false; // stop showing plusone buttons on cards
+
+    $widget.addClass('resource-card slideshow-container')
+      .append($('<a>').addClass('slideshow-prev').text('Prev'))
+      .append($('<a>').addClass('slideshow-next').text('Next'));
+
+    var css = {'width': $widget.width() + 'px',
+                'height': $widget.height() + 'px'};
+
+    var $ul = $('<ul>');
+
+    for (var i = 0; i < resources.length; ++i) {
+      var $card = $('<a>')
+        .attr('href', cleanUrl(resources[i].url))
+        .decorateResourceCard(resources[i], plusone);
+
+      $('<li>').css(css)
+          .append($card)
+          .appendTo($ul);
+    }
+
+    $('<div>').addClass('frame')
+      .append($ul)
+      .appendTo($widget);
+
+    $widget.dacSlideshow({
+      auto: true,
+      btnPrev: '.slideshow-prev',
+      btnNext: '.slideshow-next'
+    });
+  }
+
+  /* Initializes a Resource Card Stack Widget (column-based layout)
+     Modified by LFL 6/6/14
+   */
+  function drawResourcesStackWidget($widget, opts, resources, sections) {
+    // Don't empty widget, grab all items inside since they will be the first
+    // items stacked, followed by the resource query
+    var plusone = false; // stop showing plusone buttons on cards
+    var cards = $widget.find('.resource-card').detach().toArray();
+    var numStacks = opts.numStacks || 1;
+    var $stacks = [];
+
+    for (var i = 0; i < numStacks; ++i) {
+      $stacks[i] = $('<div>').addClass('resource-card-stack')
+          .appendTo($widget);
+    }
+
+    var sectionResources = [];
+
+    // Extract any subsections that are actually resource cards
+    if (sections) {
+      for (i = 0; i < sections.length; ++i) {
+        if (!sections[i].sections || !sections[i].sections.length) {
+          // Render it as a resource card
+          sectionResources.push(
+            $('<a>')
+              .addClass('resource-card section-card')
+              .attr('href', cleanUrl(sections[i].resource.url))
+              .decorateResourceCard(sections[i].resource, plusone)[0]
+          );
+
+        } else {
+          cards.push(
+            $('<div>')
+              .addClass('resource-card section-card-menu')
+              .decorateResourceSection(sections[i], plusone)[0]
+          );
+        }
+      }
+    }
+
+    cards = cards.concat(sectionResources);
+
+    for (i = 0; i < resources.length; ++i) {
+      var $card = createResourceElement(resources[i], opts);
+
+      if (opts.resourceStyle.indexOf('related') > -1) {
+        $card.addClass('related-card');
+      }
+
+      cards.push($card[0]);
+    }
+
+    if (opts.stackSort !== 'false') {
+      for (i = 0; i < cards.length; ++i) {
+        // Find the stack with the shortest height, but give preference to
+        // left to right order.
+        var minHeight = $stacks[0].height();
+        var minIndex = 0;
+
+        for (var j = 1; j < numStacks; ++j) {
+          var height = $stacks[j].height();
+          if (height < minHeight - 45) {
+            minHeight = height;
+            minIndex = j;
+          }
+        }
+
+        $stacks[minIndex].append($(cards[i]));
+      }
+    }
+  }
+
+  /*
+    Create a resource card using the given resource object and a list of html
+     configured options. Returns a jquery object containing the element.
+  */
+  function createResourceElement(resource, opts, plusone) {
+    var $el;
+
+    // The difference here is that generic cards are not entirely clickable
+    // so its a div instead of an a tag, also the generic one is not given
+    // the resource-card class so it appears with a transparent background
+    // and can be styled in whatever way the css setup.
+    if (opts.resourceStyle === 'generic') {
+      $el = $('<div>')
+        .addClass('resource')
+        .attr('href', cleanUrl(resource.url))
+        .decorateResource(resource, opts);
+    } else {
+      var cls = 'resource resource-card';
+
+      $el = $('<a>')
+        .addClass(cls)
+        .attr('href', cleanUrl(resource.url))
+        .decorateResourceCard(resource, plusone);
+    }
+
+    return $el;
+  }
+
+  function createResponsiveFlowColumn(cardSize) {
+    var cardWidth = parseInt(cardSize.match(/(\d+)/)[1], 10);
+    var column = $('<div>').addClass('col-' + (cardWidth / 3) + 'of6');
+    if (cardWidth < 9) {
+      column.addClass('col-tablet-1of2');
+    } else if (cardWidth > 9 && cardWidth < 18) {
+      column.addClass('col-tablet-1of1');
+    }
+    if (cardWidth < 18) {
+      column.addClass('col-mobile-1of1');
+    }
+    return column;
+  }
+
+  /* Initializes a flow widget, see distribute.scss for generating accompanying css */
+  function drawResourcesFlowWidget($widget, opts, resources) {
+    // We'll be doing our own modifications to opts.
+    opts = $.extend({}, opts);
+
+    $widget.empty().addClass('cols');
+    if (opts.itemsPerPage) {
+      $('<div class="col-1of1 dac-section-links dac-text-center">')
+        .append(
+          $('<div class="dac-section-link dac-show-less" data-toggle="show-less">Less<i class="dac-sprite dac-auto-unfold-less"></i></div>'),
+          $('<div class="dac-section-link dac-show-more" data-toggle="show-more">More<i class="dac-sprite dac-auto-unfold-more"></i></div>')
+        )
+        .appendTo($widget);
+    }
+
+    $widget.data('options.resourceflow', opts);
+    $widget.data('resources.resourceflow', resources);
+
+    drawResourceFlowPage($widget, opts, resources);
+  }
+
+  function drawResourceFlowPage($widget, opts, resources) {
+    var cardSizes = opts.cardSizes || ['6x6']; // 2015-08-09: dynamic card sizes are deprecated
+    var i = opts.currentIndex || 0;
+    var j = 0;
+    var plusone = false; // stop showing plusone buttons on cards
+    var firstPage = i === 0;
+    var initialResults = opts.initialResults || opts.itemsPerPage || resources.length;
+    var max = firstPage ? initialResults : i + opts.itemsPerPage;
+    max = Math.min(resources.length, max);
+
+    var page = $('<div class="resource-flow-page">');
+    if (opts.itemsPerPage) {
+      $widget.find('.dac-section-links').before(page);
+    } else {
+      $widget.append(page);
+    }
+
+    while (i < max) {
+      var cardSize = cardSizes[j++ % cardSizes.length];
+      cardSize = cardSize.replace(/^\s+|\s+$/, '');
+
+      var column = createResponsiveFlowColumn(cardSize).appendTo(page);
+
+      // A stack has a third dimension which is the number of stacked items
+      var isStack = cardSize.match(/(\d+)x(\d+)x(\d+)/);
+      var stackCount = 0;
+      var $stackDiv = null;
+
+      if (isStack) {
+        // Create a stack container which should have the dimensions defined
+        // by the product of the items inside.
+        $stackDiv = $('<div>').addClass('resource-card-stack resource-card-' + isStack[1] +
+          'x' + isStack[2] * isStack[3]) .appendTo(column);
+      }
+
+      // Build each stack item or just a single item
+      do {
+        var resource = resources[i];
+
+        var $card = createResourceElement(resources[i], opts, plusone);
+
+        $card.addClass('resource-card-' + cardSize +
+          ' resource-card-' + resource.type.toLowerCase());
+
+        if (isStack) {
+          $card.addClass('resource-card-' + isStack[1] + 'x' + isStack[2]);
+          if (++stackCount === parseInt(isStack[3])) {
+            $card.addClass('resource-card-row-stack-last');
+            stackCount = 0;
+          }
+        } else {
+          stackCount = 0;
+        }
+
+        $card.appendTo($stackDiv || column);
+
+      } while (++i < max && stackCount > 0);
+
+      // Record number of pages viewed in analytics.
+      if (!firstPage) {
+        var clicks = Math.ceil((i - initialResults) / opts.itemsPerPage);
+        ga('send', 'event', 'Cards', 'Click More', clicks);
+      }
+    }
+
+    opts.currentIndex = i;
+    $widget.toggleClass('dac-has-more', i < resources.length);
+    $widget.toggleClass('dac-has-less', !firstPage);
+
+    $widget.trigger('dac:domchange');
+    if (opts.onRenderPage) {
+      opts.onRenderPage(page);
+    }
+  }
+
+  function drawResourceFlowReset($widget, opts, resources) {
+    $widget.find('.resource-flow-page')
+        .slice(1)
+        .remove();
+    $widget.toggleClass('dac-has-more', true);
+    $widget.toggleClass('dac-has-less', false);
+
+    opts.currentIndex = Math.min(opts.initialResults, resources.length);
+
+    ga('send', 'event', 'Cards', 'Click Less');
+  }
+
+  /* A decorator for event functions which finds the surrounding widget and it's options */
+  function wrapWithWidget(func) {
+    return function(e) {
+      if (e) e.preventDefault();
+
+      var $widget = $(this).closest('.resource-flow-layout');
+      var opts = $widget.data('options.resourceflow');
+      var resources = $widget.data('resources.resourceflow');
+      func($widget, opts, resources);
+    };
+  }
+
+  /* Build a site map of resources using a section as a root. */
+  function buildSectionList(opts) {
+    if (opts.section && SECTION_BY_ID[opts.section]) {
+      return SECTION_BY_ID[opts.section].sections || [];
+    }
+    return [];
+  }
+
+  function cleanUrl(url) {
+    if (url && url.indexOf('//') === -1) {
+      url = toRoot + url;
+    }
+
+    return url;
+  }
+
+  // Delegated events for resources.
+  $(document).on('click', '.resource-flow-layout [data-toggle="show-more"]', wrapWithWidget(drawResourceFlowPage));
+  $(document).on('click', '.resource-flow-layout [data-toggle="show-less"]', wrapWithWidget(drawResourceFlowReset));
+})();
+
+(function($) {
+  // A mapping from category and type values to new values or human presentable strings.
+  var SECTION_MAP = {
+    googleplay: 'google play'
+  };
+
+  /*
+    Utility method for creating dom for the description area of a card.
+    Used in decorateResourceCard and decorateResource.
+  */
+  function buildResourceCardDescription(resource, plusone) {
+    var $description = $('<div>').addClass('description ellipsis');
+
+    $description.append($('<div>').addClass('text').html(resource.summary));
+
+    if (resource.cta) {
+      $description.append($('<a>').addClass('cta').html(resource.cta));
+    }
+
+    if (plusone) {
+      var plusurl = resource.url.indexOf("//") > -1 ? resource.url :
+        "//developer.android.com/" + resource.url;
+
+      $description.append($('<div>').addClass('util')
+        .append($('<div>').addClass('g-plusone')
+          .attr('data-size', 'small')
+          .attr('data-align', 'right')
+          .attr('data-href', plusurl)));
+    }
+
+    return $description;
+  }
+
+  /* Simple jquery function to create dom for a standard resource card */
+  $.fn.decorateResourceCard = function(resource, plusone) {
+    var section = resource.category || resource.type;
+    section = (SECTION_MAP[section] || section).toLowerCase();
+    var imgUrl = resource.image ||
+      'assets/images/resource-card-default-android.jpg';
+
+    if (imgUrl.indexOf('//') === -1) {
+      imgUrl = toRoot + imgUrl;
+    }
+
+    if (resource.type === 'youtube' || resource.type === 'video') {
+      $('<div>').addClass('play-button')
+        .append($('<i class="dac-sprite dac-play-white">'))
+        .appendTo(this);
+    }
+
+    $('<div>').addClass('card-bg')
+      .css('background-image', 'url(' + (imgUrl || toRoot +
+        'assets/images/resource-card-default-android.jpg') + ')')
+      .appendTo(this);
+
+    $('<div>').addClass('card-info' + (!resource.summary ? ' empty-desc' : ''))
+      .append($('<div>').addClass('section').text(section))
+      .append($('<div>').addClass('title' + (resource.title_highlighted ? ' highlighted' : ''))
+        .html(resource.title_highlighted || resource.title))
+      .append(buildResourceCardDescription(resource, plusone))
+      .appendTo(this);
+
+    return this;
+  };
+
+  /* Simple jquery function to create dom for a resource section card (menu) */
+  $.fn.decorateResourceSection = function(section, plusone) {
+    var resource = section.resource;
+    //keep url clean for matching and offline mode handling
+    var urlPrefix = resource.image.indexOf("//") > -1 ? "" : toRoot;
+    var $base = $('<a>')
+        .addClass('card-bg')
+        .attr('href', resource.url)
+        .append($('<div>').addClass('card-section-icon')
+          .append($('<div>').addClass('icon'))
+          .append($('<div>').addClass('section').html(resource.title)))
+      .appendTo(this);
+
+    var $cardInfo = $('<div>').addClass('card-info').appendTo(this);
+
+    if (section.sections && section.sections.length) {
+      // Recurse the section sub-tree to find a resource image.
+      var stack = [section];
+
+      while (stack.length) {
+        if (stack[0].resource.image) {
+          $base.css('background-image', 'url(' + urlPrefix + stack[0].resource.image + ')');
+          break;
+        }
+
+        if (stack[0].sections) {
+          stack = stack.concat(stack[0].sections);
+        }
+
+        stack.shift();
+      }
+
+      var $ul = $('<ul>')
+        .appendTo($cardInfo);
+
+      var max = section.sections.length > 3 ? 3 : section.sections.length;
+
+      for (var i = 0; i < max; ++i) {
+
+        var subResource = section.sections[i];
+        if (!plusone) {
+          $('<li>')
+            .append($('<a>').attr('href', subResource.url)
+              .append($('<div>').addClass('title').html(subResource.title))
+              .append($('<div>').addClass('description ellipsis')
+                .append($('<div>').addClass('text').html(subResource.summary))
+                .append($('<div>').addClass('util'))))
+          .appendTo($ul);
+        } else {
+          $('<li>')
+            .append($('<a>').attr('href', subResource.url)
+              .append($('<div>').addClass('title').html(subResource.title))
+              .append($('<div>').addClass('description ellipsis')
+                .append($('<div>').addClass('text').html(subResource.summary))
+                .append($('<div>').addClass('util')
+                  .append($('<div>').addClass('g-plusone')
+                    .attr('data-size', 'small')
+                    .attr('data-align', 'right')
+                    .attr('data-href', resource.url)))))
+          .appendTo($ul);
+        }
+      }
+
+      // Add a more row
+      if (max < section.sections.length) {
+        $('<li>')
+          .append($('<a>').attr('href', resource.url)
+            .append($('<div>')
+              .addClass('title')
+              .text('More')))
+        .appendTo($ul);
       }
     } else {
-      $('.suggest-card.reference').hide();
-    }
-
-    // ########### JD DOC RESULTS #############
-    if (gDocsMatches.length > 0) {
-        // reset the lists
-        $(".suggest-card:not(.reference) li").remove();
-
-        // determine google results to show
-        // NOTE: The order of the conditions below for the sugg.type MUST BE SPECIFIC:
-        // The order must match the reverse order that each section appears as a card in
-        // the suggestion UI... this may be only for the "develop" grouped items though.
-        gDocsListLength = gDocsMatches.length < ROW_COUNT_DOCS ? gDocsMatches.length : ROW_COUNT_DOCS;
-        for (i=0; i<gDocsListLength; i++) {
-            var sugg = gDocsMatches[i];
-            var $li;
-            if (sugg.type == "design") {
-                $li = new_suggestion($(".suggest-card.design ul"));
-            } else
-            if (sugg.type == "distribute") {
-                $li = new_suggestion($(".suggest-card.distribute ul"));
-            } else
-            if (sugg.type == "samples") {
-                $li = new_suggestion($(".suggest-card.develop .child-card.samples"));
-            } else
-            if (sugg.type == "training") {
-                $li = new_suggestion($(".suggest-card.develop .child-card.training"));
-            } else
-            if (sugg.type == "about"||"guide"||"tools"||"google") {
-                $li = new_suggestion($(".suggest-card.develop .child-card.guides"));
-            } else {
-              continue;
-            }
+      // No sub-resources, just render description?
+    }
+
+    return this;
+  };
+
+  /* Render other types of resource styles that are not cards. */
+  $.fn.decorateResource = function(resource, opts) {
+    var imgUrl = resource.image ||
+      'assets/images/resource-card-default-android.jpg';
+    var linkUrl = resource.url;
+
+    if (imgUrl.indexOf('//') === -1) {
+      imgUrl = toRoot + imgUrl;
+    }
+
+    if (linkUrl && linkUrl.indexOf('//') === -1) {
+      linkUrl = toRoot + linkUrl;
+    }
+
+    $(this).append(
+      $('<div>').addClass('image')
+        .css('background-image', 'url(' + imgUrl + ')'),
+      $('<div>').addClass('info').append(
+        $('<h4>').addClass('title').html(resource.title_highlighted || resource.title),
+        $('<p>').addClass('summary').html(resource.summary),
+        $('<a>').attr('href', linkUrl).addClass('cta').html('Learn More')
+      )
+    );
+
+    return this;
+  };
+})(jQuery);
+
+/*
+  Fullscreen Carousel
+
+  The following allows for an area at the top of the page that takes over the
+  entire browser height except for its top offset and an optional bottom
+  padding specified as a data attribute.
+
+  HTML:
+
+  <div class="fullscreen-carousel">
+    <div class="fullscreen-carousel-content">
+      <!-- content here -->
+    </div>
+    <div class="fullscreen-carousel-content">
+      <!-- content here -->
+    </div>
+
+    etc ...
+
+  </div>
+
+  Control over how the carousel takes over the screen can mostly be defined in
+  a css file. Setting min-height on the .fullscreen-carousel-content elements
+  will prevent them from shrinking to far vertically when the browser is very
+  short, and setting max-height on the .fullscreen-carousel itself will prevent
+  the area from becoming to long in the case that the browser is stretched very
+  tall.
+
+  There is limited functionality for having multiple sections since that request
+  was removed, but it is possible to add .next-arrow and .prev-arrow elements to
+  scroll between multiple content areas.
+*/
+
+(function() {
+  $(document).ready(function() {
+    $('.fullscreen-carousel').each(function() {
+      initWidget(this);
+    });
+  });
+
+  function initWidget(widget) {
+    var $widget = $(widget);
+
+    var topOffset = $widget.offset().top;
+    var padBottom = parseInt($widget.data('paddingbottom')) || 0;
+    var maxHeight = 0;
+    var minHeight = 0;
+    var $content = $widget.find('.fullscreen-carousel-content');
+    var $nextArrow = $widget.find('.next-arrow');
+    var $prevArrow = $widget.find('.prev-arrow');
+    var $curSection = $($content[0]);
+
+    if ($content.length <= 1) {
+      $nextArrow.hide();
+      $prevArrow.hide();
+    } else {
+      $nextArrow.click(function() {
+        var index = ($content.index($curSection) + 1);
+        $curSection.hide();
+        $curSection = $($content[index >= $content.length ? 0 : index]);
+        $curSection.show();
+      });
 
-            set_item_values_jd(toroot, $li, sugg);
-            set_item_selected($li, i == gSelectedIndex);
-        }
+      $prevArrow.click(function() {
+        var index = ($content.index($curSection) - 1);
+        $curSection.hide();
+        $curSection = $($content[index < 0 ? $content.length - 1 : 0]);
+        $curSection.show();
+      });
+    }
 
-        // add heading and show or hide card
-        if ($(".suggest-card.design li").length > 0) {
-          $(".suggest-card.design ul").prepend("<li class='header'>Design:</li>");
-          $(".suggest-card.design").show(300);
-        } else {
-          $('.suggest-card.design').hide(300);
-        }
-        if ($(".suggest-card.distribute li").length > 0) {
-          $(".suggest-card.distribute ul").prepend("<li class='header'>Distribute:</li>");
-          $(".suggest-card.distribute").show(300);
-        } else {
-          $('.suggest-card.distribute').hide(300);
-        }
-        if ($(".child-card.guides li").length > 0) {
-          $(".child-card.guides").prepend("<li class='header'>Guides:</li>");
-          $(".child-card.guides li").appendTo(".suggest-card.develop ul");
-        }
-        if ($(".child-card.training li").length > 0) {
-          $(".child-card.training").prepend("<li class='header'>Training:</li>");
-          $(".child-card.training li").appendTo(".suggest-card.develop ul");
-        }
-        if ($(".child-card.samples li").length > 0) {
-          $(".child-card.samples").prepend("<li class='header'>Samples:</li>");
-          $(".child-card.samples li").appendTo(".suggest-card.develop ul");
-        }
+    // Just hide all content sections except first.
+    $content.each(function(index) {
+      if ($(this).height() > minHeight) minHeight = $(this).height();
+      $(this).css({position: 'absolute',  display: index > 0 ? 'none' : ''});
+    });
 
-        if ($(".suggest-card.develop li").length > 0) {
-          $(".suggest-card.develop").show(300);
-        } else {
-          $('.suggest-card.develop').hide(300);
-        }
+    // Register for changes to window size, and trigger.
+    $(window).resize(resizeWidget);
+    resizeWidget();
 
-    } else {
-      $('.suggest-card:not(.reference)').hide(300);
+    function resizeWidget() {
+      var height = $(window).height() - topOffset - padBottom;
+      $widget.width($(window).width());
+      $widget.height(height < minHeight ? minHeight :
+        (maxHeight && height > maxHeight ? maxHeight : height));
     }
-}
+  }
+})();
 
-/** Called by the search input's onkeydown and onkeyup events.
-  * Handles navigation with keyboard arrows, Enter key to invoke search,
-  * otherwise invokes search suggestions on key-up event.
-  * @param e       The JS event
-  * @param kd      True if the event is key-down
-  * @param toroot  A string for the site's root path
-  * @returns       True if the event should bubble up
-  */
-function search_changed(e, kd, toroot)
-{
-    var currentLang = getLangPref();
-    var search = document.getElementById("search_autocomplete");
-    var text = search.value.replace(/(^ +)|( +$)/g, '');
-    // get the ul hosting the currently selected item
-    gSelectedColumn = gSelectedColumn >= 0 ? gSelectedColumn :  0;
-    var $columns = $(".search_filtered_wrapper").find(".search_filtered:visible");
-    var $selectedUl = $columns[gSelectedColumn];
-
-    // show/hide the close button
-    if (text != '') {
-        $("#search-close").removeClass("hide");
+/*
+  Tab Carousel
+
+  The following allows tab widgets to be installed via the html below. Each
+  tab content section should have a data-tab attribute matching one of the
+  nav items'. Also each tab content section should have a width matching the
+  tab carousel.
+
+  HTML:
+
+  <div class="tab-carousel">
+    <ul class="tab-nav">
+      <li><a href="#" data-tab="handsets">Handsets</a>
+      <li><a href="#" data-tab="wearable">Wearable</a>
+      <li><a href="#" data-tab="tv">TV</a>
+    </ul>
+
+    <div class="tab-carousel-content">
+      <div data-tab="handsets">
+        <!--Full width content here-->
+      </div>
+
+      <div data-tab="wearable">
+        <!--Full width content here-->
+      </div>
+
+      <div data-tab="tv">
+        <!--Full width content here-->
+      </div>
+    </div>
+  </div>
+
+*/
+(function() {
+  $(document).ready(function() {
+    $('.tab-carousel').each(function() {
+      initWidget(this);
+    });
+  });
+
+  function initWidget(widget) {
+    var $widget = $(widget);
+    var $nav = $widget.find('.tab-nav');
+    var $anchors = $nav.find('[data-tab]');
+    var $li = $nav.find('li');
+    var $contentContainer = $widget.find('.tab-carousel-content');
+    var $tabs = $contentContainer.find('[data-tab]');
+    var $curTab = $($tabs[0]); // Current tab is first tab.
+    var width = $widget.width();
+
+    // Setup nav interactivity.
+    $anchors.click(function(evt) {
+      evt.preventDefault();
+      var query = '[data-tab=' + $(this).data('tab') + ']';
+      transitionWidget($tabs.filter(query));
+    });
+
+    // Add highlight for navigation on first item.
+    var $highlight = $('<div>').addClass('highlight')
+      .css({left:$li.position().left + 'px', width:$li.outerWidth() + 'px'})
+      .appendTo($nav);
+
+    // Store height since we will change contents to absolute.
+    $contentContainer.height($contentContainer.height());
+
+    // Absolutely position tabs so they're ready for transition.
+    $tabs.each(function(index) {
+      $(this).css({position: 'absolute', left: index > 0 ? width + 'px' : '0'});
+    });
+
+    function transitionWidget($toTab) {
+      if (!$curTab.is($toTab)) {
+        var curIndex = $tabs.index($curTab[0]);
+        var toIndex = $tabs.index($toTab[0]);
+        var dir = toIndex > curIndex ? 1 : -1;
+
+        // Animate content sections.
+        $toTab.css({left:(width * dir) + 'px'});
+        $curTab.animate({left:(width * -dir) + 'px'});
+        $toTab.animate({left:'0'});
+
+        // Animate navigation highlight.
+        $highlight.animate({left:$($li[toIndex]).position().left + 'px',
+          width:$($li[toIndex]).outerWidth() + 'px'})
+
+        // Store new current section.
+        $curTab = $toTab;
+      }
+    }
+  }
+})();
+
+/**
+ * Auto TOC
+ *
+ * Upgrades h2s on the page to have a rule and be toggle-able on mobile.
+ */
+(function($) {
+  var upgraded = false;
+  var h2Titles;
+
+  function initWidget() {
+    // add HRs below all H2s (except for a few other h2 variants)
+    // Consider doing this with css instead.
+    h2Titles = $('h2').not('#qv h2, #tb h2, .sidebox h2, #devdoc-nav h2, h2.norule');
+    h2Titles.css({paddingBottom:0}).after('<hr/>');
+
+    // Exit early if on older browser.
+    if (!window.matchMedia) {
+      return;
+    }
+
+    // Only run logic in mobile layout.
+    var query = window.matchMedia('(max-width: 719px)');
+    if (query.matches) {
+      makeTogglable();
     } else {
-        $("#search-close").addClass("hide");
-    }
-    // 27 = esc
-    if (e.keyCode == 27) {
-        // close all search results
-        if (kd) $('#search-close').trigger('click');
-        return true;
-    }
-    // 13 = enter
-    else if (e.keyCode == 13) {
-        if (gSelectedIndex < 0) {
-            $('.suggest-card').hide();
-            if ($("#searchResults").is(":hidden") && (search.value != "")) {
-              // if results aren't showing (and text not empty), return true to allow search to execute
-              $('body,html').animate({scrollTop:0}, '500', 'swing');
-              return true;
-            } else {
-              // otherwise, results are already showing, so allow ajax to auto refresh the results
-              // and ignore this Enter press to avoid the reload.
-              return false;
-            }
-        } else if (kd && gSelectedIndex >= 0) {
-            // click the link corresponding to selected item
-            $("a",$("li",$selectedUl)[gSelectedIndex]).get()[0].click();
-            return false;
-        }
+      query.addListener(makeTogglable);
     }
-    // If Google results are showing, return true to allow ajax search to execute
-    else if ($("#searchResults").is(":visible")) {
-        // Also, if search_results is scrolled out of view, scroll to top to make results visible
-        if ((sticky ) && (search.value != "")) {
-          $('body,html').animate({scrollTop:0}, '500', 'swing');
-        }
-        return true;
+  }
+
+  function makeTogglable() {
+    // Only run this logic once.
+    if (upgraded) { return; }
+    upgraded = true;
+
+    // Only make content h2s togglable.
+    var contentTitles = h2Titles.filter('#jd-content *');
+
+    // If there are more than 1
+    if (contentTitles.size() < 2) {
+      return;
     }
-    // 38 UP ARROW
-    else if (kd && (e.keyCode == 38)) {
-        // if the next item is a header, skip it
-        if ($($("li", $selectedUl)[gSelectedIndex-1]).hasClass("header")) {
-            gSelectedIndex--;
-        }
-        if (gSelectedIndex >= 0) {
-            $('li', $selectedUl).removeClass('jd-selected');
-            gSelectedIndex--;
-            $('li:nth-child('+(gSelectedIndex+1)+')', $selectedUl).addClass('jd-selected');
-            // If user reaches top, reset selected column
-            if (gSelectedIndex < 0) {
-              gSelectedColumn = -1;
-            }
-        }
-        return false;
+
+    contentTitles.each(function() {
+      // Find all the relevant nodes.
+      var $title = $(this);
+      var $hr = $title.next();
+      var $contents = allNextUntil($hr[0], 'h2, .next-docs');
+      var $section = $($title)
+        .add($hr)
+        .add($title.prev('a[name]'))
+        .add($contents);
+      var $anchor = $section.first().prev();
+      var anchorMethod = 'after';
+      if ($anchor.length === 0) {
+        $anchor = $title.parent();
+        anchorMethod = 'prepend';
+      }
+
+      // Some h2s are in their own container making it pretty hard to find the end, so skip.
+      if ($contents.length === 0) {
+        return;
+      }
+
+      // Remove from DOM before messing with it. DOM is slow!
+      $section.detach();
+
+      // Add mobile-only expand arrows.
+      $title.prepend('<span class="dac-visible-mobile-inline-block">' +
+          '<i class="dac-toggle-expand dac-sprite dac-expand-more-black"></i>' +
+          '<i class="dac-toggle-collapse dac-sprite dac-expand-less-black"></i>' +
+          '</span>')
+        .attr('data-toggle', 'section');
+
+      // Wrap in magic markup.
+      $section = $section.wrapAll('<div class="dac-toggle dac-mobile">').parent();
+
+      // extra div used for max-height calculation.
+      $contents.wrapAll('<div class="dac-toggle-content dac-expand"><div>');
+
+      // Pre-expand section if requested.
+      if ($title.hasClass('is-expanded')) {
+        $section.addClass('is-expanded');
+      }
+
+      // Pre-expand section if targetted by hash.
+      if (location.hash && $section.find(location.hash).length) {
+        $section.addClass('is-expanded');
+      }
+
+      // Add it back to the dom.
+      $anchor[anchorMethod].call($anchor, $section);
+    });
+  }
+
+  // Similar to $.fn.nextUntil() except we need all nodes, jQuery skips text nodes.
+  function allNextUntil(elem, until) {
+    var matched = [];
+
+    while ((elem = elem.nextSibling) && elem.nodeType !== 9) {
+      if (elem.nodeType === 1 && jQuery(elem).is(until)) {
+        break;
+      }
+      matched.push(elem);
+    }
+    return $(matched);
+  }
+
+  $(function() {
+    initWidget();
+  });
+})(jQuery);
+
+(function($, window) {
+  'use strict';
+
+  // Blogger API info
+  var apiUrl = 'https://www.googleapis.com/blogger/v3';
+  var apiKey = 'AIzaSyCFhbGnjW06dYwvRCU8h_zjdpS4PYYbEe8';
+
+  // Blog IDs can be found in the markup of the blog posts
+  var blogs = {
+    'android-developers': {
+      id: '6755709643044947179',
+      title: 'Android Developers Blog'
+    }
+  };
+  var monthNames = ['January', 'February', 'March', 'April', 'May', 'June',
+      'July', 'August', 'September', 'October', 'November', 'December'];
+
+  var BlogReader = (function() {
+    var reader;
+
+    function BlogReader() {
+      this.doneSetup = false;
     }
-    // 40 DOWN ARROW
-    else if (kd && (e.keyCode == 40)) {
-        // if the next item is a header, skip it
-        if ($($("li", $selectedUl)[gSelectedIndex+1]).hasClass("header")) {
-            gSelectedIndex++;
+
+    /**
+     * Initialize the blog reader and modal.
+     */
+    BlogReader.prototype.setup = function() {
+      $('#jd-content').append(
+          '<div id="blog-reader" data-modal="blog-reader" class="dac-modal dac-has-small-header">' +
+            '<div class="dac-modal-container">' +
+              '<div class="dac-modal-window">' +
+                '<header class="dac-modal-header">' +
+                  '<div class="dac-modal-header-actions">' +
+                    '<a href="" class="dac-modal-header-open" target="_blank">' +
+                      '<i class="dac-sprite dac-open-in-new"></i>' +
+                    '</a>' +
+                    '<button class="dac-modal-header-close" data-modal-toggle>' +
+                    '</button>' +
+                  '</div>' +
+                  '<h2 class="norule dac-modal-header-title"></h2>' +
+                '</header>' +
+                '<div class="dac-modal-content dac-blog-reader">' +
+                  '<time class="dac-blog-reader-date" pubDate></time>' +
+                  '<h3 class="dac-blog-reader-title"></h3>' +
+                  '<div class="dac-blog-reader-text clearfix"></div>' +
+                '</div>' +
+              '</div>' +
+            '</div>' +
+          '</div>');
+
+      this.blogReader = $('#blog-reader').dacModal();
+
+      this.doneSetup = true;
+    };
+
+    BlogReader.prototype.openModal_ = function(blog, post) {
+      var published = new Date(post.published);
+      var formattedDate = monthNames[published.getMonth()] + ' ' + published.getDay() + ' ' + published.getFullYear();
+      this.blogReader.find('.dac-modal-header-open').attr('href', post.url);
+      this.blogReader.find('.dac-modal-header-title').text(blog.title);
+      this.blogReader.find('.dac-blog-reader-title').html(post.title);
+      this.blogReader.find('.dac-blog-reader-date').html(formattedDate);
+      this.blogReader.find('.dac-blog-reader-text').html(post.content);
+      this.blogReader.trigger('modal-open');
+    };
+
+    /**
+     * Show a blog post in a modal
+     * @param  {string} blogName - The name of the Blogspot blog.
+     * @param  {string} postPath - The path to the blog post.
+     * @param  {bool} secondTry - Has it failed once?
+     */
+    BlogReader.prototype.showPost = function(blogName, postPath, secondTry) {
+      var blog = blogs[blogName];
+      var postUrl = 'https://' + blogName + '.blogspot.com' + postPath;
+
+      var url = apiUrl + '/blogs/' + blog.id + '/posts/bypath?path=' + encodeURIComponent(postPath) + '&key=' + apiKey;
+      $.ajax(url, {timeout: 650}).done(this.openModal_.bind(this, blog)).fail(function(error) {
+        // Retry once if we get an error
+        if (error.status === 500 && !secondTry) {
+          this.showPost(blogName, postPath, true);
+        } else {
+          window.location.href = postUrl;
         }
-        if ((gSelectedIndex < $("li", $selectedUl).length-1) ||
-                        ($($("li", $selectedUl)[gSelectedIndex+1]).hasClass("header"))) {
-            $('li', $selectedUl).removeClass('jd-selected');
-            gSelectedIndex++;
-            $('li:nth-child('+(gSelectedIndex+1)+')', $selectedUl).addClass('jd-selected');
+      }.bind(this));
+    };
+
+    return {
+      getReader: function() {
+        if (!reader) {
+          reader = new BlogReader();
         }
-        return false;
+        return reader;
+      }
+    };
+  })();
+
+  var blogReader = BlogReader.getReader();
+
+  function wrapLinkWithReader(e) {
+    var el = $(e.currentTarget);
+    if (el.hasClass('dac-modal-header-open')) {
+      return;
     }
-    // Consider left/right arrow navigation
-    // NOTE: Order of suggest columns are reverse order (index position 0 is on right)
-    else if (kd && $columns.length > 1 && gSelectedColumn >= 0) {
-      // 37 LEFT ARROW
-      // go left only if current column is not left-most column (last column)
-      if (e.keyCode == 37 && gSelectedColumn < $columns.length - 1) {
-        $('li', $selectedUl).removeClass('jd-selected');
-        gSelectedColumn++;
-        $selectedUl = $columns[gSelectedColumn];
-        // keep or reset the selected item to last item as appropriate
-        gSelectedIndex = gSelectedIndex >
-                $("li", $selectedUl).length-1 ?
-                $("li", $selectedUl).length-1 : gSelectedIndex;
-        // if the corresponding item is a header, move down
-        if ($($("li", $selectedUl)[gSelectedIndex]).hasClass("header")) {
-          gSelectedIndex++;
-        }
-        // set item selected
-        $('li:nth-child('+(gSelectedIndex+1)+')', $selectedUl).addClass('jd-selected');
-        return false;
+
+    // Only catch links on blogspot.com
+    var matches = el.attr('href').match(/https?:\/\/([^\.]*).blogspot.com([^$]*)/);
+    if (matches && matches.length === 3) {
+      var blogName = matches[1];
+      var postPath = matches[2];
+
+      // Check if we have information about the blog
+      if (!blogs[blogName]) {
+        return;
       }
-      // 39 RIGHT ARROW
-      // go right only if current column is not the right-most column (first column)
-      else if (e.keyCode == 39 && gSelectedColumn > 0) {
-        $('li', $selectedUl).removeClass('jd-selected');
-        gSelectedColumn--;
-        $selectedUl = $columns[gSelectedColumn];
-        // keep or reset the selected item to last item as appropriate
-        gSelectedIndex = gSelectedIndex >
-                $("li", $selectedUl).length-1 ?
-                $("li", $selectedUl).length-1 : gSelectedIndex;
-        // if the corresponding item is a header, move down
-        if ($($("li", $selectedUl)[gSelectedIndex]).hasClass("header")) {
-          gSelectedIndex++;
-        }
-        // set item selected
-        $('li:nth-child('+(gSelectedIndex+1)+')', $selectedUl).addClass('jd-selected');
-        return false;
+
+      // Setup the first time it's used
+      if (!blogReader.doneSetup) {
+        blogReader.setup();
       }
+
+      e.preventDefault();
+      blogReader.showPost(blogName, postPath);
     }
+  }
 
-    // if key-up event and not arrow down/up/left/right,
-    // read the search query and add suggestions to gMatches
-    else if (!kd && (e.keyCode != 40)
-                 && (e.keyCode != 38)
-                 && (e.keyCode != 37)
-                 && (e.keyCode != 39)) {
-        gSelectedIndex = -1;
-        gMatches = new Array();
-        matchedCount = 0;
-        gGoogleMatches = new Array();
-        matchedCountGoogle = 0;
-        gDocsMatches = new Array();
-        matchedCountDocs = 0;
-
-        // Search for Android matches
-        for (var i=0; i<DATA.length; i++) {
-            var s = DATA[i];
-            if (text.length != 0 &&
-                  s.label.toLowerCase().indexOf(text.toLowerCase()) != -1) {
-                gMatches[matchedCount] = s;
-                matchedCount++;
-            }
-        }
-        rank_autocomplete_api_results(text, gMatches);
-        for (var i=0; i<gMatches.length; i++) {
-            var s = gMatches[i];
-        }
+  $(document).on('click.blog-reader', 'a[href*="blogspot.com/"]', wrapLinkWithReader);
+})(jQuery, window);
 
+(function($) {
+  $.fn.debounce = function(func, wait, immediate) {
+    var timeout;
 
-        // Search for Google matches
-        for (var i=0; i<GOOGLE_DATA.length; i++) {
-            var s = GOOGLE_DATA[i];
-            if (text.length != 0 &&
-                  s.label.toLowerCase().indexOf(text.toLowerCase()) != -1) {
-                gGoogleMatches[matchedCountGoogle] = s;
-                matchedCountGoogle++;
-            }
-        }
-        rank_autocomplete_api_results(text, gGoogleMatches);
-        for (var i=0; i<gGoogleMatches.length; i++) {
-            var s = gGoogleMatches[i];
+    return function() {
+      var context = this;
+      var args = arguments;
+
+      var later = function() {
+        timeout = null;
+        if (!immediate) {
+          func.apply(context, args);
         }
+      };
 
-        highlight_autocomplete_result_labels(text);
+      var callNow = immediate && !timeout;
+      clearTimeout(timeout);
+      timeout = setTimeout(later, wait);
 
+      if (callNow) {
+        func.apply(context, args);
+      }
+    };
+  };
+})(jQuery);
 
+/* Calculate the vertical area remaining */
+(function($) {
+  $.fn.ellipsisfade = function() {
+    // Only fetch line-height of first element to avoid recalculate style.
+    // Will be NaN if no elements match, which is ok.
+    var lineHeight = parseInt(this.css('line-height'), 10);
 
-        // Search for matching JD docs
-        if (text.length >= 2) {
-          // match only the beginning of a word
-          var queryStr = text.toLowerCase();
+    this.each(function() {
+      // get element text
+      var $this = $(this);
+      var remainingHeight = $this.parent().parent().height();
+      $this.parent().siblings().each(function() {
+        var elHeight;
+        if ($(this).is(':visible')) {
+          elHeight = $(this).outerHeight(true);
+          remainingHeight = remainingHeight - elHeight;
+        }
+      });
 
-          // Search for Training classes
-          for (var i=0; i<TRAINING_RESOURCES.length; i++) {
-            // current search comparison, with counters for tag and title,
-            // used later to improve ranking
-            var s = TRAINING_RESOURCES[i];
-            s.matched_tag = 0;
-            s.matched_title = 0;
-            var matched = false;
+      var adjustedRemainingHeight = ((remainingHeight) / lineHeight >> 0) * lineHeight;
+      $this.parent().css({height: adjustedRemainingHeight});
+      $this.css({height: 'auto'});
+    });
 
-            // Check if query matches any tags; work backwards toward 1 to assist ranking
-            for (var j = s.keywords.length - 1; j >= 0; j--) {
-              // it matches a tag
-              if (s.keywords[j].toLowerCase().indexOf(queryStr) == 0) {
-                matched = true;
-                s.matched_tag = j + 1; // add 1 to index position
-              }
-            }
-            // Don't consider doc title for lessons (only for class landing pages),
-            // unless the lesson has a tag that already matches
-            if ((s.lang == currentLang) &&
-                  (!(s.type == "training" && s.url.indexOf("index.html") == -1) || matched)) {
-              // it matches the doc title
-              if (s.title.toLowerCase().indexOf(queryStr) == 0) {
-                matched = true;
-                s.matched_title = 1;
-              }
-            }
-            if (matched) {
-              gDocsMatches[matchedCountDocs] = s;
-              matchedCountDocs++;
-            }
-          }
+    return this;
+  };
 
+  /* Pass the line height to ellipsisfade() to adjust the height of the
+   text container to show the max number of lines possible, without
+   showing lines that are cut off. This works with the css ellipsis
+   classes to fade last text line and apply an ellipsis char. */
+  function updateEllipsis(context) {
+    if (!(context instanceof jQuery)) {
+      context = $('html');
+    }
 
-          // Search for API Guides
-          for (var i=0; i<GUIDE_RESOURCES.length; i++) {
-            // current search comparison, with counters for tag and title,
-            // used later to improve ranking
-            var s = GUIDE_RESOURCES[i];
-            s.matched_tag = 0;
-            s.matched_title = 0;
-            var matched = false;
+    context.find('.card-info .text').ellipsisfade();
+  }
 
-            // Check if query matches any tags; work backwards toward 1 to assist ranking
-            for (var j = s.keywords.length - 1; j >= 0; j--) {
-              // it matches a tag
-              if (s.keywords[j].toLowerCase().indexOf(queryStr) == 0) {
+  $(window).on('resize', $.fn.debounce(updateEllipsis, 500));
+  $(updateEllipsis);
+  $('html').on('dac:domchange', function(e) { updateEllipsis($(e.target)); });
+})(jQuery);
 
-                matched = true;
-                s.matched_tag = j + 1; // add 1 to index position
-              }
-            }
-            // Check if query matches the doc title, but only for current language
-            if (s.lang == currentLang) {
-              // if query matches the doc title
-              if (s.title.toLowerCase().indexOf(queryStr) == 0) {
-                matched = true;
-                s.matched_title = 1;
-              }
-            }
-            if (matched) {
-              gDocsMatches[matchedCountDocs] = s;
-              matchedCountDocs++;
-            }
-          }
+/* Filter */
+(function($) {
+  'use strict';
 
+  /**
+   * A single filter item content.
+   * @type {string} - Element template.
+   * @private
+   */
+  var ITEM_STR_ = '<input type="checkbox" value="{{value}}" class="dac-form-checkbox" id="{{id}}">' +
+      '<label for="{{id}}" class="dac-form-checkbox-button"></label>' +
+      '<label for="{{id}}" class="dac-form-label">{{name}}</label>';
 
-          // Search for Tools Guides
-          for (var i=0; i<TOOLS_RESOURCES.length; i++) {
-            // current search comparison, with counters for tag and title,
-            // used later to improve ranking
-            var s = TOOLS_RESOURCES[i];
-            s.matched_tag = 0;
-            s.matched_title = 0;
-            var matched = false;
-
-            // Check if query matches any tags; work backwards toward 1 to assist ranking
-            for (var j = s.keywords.length - 1; j >= 0; j--) {
-              // it matches a tag
-                if (s.keywords[j].toLowerCase().indexOf(queryStr) == 0) {
-                matched = true;
-                s.matched_tag = j + 1; // add 1 to index position
-              }
-            }
-            // Check if query matches the doc title, but only for current language
-            if (s.lang == currentLang) {
-              // if query matches the doc title
-                if (s.title.toLowerCase().indexOf(queryStr) == 0) {
-                matched = true;
-                s.matched_title = 1;
-              }
-            }
-            if (matched) {
-              gDocsMatches[matchedCountDocs] = s;
-              matchedCountDocs++;
-            }
-          }
+  /**
+   * Template for a chip element.
+   * @type {*|HTMLElement}
+   * @private
+   */
+  var CHIP_BASE_ = $('<li class="dac-filter-chip">' +
+    '<button class="dac-filter-chip-close">' +
+      '<i class="dac-sprite dac-close-black dac-filter-chip-close-icon"></i>' +
+    '</button>' +
+  '</li>');
 
+  /**
+   * Component to handle narrowing down resources.
+   * @param {HTMLElement} el - The DOM element.
+   * @param {Object} options
+   * @constructor
+   */
+  function Filter(el, options) {
+    this.el = $(el);
+    this.options = $.extend({}, Filter.DEFAULTS_, options);
+    this.init();
+  }
 
-          // Search for About docs
-          for (var i=0; i<ABOUT_RESOURCES.length; i++) {
-            // current search comparison, with counters for tag and title,
-            // used later to improve ranking
-            var s = ABOUT_RESOURCES[i];
-            s.matched_tag = 0;
-            s.matched_title = 0;
-            var matched = false;
-
-            // Check if query matches any tags; work backwards toward 1 to assist ranking
-            for (var j = s.keywords.length - 1; j >= 0; j--) {
-              // it matches a tag
-              if (s.keywords[j].toLowerCase().indexOf(queryStr) == 0) {
-                matched = true;
-                s.matched_tag = j + 1; // add 1 to index position
-              }
-            }
-            // Check if query matches the doc title, but only for current language
-            if (s.lang == currentLang) {
-              // if query matches the doc title
-              if (s.title.toLowerCase().indexOf(queryStr) == 0) {
-                matched = true;
-                s.matched_title = 1;
-              }
-            }
-            if (matched) {
-              gDocsMatches[matchedCountDocs] = s;
-              matchedCountDocs++;
-            }
-          }
+  Filter.DEFAULTS_ = {
+    activeClass: 'dac-active',
+    chipsDataAttr: 'filter-chips',
+    nameDataAttr: 'filter-name',
+    countDataAttr: 'filter-count',
+    tabViewDataAttr: 'tab-view',
+    valueDataAttr: 'filter-value'
+  };
 
+  /**
+   * Draw resource cards.
+   * @param {Array} resources
+   * @private
+   */
+  Filter.prototype.draw_ = function(resources) {
+    var that = this;
 
-          // Search for Design guides
-          for (var i=0; i<DESIGN_RESOURCES.length; i++) {
-            // current search comparison, with counters for tag and title,
-            // used later to improve ranking
-            var s = DESIGN_RESOURCES[i];
-            s.matched_tag = 0;
-            s.matched_title = 0;
-            var matched = false;
-
-            // Check if query matches any tags; work backwards toward 1 to assist ranking
-            for (var j = s.keywords.length - 1; j >= 0; j--) {
-              // it matches a tag
-              if (s.keywords[j].toLowerCase().indexOf(queryStr) == 0) {
-                matched = true;
-                s.matched_tag = j + 1; // add 1 to index position
-              }
-            }
-            // Check if query matches the doc title, but only for current language
-            if (s.lang == currentLang) {
-              // if query matches the doc title
-              if (s.title.toLowerCase().indexOf(queryStr) == 0) {
-                matched = true;
-                s.matched_title = 1;
-              }
-            }
-            if (matched) {
-              gDocsMatches[matchedCountDocs] = s;
-              matchedCountDocs++;
-            }
-          }
+    if (resources.length === 0) {
+      this.containerEl_.html('<p class="dac-filter-message">Nothing matches selected filters.</p>');
+      return;
+    }
 
+    // Draw resources.
+    that.containerEl_.resourceWidget(resources, that.data_.options);
+  };
 
-          // Search for Distribute guides
-          for (var i=0; i<DISTRIBUTE_RESOURCES.length; i++) {
-            // current search comparison, with counters for tag and title,
-            // used later to improve ranking
-            var s = DISTRIBUTE_RESOURCES[i];
-            s.matched_tag = 0;
-            s.matched_title = 0;
-            var matched = false;
-
-            // Check if query matches any tags; work backwards toward 1 to assist ranking
-            for (var j = s.keywords.length - 1; j >= 0; j--) {
-              // it matches a tag
-              if (s.keywords[j].toLowerCase().indexOf(queryStr) == 0) {
-                matched = true;
-                s.matched_tag = j + 1; // add 1 to index position
-              }
-            }
-            // Check if query matches the doc title, but only for current language
-            if (s.lang == currentLang) {
-              // if query matches the doc title
-              if (s.title.toLowerCase().indexOf(queryStr) == 0) {
-                matched = true;
-                s.matched_title = 1;
-              }
-            }
-            if (matched) {
-              gDocsMatches[matchedCountDocs] = s;
-              matchedCountDocs++;
-            }
-          }
+  /**
+   * Initialize a Filter component.
+   */
+  Filter.prototype.init = function() {
+    this.containerEl_ = $(this.options.filter);
 
+    // Setup data settings
+    this.data_ = {};
+    this.data_.chips = {};
+    this.data_.options = this.containerEl_.widgetOptions();
+    this.data_.all = window.metadata.query(this.data_.options);
 
-          // Search for Google guides
-          for (var i=0; i<GOOGLE_RESOURCES.length; i++) {
-            // current search comparison, with counters for tag and title,
-            // used later to improve ranking
-            var s = GOOGLE_RESOURCES[i];
-            s.matched_tag = 0;
-            s.matched_title = 0;
-            var matched = false;
-
-            // Check if query matches any tags; work backwards toward 1 to assist ranking
-            for (var j = s.keywords.length - 1; j >= 0; j--) {
-              // it matches a tag
-              if (s.keywords[j].toLowerCase().indexOf(queryStr) == 0) {
-                matched = true;
-                s.matched_tag = j + 1; // add 1 to index position
-              }
-            }
-            // Check if query matches the doc title, but only for current language
-            if (s.lang == currentLang) {
-              // if query matches the doc title
-              if (s.title.toLowerCase().indexOf(queryStr) == 0) {
-                matched = true;
-                s.matched_title = 1;
-              }
-            }
-            if (matched) {
-              gDocsMatches[matchedCountDocs] = s;
-              matchedCountDocs++;
-            }
-          }
+    // Initialize filter UI
+    this.initUi();
+  };
 
+  /**
+   * Generate a chip for a given filter item.
+   * @param {Object} item - A single filter option (checkbox container).
+   * @returns {HTMLElement} A new Chip element.
+   */
+  Filter.prototype.chipForItem = function(item) {
+    var chip = CHIP_BASE_.clone();
+    chip.prepend(this.data_.chips[item.data('filter-value')]);
+    chip.data('item.dac-filter', item);
+    item.data('chip.dac-filter', chip);
+    this.addToItemValue(item, 1);
+    return chip[0];
+  };
 
-          // Search for Samples
-          for (var i=0; i<SAMPLES_RESOURCES.length; i++) {
-            // current search comparison, with counters for tag and title,
-            // used later to improve ranking
-            var s = SAMPLES_RESOURCES[i];
-            s.matched_tag = 0;
-            s.matched_title = 0;
-            var matched = false;
-            // Check if query matches any tags; work backwards toward 1 to assist ranking
-            for (var j = s.keywords.length - 1; j >= 0; j--) {
-              // it matches a tag
-              if (s.keywords[j].toLowerCase().indexOf(queryStr) == 0) {
-                matched = true;
-                s.matched_tag = j + 1; // add 1 to index position
-              }
-            }
-            // Check if query matches the doc title, but only for current language
-            if (s.lang == currentLang) {
-              // if query matches the doc title.t
-              if (s.title.toLowerCase().indexOf(queryStr) == 0) {
-                matched = true;
-                s.matched_title = 1;
-              }
-            }
-            if (matched) {
-              gDocsMatches[matchedCountDocs] = s;
-              matchedCountDocs++;
-            }
-          }
+  /**
+   * Update count of checked filter items.
+   * @param {Object} item - A single filter option (checkbox container).
+   * @param {Number} value - Either -1 or 1.
+   */
+  Filter.prototype.addToItemValue = function(item, value) {
+    var tab = item.parent().data(this.options.tabViewDataAttr);
+    var countEl = this.countEl_.filter('[data-' + this.options.countDataAttr + '="' + tab + '"]');
+    var count = value + parseInt(countEl.text(), 10);
+    countEl.text(count);
+    countEl.toggleClass('dac-disabled', count === 0);
+  };
 
-          // Rank/sort all the matched pages
-          rank_autocomplete_doc_results(text, gDocsMatches);
-        }
+  /**
+   * Set event listeners.
+   * @private
+   */
+  Filter.prototype.setEventListeners_ = function() {
+    this.chipsEl_.on('click.dac-filter', '.dac-filter-chip-close', this.closeChipHandler_.bind(this));
+    this.tabViewEl_.on('change.dac-filter', ':checkbox', this.toggleCheckboxHandler_.bind(this));
+  };
 
-        // draw the suggestions
-        sync_selection_table(toroot);
-        return true; // allow the event to bubble up to the search api
-    }
-}
+  /**
+   * Check filter items that are active by default.
+   */
+  Filter.prototype.activateInitialFilters_ = function() {
+    var id = (new Date()).getTime();
+    var initiallyCheckedValues = this.data_.options.query.replace(/,\s*/g, '+').split('+');
+    var chips = document.createDocumentFragment();
+    var that = this;
 
-/* Order the jd doc result list based on match quality */
-function rank_autocomplete_doc_results(query, matches) {
-    query = query || '';
-    if (!matches || !matches.length)
-      return;
+    this.items_.each(function(i) {
+      var item = $(this);
+      var opts = item.data();
+      that.data_.chips[opts.filterValue] = opts.filterName;
 
-    var _resultScoreFn = function(match) {
-        var score = 1.0;
+      var checkbox = $(ITEM_STR_.replace(/\{\{name\}\}/g, opts.filterName)
+        .replace(/\{\{value\}\}/g, opts.filterValue)
+        .replace(/\{\{id\}\}/g, 'filter-' + id + '-' + (i + 1)));
 
-        // if the query matched a tag
-        if (match.matched_tag > 0) {
-          // multiply score by factor relative to position in tags list (max of 3)
-          score *= 3 / match.matched_tag;
+      if (initiallyCheckedValues.indexOf(opts.filterValue) > -1) {
+        checkbox[0].checked = true;
+        chips.appendChild(that.chipForItem(item));
+      }
 
-          // if it also matched the title
-          if (match.matched_title > 0) {
-            score *= 2;
-          }
-        } else if (match.matched_title > 0) {
-          score *= 3;
-        }
+      item.append(checkbox);
+    });
 
-        return score;
-    };
+    this.chipsEl_.append(chips);
+  };
 
-    for (var i=0; i<matches.length; i++) {
-        matches[i].__resultScore = _resultScoreFn(matches[i]);
-    }
+  /**
+   * Initialize the Filter view
+   */
+  Filter.prototype.initUi = function() {
+    // Cache DOM elements
+    this.chipsEl_ = this.el.find('[data-' + this.options.chipsDataAttr + ']');
+    this.countEl_ = this.el.find('[data-' + this.options.countDataAttr + ']');
+    this.tabViewEl_ = this.el.find('[data-' + this.options.tabViewDataAttr + ']');
+    this.items_ = this.el.find('[data-' + this.options.nameDataAttr + ']');
+
+    // Setup UI
+    this.draw_(this.data_.all);
+    this.activateInitialFilters_();
+    this.setEventListeners_();
+  };
 
-    matches.sort(function(a,b){
-        var n = b.__resultScore - a.__resultScore;
-        if (n == 0) // lexicographical sort if scores are the same
-            n = (a.label < b.label) ? -1 : 1;
-        return n;
+  /**
+   * @returns {[types|Array, tags|Array, category|Array]}
+   */
+  Filter.prototype.getActiveClauses = function() {
+    var tags = [];
+    var types = [];
+    var categories = [];
+
+    this.items_.find(':checked').each(function(i, checkbox) {
+      // Currently, there is implicit business logic here that `tag` is AND'ed together
+      // while `type` is OR'ed. So , and + do the same thing here. It would be great to
+      // reuse the same query engine for filters, but it would need more powerful syntax.
+      // Probably parenthesis, to support "tag:dog + tag:cat + (type:video, type:blog)"
+      var expression = $(checkbox).val();
+      var regex = /(\w+):(\w+)/g;
+      var match;
+
+      while (match = regex.exec(expression)) {
+        switch (match[1]) {
+          case 'category':
+            categories.push(match[2]);
+            break;
+          case 'tag':
+            tags.push(match[2]);
+            break;
+          case 'type':
+            types.push(match[2]);
+            break;
+        }
+      }
     });
-}
 
-/* Order the result list based on match quality */
-function rank_autocomplete_api_results(query, matches) {
-    query = query || '';
-    if (!matches || !matches.length)
-      return;
+    return [types, tags, categories];
+  };
 
-    // helper function that gets the last occurence index of the given regex
-    // in the given string, or -1 if not found
-    var _lastSearch = function(s, re) {
-      if (s == '')
-        return -1;
-      var l = -1;
-      var tmp;
-      while ((tmp = s.search(re)) >= 0) {
-        if (l < 0) l = 0;
-        l += tmp;
-        s = s.substr(tmp + 1);
+  /**
+   * Actual filtering logic.
+   * @returns {Array}
+   */
+  Filter.prototype.filteredResources = function() {
+    var data = this.getActiveClauses();
+    var types = data[0];
+    var tags = data[1];
+    var categories = data[2];
+    var resources = [];
+    var resource = {};
+    var tag = '';
+    var shouldAddResource = true;
+
+    for (var resourceIndex = 0; resourceIndex < this.data_.all.length; resourceIndex++) {
+      resource = this.data_.all[resourceIndex];
+      shouldAddResource = types.indexOf(resource.type) > -1;
+
+      if (categories && categories.length > 0) {
+        shouldAddResource = shouldAddResource && categories.indexOf(resource.category) > -1;
       }
-      return l;
-    };
 
-    // helper function that counts the occurrences of a given character in
-    // a given string
-    var _countChar = function(s, c) {
-      var n = 0;
-      for (var i=0; i<s.length; i++)
-        if (s.charAt(i) == c) ++n;
-      return n;
-    };
+      for (var tagIndex = 0; shouldAddResource && tagIndex < tags.length; tagIndex++) {
+        tag = tags[tagIndex];
+        shouldAddResource = resource.tags.indexOf(tag) > -1;
+      }
 
-    var queryLower = query.toLowerCase();
-    var queryAlnum = (queryLower.match(/\w+/) || [''])[0];
-    var partPrefixAlnumRE = new RegExp('\\b' + queryAlnum);
-    var partExactAlnumRE = new RegExp('\\b' + queryAlnum + '\\b');
+      if (shouldAddResource) {
+        resources.push(resource);
+      }
+    }
 
-    var _resultScoreFn = function(result) {
-        // scores are calculated based on exact and prefix matches,
-        // and then number of path separators (dots) from the last
-        // match (i.e. favoring classes and deep package names)
-        var score = 1.0;
-        var labelLower = result.label.toLowerCase();
-        var t;
-        t = _lastSearch(labelLower, partExactAlnumRE);
-        if (t >= 0) {
-            // exact part match
-            var partsAfter = _countChar(labelLower.substr(t + 1), '.');
-            score *= 200 / (partsAfter + 1);
-        } else {
-            t = _lastSearch(labelLower, partPrefixAlnumRE);
-            if (t >= 0) {
-                // part prefix match
-                var partsAfter = _countChar(labelLower.substr(t + 1), '.');
-                score *= 20 / (partsAfter + 1);
-            }
-        }
+    return resources;
+  };
 
-        return score;
-    };
+  /**
+   * Close Chip Handler
+   * @param {Event} event - Click event
+   * @private
+   */
+  Filter.prototype.closeChipHandler_ = function(event) {
+    var chip = $(event.currentTarget).parent();
+    var checkbox = chip.data('item.dac-filter').find(':first-child')[0];
+    checkbox.checked = false;
+    this.changeStateForCheckbox(checkbox);
+  };
 
-    for (var i=0; i<matches.length; i++) {
-        // if the API is deprecated, default score is 0; otherwise, perform scoring
-        if (matches[i].deprecated == "true") {
-          matches[i].__resultScore = 0;
-        } else {
-          matches[i].__resultScore = _resultScoreFn(matches[i]);
-        }
+  /**
+   * Handle filter item state change.
+   * @param {Event} event - Change event
+   * @private
+   */
+  Filter.prototype.toggleCheckboxHandler_ = function(event) {
+    this.changeStateForCheckbox(event.currentTarget);
+  };
+
+  /**
+   * Redraw resource view based on new state.
+   * @param checkbox
+   */
+  Filter.prototype.changeStateForCheckbox = function(checkbox) {
+    var item = $(checkbox).parent();
+
+    if (checkbox.checked) {
+      this.chipsEl_.append(this.chipForItem(item));
+      ga('send', 'event', 'Filters', 'Check', $(checkbox).val());
+    } else {
+      item.data('chip.dac-filter').remove();
+      this.addToItemValue(item, -1);
+      ga('send', 'event', 'Filters', 'Uncheck', $(checkbox).val());
     }
 
-    matches.sort(function(a,b){
-        var n = b.__resultScore - a.__resultScore;
-        if (n == 0) // lexicographical sort if scores are the same
-            n = (a.label < b.label) ? -1 : 1;
-        return n;
-    });
-}
+    this.draw_(this.filteredResources());
+  };
 
-/* Add emphasis to part of string that matches query */
-function highlight_autocomplete_result_labels(query) {
-    query = query || '';
-    if ((!gMatches || !gMatches.length) && (!gGoogleMatches || !gGoogleMatches.length))
-      return;
+  /**
+   * jQuery plugin
+   */
+  $.fn.dacFilter = function() {
+    return this.each(function() {
+      var el = $(this);
+      new Filter(el, el.data());
+    });
+  };
 
-    var queryLower = query.toLowerCase();
-    var queryAlnumDot = (queryLower.match(/[\w\.]+/) || [''])[0];
-    var queryRE = new RegExp(
-        '(' + queryAlnumDot.replace(/\./g, '\\.') + ')', 'ig');
-    for (var i=0; i<gMatches.length; i++) {
-        gMatches[i].__hilabel = gMatches[i].label.replace(
-            queryRE, '<b>$1</b>');
-    }
-    for (var i=0; i<gGoogleMatches.length; i++) {
-        gGoogleMatches[i].__hilabel = gGoogleMatches[i].label.replace(
-            queryRE, '<b>$1</b>');
-    }
-}
+  /**
+   * Data Attribute API
+   */
+  $(function() {
+    $('[data-filter]').dacFilter();
+  });
+})(jQuery);
 
-function search_focus_changed(obj, focused)
-{
-    if (!focused) {
-        if(obj.value == ""){
-          $("#search-close").addClass("hide");
-        }
-        $(".suggest-card").hide();
-    }
-}
+(function($) {
+  'use strict';
 
-function submit_search() {
-  var query = document.getElementById('search_autocomplete').value;
-  location.hash = 'q=' + query;
-  loadSearchResults();
-  $("#searchResults").slideDown('slow', setStickyTop);
-  return false;
-}
+  /**
+   * Toggle Floating Label state.
+   * @param {HTMLElement} el - The DOM element.
+   * @param options
+   * @constructor
+   */
+  function FloatingLabel(el, options) {
+    this.el = $(el);
+    this.options = $.extend({}, FloatingLabel.DEFAULTS_, options);
+    this.group = this.el.closest('.dac-form-input-group');
+    this.input = this.group.find('.dac-form-input');
 
+    this.checkValue_ = this.checkValue_.bind(this);
+    this.checkValue_();
 
-function hideResults() {
-  $("#searchResults").slideUp('fast', setStickyTop);
-  $("#search-close").addClass("hide");
-  location.hash = '';
+    this.input.on('focus', function() {
+      this.group.addClass('dac-focused');
+    }.bind(this));
+    this.input.on('blur', function() {
+      this.group.removeClass('dac-focused');
+      this.checkValue_();
+    }.bind(this));
+    this.input.on('keyup', this.checkValue_);
+  }
 
-  $("#search_autocomplete").val("").blur();
+  /**
+   * The label is moved out of the textbox when it has a value.
+   */
+  FloatingLabel.prototype.checkValue_ = function() {
+    if (this.input.val().length) {
+      this.group.addClass('dac-has-value');
+    } else {
+      this.group.removeClass('dac-has-value');
+    }
+  };
 
-  // reset the ajax search callback to nothing, so results don't appear unless ENTER
-  searchControl.setSearchStartingCallback(this, function(control, searcher, query) {});
+  /**
+   * jQuery plugin
+   * @param  {object} options - Override default options.
+   */
+  $.fn.dacFloatingLabel = function(options) {
+    return this.each(function() {
+      new FloatingLabel(this, options);
+    });
+  };
 
-  // forcefully regain key-up event control (previously jacked by search api)
-  $("#search_autocomplete").keyup(function(event) {
-    return search_changed(event, false, toRoot);
+  $(document).on('ready.aranja', function() {
+    $('.dac-form-floatlabel').each(function() {
+      $(this).dacFloatingLabel($(this).data());
+    });
   });
+})(jQuery);
 
-  return false;
-}
+(function($) {
+  'use strict';
 
+  /**
+   * @param {HTMLElement} el - The DOM element.
+   * @param {Object} options
+   * @constructor
+   */
+  function Crumbs(selected, options) {
+    this.options = $.extend({}, Crumbs.DEFAULTS_, options);
+    this.el = $(this.options.container);
 
+    // Do not build breadcrumbs for landing site.
+    if (!selected || location.pathname === '/index.html' || location.pathname === '/') {
+      return;
+    }
 
-/* ########################################################## */
-/* ################  CUSTOM SEARCH ENGINE  ################## */
-/* ########################################################## */
+    // Cache navigation resources
+    this.selected = $(selected);
+    this.selectedParent = this.selected.closest('.dac-nav-secondary').siblings('a');
 
-var searchControl;
-google.load('search', '1', {"callback" : function() {
-            searchControl = new google.search.SearchControl();
-          } });
-
-function loadSearchResults() {
-  document.getElementById("search_autocomplete").style.color = "#000";
-
-  searchControl = new google.search.SearchControl();
-
-  // use our existing search form and use tabs when multiple searchers are used
-  drawOptions = new google.search.DrawOptions();
-  drawOptions.setDrawMode(google.search.SearchControl.DRAW_MODE_TABBED);
-  drawOptions.setInput(document.getElementById("search_autocomplete"));
-
-  // configure search result options
-  searchOptions = new google.search.SearcherOptions();
-  searchOptions.setExpandMode(GSearchControl.EXPAND_MODE_OPEN);
-
-  // configure each of the searchers, for each tab
-  devSiteSearcher = new google.search.WebSearch();
-  devSiteSearcher.setUserDefinedLabel("All");
-  devSiteSearcher.setSiteRestriction("001482626316274216503:zu90b7s047u");
-
-  designSearcher = new google.search.WebSearch();
-  designSearcher.setUserDefinedLabel("Design");
-  designSearcher.setSiteRestriction("http://developer.android.com/design/");
-
-  trainingSearcher = new google.search.WebSearch();
-  trainingSearcher.setUserDefinedLabel("Training");
-  trainingSearcher.setSiteRestriction("http://developer.android.com/training/");
-
-  guidesSearcher = new google.search.WebSearch();
-  guidesSearcher.setUserDefinedLabel("Guides");
-  guidesSearcher.setSiteRestriction("http://developer.android.com/guide/");
-
-  referenceSearcher = new google.search.WebSearch();
-  referenceSearcher.setUserDefinedLabel("Reference");
-  referenceSearcher.setSiteRestriction("http://developer.android.com/reference/");
-
-  googleSearcher = new google.search.WebSearch();
-  googleSearcher.setUserDefinedLabel("Google Services");
-  googleSearcher.setSiteRestriction("http://developer.android.com/google/");
-
-  blogSearcher = new google.search.WebSearch();
-  blogSearcher.setUserDefinedLabel("Blog");
-  blogSearcher.setSiteRestriction("http://android-developers.blogspot.com");
-
-  // add each searcher to the search control
-  searchControl.addSearcher(devSiteSearcher, searchOptions);
-  searchControl.addSearcher(designSearcher, searchOptions);
-  searchControl.addSearcher(trainingSearcher, searchOptions);
-  searchControl.addSearcher(guidesSearcher, searchOptions);
-  searchControl.addSearcher(referenceSearcher, searchOptions);
-  searchControl.addSearcher(googleSearcher, searchOptions);
-  searchControl.addSearcher(blogSearcher, searchOptions);
-
-  // configure result options
-  searchControl.setResultSetSize(google.search.Search.LARGE_RESULTSET);
-  searchControl.setLinkTarget(google.search.Search.LINK_TARGET_SELF);
-  searchControl.setTimeoutInterval(google.search.SearchControl.TIMEOUT_SHORT);
-  searchControl.setNoResultsString(google.search.SearchControl.NO_RESULTS_DEFAULT_STRING);
-
-  // upon ajax search, refresh the url and search title
-  searchControl.setSearchStartingCallback(this, function(control, searcher, query) {
-    updateResultTitle(query);
-    var query = document.getElementById('search_autocomplete').value;
-    location.hash = 'q=' + query;
-  });
+    // Build the breadcrumb list.
+    this.init();
+  }
 
-  // once search results load, set up click listeners
-  searchControl.setSearchCompleteCallback(this, function(control, searcher, query) {
-    addResultClickListeners();
-  });
+  Crumbs.DEFAULTS_ = {
+    container: '.dac-header-crumbs',
+    crumbItem: $('<li class="dac-header-crumbs-item">'),
+    linkClass: 'dac-header-crumbs-link'
+  };
 
-  // draw the search results box
-  searchControl.draw(document.getElementById("leftSearchControl"), drawOptions);
+  Crumbs.prototype.init = function() {
+    Crumbs.buildCrumbForLink(this.selected.clone()).appendTo(this.el);
 
-  // get query and execute the search
-  searchControl.execute(decodeURI(getQuery(location.hash)));
+    if (this.selectedParent.length) {
+      Crumbs.buildCrumbForLink(this.selectedParent.clone()).prependTo(this.el);
+    }
 
-  document.getElementById("search_autocomplete").focus();
-  addTabListeners();
-}
-// End of loadSearchResults
+    // Reveal the breadcrumbs
+    this.el.addClass('dac-has-content');
+  };
 
+  /**
+   * Build a HTML structure for a breadcrumb.
+   * @param {string} link
+   * @return {jQuery}
+   */
+  Crumbs.buildCrumbForLink = function(link) {
+    link.find('br').replaceWith(' ');
 
-google.setOnLoadCallback(function(){
-  if (location.hash.indexOf("q=") == -1) {
-    // if there's no query in the url, don't search and make sure results are hidden
-    $('#searchResults').hide();
-    return;
-  } else {
-    // first time loading search results for this page
-    $('#searchResults').slideDown('slow', setStickyTop);
-    $("#search-close").removeClass("hide");
-    loadSearchResults();
-  }
-}, true);
+    var crumbLink = $('<a>')
+      .attr('class', Crumbs.DEFAULTS_.linkClass)
+      .attr('href', link.attr('href'))
+      .text(link.text());
 
-/* Adjust the scroll position to account for sticky header, only if the hash matches an id.
-   This does not handle <a name=""> tags. Some CSS fixes those, but only for reference docs. */
-function offsetScrollForSticky() {
-  // Ignore if there's no search bar (some special pages have no header)
-  if ($("#search-container").length < 1) return;
+    return Crumbs.DEFAULTS_.crumbItem.clone().append(crumbLink);
+  };
 
-  var hash = escape(location.hash.substr(1));
-  var $matchingElement = $("#"+hash);
-  // Sanity check that there's an element with that ID on the page
-  if ($matchingElement.length) {
-    // If the position of the target element is near the top of the page (<20px, where we expect it
-    // to be because we need to move it down 60px to become in view), then move it down 60px
-    if (Math.abs($matchingElement.offset().top - $(window).scrollTop()) < 20) {
-      $(window).scrollTop($(window).scrollTop() - 60);
-    }
-  }
-}
+  /**
+   * jQuery plugin
+   */
+  $.fn.dacCrumbs = function(options) {
+    return this.each(function() {
+      new Crumbs(this, options);
+    });
+  };
+})(jQuery);
 
-// when an event on the browser history occurs (back, forward, load) requery hash and do search
-$(window).hashchange( function(){
-  // Ignore if there's no search bar (some special pages have no header)
-  if ($("#search-container").length < 1) return;
+(function($) {
+  'use strict';
 
-  // If the hash isn't a search query or there's an error in the query,
-  // then adjust the scroll position to account for sticky header, then exit.
-  if ((location.hash.indexOf("q=") == -1) || (query == "undefined")) {
-    // If the results pane is open, close it.
-    if (!$("#searchResults").is(":hidden")) {
-      hideResults();
-    }
-    offsetScrollForSticky();
-    return;
+  /**
+   * @param {HTMLElement} el - The DOM element.
+   * @param {Object} options
+   * @constructor
+   */
+  function SearchInput(el, options) {
+    this.el = $(el);
+    this.options = $.extend({}, SearchInput.DEFAULTS_, options);
+    this.body = $('body');
+    this.input = this.el.find('input');
+    this.close = this.el.find(this.options.closeButton);
+    this.clear = this.el.find(this.options.clearButton);
+    this.icon = this.el.find('.' + this.options.iconClass);
+    this.init();
   }
 
-  // Otherwise, we have a search to do
-  var query = decodeURI(getQuery(location.hash));
-  searchControl.execute(query);
-  $('#searchResults').slideDown('slow', setStickyTop);
-  $("#search_autocomplete").focus();
-  $("#search-close").removeClass("hide");
-
-  updateResultTitle(query);
-});
+  SearchInput.DEFAULTS_ = {
+    activeClass: 'dac-active',
+    activeIconClass: 'dac-search',
+    closeButton: '[data-search-close]',
+    clearButton: '[data-search-clear]',
+    hiddenClass: 'dac-hidden',
+    iconClass: 'dac-header-search-icon',
+    searchModeClass: 'dac-search-mode',
+    transitionDuration: 250
+  };
 
-function updateResultTitle(query) {
-  $("#searchTitle").html("Results for <em>" + escapeHTML(query) + "</em>");
-}
+  SearchInput.prototype.init = function() {
+    this.input.on('focus.dac-search', this.setActiveState.bind(this))
+              .on('input.dac-search', this.checkInputValue.bind(this));
+    this.close.on('click.dac-search', this.unsetActiveStateHandler_.bind(this));
+    this.clear.on('click.dac-search', this.clearInput.bind(this));
+  };
 
-// forcefully regain key-up event control (previously jacked by search api)
-$("#search_autocomplete").keyup(function(event) {
-  return search_changed(event, false, toRoot);
-});
+  SearchInput.prototype.setActiveState = function() {
+    var that = this;
 
-// add event listeners to each tab so we can track the browser history
-function addTabListeners() {
-  var tabHeaders = $(".gsc-tabHeader");
-  for (var i = 0; i < tabHeaders.length; i++) {
-    $(tabHeaders[i]).attr("id",i).click(function() {
-    /*
-      // make a copy of the page numbers for the search left pane
-      setTimeout(function() {
-        // remove any residual page numbers
-        $('#searchResults .gsc-tabsArea .gsc-cursor-box.gs-bidi-start-align').remove();
-        // move the page numbers to the left position; make a clone,
-        // because the element is drawn to the DOM only once
-        // and because we're going to remove it (previous line),
-        // we need it to be available to move again as the user navigates
-        $('#searchResults .gsc-webResult .gsc-cursor-box.gs-bidi-start-align:visible')
-                        .clone().appendTo('#searchResults .gsc-tabsArea');
-        }, 200);
-      */
-    });
-  }
-  setTimeout(function(){$(tabHeaders[0]).click()},200);
-}
+    this.clear.addClass(this.options.hiddenClass);
+    this.body.addClass(this.options.searchModeClass);
+    this.checkInputValue();
 
-// add analytics tracking events to each result link
-function addResultClickListeners() {
-  $("#searchResults a.gs-title").each(function(index, link) {
-    // When user clicks enter for Google search results, track it
-    $(link).click(function() {
-      ga('send', 'event', 'Google Click', 'clicked: ' + $(this).attr('href'),
-                'query: ' + $("#search_autocomplete").val().toLowerCase());
-    });
-  });
-}
+    // Set icon to black after background has faded to white.
+    setTimeout(function() {
+      that.icon.addClass(that.options.activeIconClass);
+    }, this.options.transitionDuration);
+  };
 
+  SearchInput.prototype.unsetActiveStateHandler_ = function(event) {
+    event.preventDefault();
+    this.unsetActiveState();
+  };
 
-function getQuery(hash) {
-  var queryParts = hash.split('=');
-  return queryParts[1];
-}
+  SearchInput.prototype.unsetActiveState = function() {
+    this.icon.removeClass(this.options.activeIconClass);
+    this.clear.addClass(this.options.hiddenClass);
+    this.body.removeClass(this.options.searchModeClass);
+  };
 
-/* returns the given string with all HTML brackets converted to entities
-    TODO: move this to the site's JS library */
-function escapeHTML(string) {
-  return string.replace(/</g,"&lt;")
-                .replace(/>/g,"&gt;");
-}
+  SearchInput.prototype.clearInput = function(event) {
+    event.preventDefault();
+    this.input.val('');
+    this.clear.addClass(this.options.hiddenClass);
+  };
 
+  SearchInput.prototype.checkInputValue = function() {
+    if (this.input.val().length) {
+      this.clear.removeClass(this.options.hiddenClass);
+    } else {
+      this.clear.addClass(this.options.hiddenClass);
+    }
+  };
 
+  /**
+   * jQuery plugin
+   * @param {object} options - Override default options.
+   */
+  $.fn.dacSearchInput = function() {
+    return this.each(function() {
+      var el = $(this);
+      el.data('search-input.dac', new SearchInput(el, el.data()));
+    });
+  };
 
+  /**
+   * Data Attribute API
+   */
+  $(function() {
+    $('[data-search]').dacSearchInput();
+  });
+})(jQuery);
 
+/* global METADATA */
+(function($) {
+  function DacCarouselQuery(el) {
+    el = $(el);
 
+    var opts = el.data();
+    opts.maxResults = parseInt(opts.maxResults || '100', 10);
+    opts.query = opts.carouselQuery;
+    var resources = window.metadata.query(opts);
 
+    el.empty();
+    $(resources).each(function() {
+      var resource = $.extend({}, this, METADATA.carousel[this.url]);
+      el.dacHero(resource);
+    });
 
-/* ######################################################## */
-/* #################  JAVADOC REFERENCE ################### */
-/* ######################################################## */
+    // Pagination element.
+    el.append('<div class="dac-hero-carousel-pagination"><div class="wrap" data-carousel-pagination>');
 
-/* Initialize some droiddoc stuff, but only if we're in the reference */
-if (location.pathname.indexOf("/reference") == 0) {
-  if(!(location.pathname.indexOf("/reference-gms/packages.html") == 0)
-    && !(location.pathname.indexOf("/reference-gcm/packages.html") == 0)
-    && !(location.pathname.indexOf("/reference/com/google") == 0)) {
-    $(document).ready(function() {
-      // init available apis based on user pref
-      changeApiLevel();
-      initSidenavHeightResize()
-      });
+    el.dacCarousel();
   }
-}
 
-var API_LEVEL_COOKIE = "api_level";
-var minLevel = 1;
-var maxLevel = 1;
+  // jQuery plugin
+  $.fn.dacCarouselQuery = function() {
+    return this.each(function() {
+      var el = $(this);
+      var data = el.data('dac.carouselQuery');
 
-/******* SIDENAV DIMENSIONS ************/
+      if (!data) { el.data('dac.carouselQuery', (data = new DacCarouselQuery(el))); }
+    });
+  };
 
-  function initSidenavHeightResize() {
-    // Change the drag bar size to nicely fit the scrollbar positions
-    var $dragBar = $(".ui-resizable-s");
-    $dragBar.css({'width': $dragBar.parent().width() - 5 + "px"});
+  // Data API
+  $(function() {
+    $('[data-carousel-query]').dacCarouselQuery();
+  });
+})(jQuery);
 
-    $( "#resize-packages-nav" ).resizable({
-      containment: "#nav-panels",
-      handles: "s",
-      alsoResize: "#packages-nav",
-      resize: function(event, ui) { resizeNav(); }, /* resize the nav while dragging */
-      stop: function(event, ui) { saveNavPanels(); } /* once stopped, save the sizes to cookie  */
-      });
+(function($) {
+  /**
+   * A CSS based carousel, inspired by SequenceJS.
+   * @param {jQuery} el
+   * @param {object} options
+   * @constructor
+   */
+  function DacCarousel(el, options) {
+    this.el = $(el);
+    this.options = options = $.extend({}, DacCarousel.OPTIONS, this.el.data(), options || {});
+    this.frames = this.el.find(options.frameSelector);
+    this.count = this.frames.size();
+    this.current = options.start;
 
+    this.initPagination();
+    this.initEvents();
+    this.initFrame();
   }
 
-function updateSidenavFixedWidth() {
-  if (!sticky) return;
-  $('#devdoc-nav').css({
-    'width' : $('#side-nav').css('width'),
-    'margin' : $('#side-nav').css('margin')
-  });
-  $('#devdoc-nav a.totop').css({'display':'block','width':$("#nav").innerWidth()+'px'});
+  DacCarousel.OPTIONS = {
+    auto:      true,
+    autoTime:  10000,
+    autoMinTime: 5000,
+    btnPrev:   '[data-carousel-prev]',
+    btnNext:   '[data-carousel-next]',
+    frameSelector: 'article',
+    loop:      true,
+    start:     0,
+    swipeThreshold: 160,
+    pagination: '[data-carousel-pagination]'
+  };
 
-  initSidenavHeightResize();
-}
+  DacCarousel.prototype.initPagination = function() {
+    this.pagination = $([]);
+    if (!this.options.pagination) { return; }
 
-function updateSidenavFullscreenWidth() {
-  if (!sticky) return;
-  $('#devdoc-nav').css({
-    'width' : $('#side-nav').css('width'),
-    'margin' : $('#side-nav').css('margin')
-  });
-  $('#devdoc-nav .totop').css({'left': 'inherit'});
+    var pagination = $('<ul class="dac-pagination">');
+    var parent = this.el;
+    if (typeof this.options.pagination === 'string') { parent = this.el.find(this.options.pagination); }
 
-  initSidenavHeightResize();
-}
+    if (this.count > 1) {
+      for (var i = 0; i < this.count; i++) {
+        var li = $('<li class="dac-pagination-item">').text(i);
+        if (i === this.options.start) { li.addClass('active'); }
+        li.click(this.go.bind(this, i));
 
-function buildApiLevelSelector() {
-  maxLevel = SINCE_DATA.length;
-  var userApiLevel = parseInt(readCookie(API_LEVEL_COOKIE));
-  userApiLevel = userApiLevel == 0 ? maxLevel : userApiLevel; // If there's no cookie (zero), use the max by default
+        pagination.append(li);
+      }
+      this.pagination = pagination.children();
+      parent.append(pagination);
+    }
+  };
 
-  minLevel = parseInt($("#doc-api-level").attr("class"));
-  // Handle provisional api levels; the provisional level will always be the highest possible level
-  // Provisional api levels will also have a length; other stuff that's just missing a level won't,
-  // so leave those kinds of entities at the default level of 1 (for example, the R.styleable class)
-  if (isNaN(minLevel) && minLevel.length) {
-    minLevel = maxLevel;
-  }
-  var select = $("#apiLevelSelector").html("").change(changeApiLevel);
-  for (var i = maxLevel-1; i >= 0; i--) {
-    var option = $("<option />").attr("value",""+SINCE_DATA[i]).append(""+SINCE_DATA[i]);
-  //  if (SINCE_DATA[i] < minLevel) option.addClass("absent"); // always false for strings (codenames)
-    select.append(option);
-  }
+  DacCarousel.prototype.initEvents = function() {
+    var that = this;
 
-  // get the DOM element and use setAttribute cuz IE6 fails when using jquery .attr('selected',true)
-  var selectedLevelItem = $("#apiLevelSelector option[value='"+userApiLevel+"']").get(0);
-  selectedLevelItem.setAttribute('selected',true);
-}
+    this.touch = {
+      start: {x: 0, y: 0},
+      end:   {x: 0, y: 0}
+    };
 
-function changeApiLevel() {
-  maxLevel = SINCE_DATA.length;
-  var selectedLevel = maxLevel;
+    this.el.on('touchstart', this.touchstart_.bind(this));
+    this.el.on('touchend', this.touchend_.bind(this));
+    this.el.on('touchmove', this.touchmove_.bind(this));
 
-  selectedLevel = parseInt($("#apiLevelSelector option:selected").val());
-  toggleVisisbleApis(selectedLevel, "body");
+    this.el.hover(function() {
+      that.pauseRotateTimer();
+    }, function() {
+      that.startRotateTimer();
+    });
 
-  writeCookie(API_LEVEL_COOKIE, selectedLevel, null);
+    $(this.options.btnPrev).click(function(e) {
+      e.preventDefault();
+      that.prev();
+    });
 
-  if (selectedLevel < minLevel) {
-    var thing = ($("#jd-header").html().indexOf("package") != -1) ? "package" : "class";
-    $("#naMessage").show().html("<div><p><strong>This " + thing
-              + " requires API level " + minLevel + " or higher.</strong></p>"
-              + "<p>This document is hidden because your selected API level for the documentation is "
-              + selectedLevel + ". You can change the documentation API level with the selector "
-              + "above the left navigation.</p>"
-              + "<p>For more information about specifying the API level your app requires, "
-              + "read <a href='" + toRoot + "training/basics/supporting-devices/platforms.html'"
-              + ">Supporting Different Platform Versions</a>.</p>"
-              + "<input type='button' value='OK, make this page visible' "
-              + "title='Change the API level to " + minLevel + "' "
-              + "onclick='$(\"#apiLevelSelector\").val(\"" + minLevel + "\");changeApiLevel();' />"
-              + "</div>");
-  } else {
-    $("#naMessage").hide();
-  }
-}
+    $(this.options.btnNext).click(function(e) {
+      e.preventDefault();
+      that.next();
+    });
+  };
 
-function toggleVisisbleApis(selectedLevel, context) {
-  var apis = $(".api",context);
-  apis.each(function(i) {
-    var obj = $(this);
-    var className = obj.attr("class");
-    var apiLevelIndex = className.lastIndexOf("-")+1;
-    var apiLevelEndIndex = className.indexOf(" ", apiLevelIndex);
-    apiLevelEndIndex = apiLevelEndIndex != -1 ? apiLevelEndIndex : className.length;
-    var apiLevel = className.substring(apiLevelIndex, apiLevelEndIndex);
-    if (apiLevel.length == 0) { // for odd cases when the since data is actually missing, just bail
-      return;
-    }
-    apiLevel = parseInt(apiLevel);
+  DacCarousel.prototype.touchstart_ = function(event) {
+    var t = event.originalEvent.touches[0];
+    this.touch.start = {x: t.screenX, y: t.screenY};
+  };
 
-    // Handle provisional api levels; if this item's level is the provisional one, set it to the max
-    var selectedLevelNum = parseInt(selectedLevel)
-    var apiLevelNum = parseInt(apiLevel);
-    if (isNaN(apiLevelNum)) {
-        apiLevelNum = maxLevel;
-    }
+  DacCarousel.prototype.touchend_ = function() {
+    var deltaX = this.touch.end.x - this.touch.start.x;
+    var deltaY = Math.abs(this.touch.end.y - this.touch.start.y);
+    var shouldSwipe = (deltaY < Math.abs(deltaX)) && (Math.abs(deltaX) >= this.options.swipeThreshold);
 
-    // Grey things out that aren't available and give a tooltip title
-    if (apiLevelNum > selectedLevelNum) {
-      obj.addClass("absent").attr("title","Requires API Level \""
-            + apiLevel + "\" or higher. To reveal, change the target API level "
-              + "above the left navigation.");
+    if (shouldSwipe) {
+      if (deltaX > 0) {
+        this.prev();
+      } else {
+        this.next();
+      }
     }
-    else obj.removeClass("absent").removeAttr("title");
-  });
-}
+  };
 
+  DacCarousel.prototype.touchmove_ = function(event) {
+    var t = event.originalEvent.touches[0];
+    this.touch.end = {x: t.screenX, y: t.screenY};
+  };
 
+  DacCarousel.prototype.initFrame = function() {
+    this.frames.removeClass('active').eq(this.options.start).addClass('active');
+  };
 
+  DacCarousel.prototype.startRotateTimer = function() {
+    if (!this.options.auto || this.rotateTimer) { return; }
+    this.rotateTimer = setTimeout(this.next.bind(this), this.options.autoTime);
+  };
 
-/* #################  SIDENAV TREE VIEW ################### */
+  DacCarousel.prototype.pauseRotateTimer = function() {
+    clearTimeout(this.rotateTimer);
+    this.rotateTimer = null;
+  };
 
-function new_node(me, mom, text, link, children_data, api_level)
-{
-  var node = new Object();
-  node.children = Array();
-  node.children_data = children_data;
-  node.depth = mom.depth + 1;
+  DacCarousel.prototype.prev = function() {
+    this.go(this.current - 1);
+  };
 
-  node.li = document.createElement("li");
-  mom.get_children_ul().appendChild(node.li);
+  DacCarousel.prototype.next = function() {
+    this.go(this.current + 1);
+  };
 
-  node.label_div = document.createElement("div");
-  node.label_div.className = "label";
-  if (api_level != null) {
-    $(node.label_div).addClass("api");
-    $(node.label_div).addClass("api-level-"+api_level);
-  }
-  node.li.appendChild(node.label_div);
+  DacCarousel.prototype.go = function(next) {
+    // Figure out what the next slide is.
+    while (this.count > 0 && next >= this.count) { next -= this.count; }
+    while (next < 0) { next += this.count; }
 
-  if (children_data != null) {
-    node.expand_toggle = document.createElement("a");
-    node.expand_toggle.href = "javascript:void(0)";
-    node.expand_toggle.onclick = function() {
-          if (node.expanded) {
-            $(node.get_children_ul()).slideUp("fast");
-            node.plus_img.src = me.toroot + "assets/images/triangle-closed-small.png";
-            node.expanded = false;
-          } else {
-            expand_node(me, node);
-          }
-       };
-    node.label_div.appendChild(node.expand_toggle);
+    // Cancel if we're already on that slide.
+    if (next === this.current) { return; }
 
-    node.plus_img = document.createElement("img");
-    node.plus_img.src = me.toroot + "assets/images/triangle-closed-small.png";
-    node.plus_img.className = "plus";
-    node.plus_img.width = "8";
-    node.plus_img.border = "0";
-    node.expand_toggle.appendChild(node.plus_img);
+    // Prepare next slide.
+    this.frames.eq(next).removeClass('out');
 
-    node.expanded = false;
-  }
+    // Recalculate styles before starting slide transition.
+    this.el.resolveStyles();
+    // Update pagination
+    this.pagination.removeClass('active').eq(next).addClass('active');
 
-  var a = document.createElement("a");
-  node.label_div.appendChild(a);
-  node.label = document.createTextNode(text);
-  a.appendChild(node.label);
-  if (link) {
-    a.href = me.toroot + link;
-  } else {
-    if (children_data != null) {
-      a.className = "nolink";
-      a.href = "javascript:void(0)";
-      a.onclick = node.expand_toggle.onclick;
-      // This next line shouldn't be necessary.  I'll buy a beer for the first
-      // person who figures out how to remove this line and have the link
-      // toggle shut on the first try. --joeo@android.com
-      node.expanded = false;
-    }
-  }
+    // Transition out current frame
+    this.frames.eq(this.current).toggleClass('active out');
 
+    // Transition in a new frame
+    this.frames.eq(next).toggleClass('active');
 
-  node.children_ul = null;
-  node.get_children_ul = function() {
-      if (!node.children_ul) {
-        node.children_ul = document.createElement("ul");
-        node.children_ul.className = "children_ul";
-        node.children_ul.style.display = "none";
-        node.li.appendChild(node.children_ul);
-      }
-      return node.children_ul;
-    };
+    this.current = next;
+  };
 
-  return node;
-}
+  // Helper which resolves new styles for an element, so it can start transitioning
+  // from the new values.
+  $.fn.resolveStyles = function() {
+    /*jshint expr:true*/
+    this[0] && this[0].offsetTop;
+    return this;
+  };
 
+  // jQuery plugin
+  $.fn.dacCarousel = function() {
+    this.each(function() {
+      var $el = $(this);
+      $el.data('dac-carousel', new DacCarousel(this));
+    });
+    return this;
+  };
 
+  // Data API
+  $(function() {
+    $('[data-carousel]').dacCarousel();
+  });
+})(jQuery);
 
+/* global toRoot */
 
-function expand_node(me, node)
-{
-  if (node.children_data && !node.expanded) {
-    if (node.children_visited) {
-      $(node.get_children_ul()).slideDown("fast");
-    } else {
-      get_node(me, node);
-      if ($(node.label_div).hasClass("absent")) {
-        $(node.get_children_ul()).addClass("absent");
-      }
-      $(node.get_children_ul()).slideDown("fast");
-    }
-    node.plus_img.src = me.toroot + "assets/images/triangle-opened-small.png";
-    node.expanded = true;
+(function($) {
+  // Ordering matters
+  var TAG_MAP = [
+    {from: 'developerstory', to: 'Android Developer Story'},
+    {from: 'googleplay', to: 'Google Play'}
+  ];
 
-    // perform api level toggling because new nodes are new to the DOM
-    var selectedLevel = $("#apiLevelSelector option:selected").val();
-    toggleVisisbleApis(selectedLevel, "#side-nav");
-  }
-}
+  function DacHero(el, resource, isSearch) {
+    var slide = $('<article>');
+    slide.addClass(isSearch ? 'dac-search-hero' : 'dac-expand dac-hero');
+    var image = cleanUrl(resource.heroImage || resource.image);
+    var fullBleed = image && !resource.heroColor;
 
-function get_node(me, mom)
-{
-  mom.children_visited = true;
-  for (var i in mom.children_data) {
-    var node_data = mom.children_data[i];
-    mom.children[i] = new_node(me, mom, node_data[0], node_data[1],
-        node_data[2], node_data[3]);
-  }
-}
+    if (!isSearch) {
+      // Configure background
+      slide.css({
+        backgroundImage: fullBleed ? 'url(' + image + ')' : '',
+        backgroundColor: resource.heroColor || ''
+      });
 
-function this_page_relative(toroot)
-{
-  var full = document.location.pathname;
-  var file = "";
-  if (toroot.substr(0, 1) == "/") {
-    if (full.substr(0, toroot.length) == toroot) {
-      return full.substr(toroot.length);
-    } else {
-      // the file isn't under toroot.  Fail.
-      return null;
-    }
-  } else {
-    if (toroot != "./") {
-      toroot = "./" + toroot;
-    }
-    do {
-      if (toroot.substr(toroot.length-3, 3) == "../" || toroot == "./") {
-        var pos = full.lastIndexOf("/");
-        file = full.substr(pos) + file;
-        full = full.substr(0, pos);
-        toroot = toroot.substr(0, toroot.length-3);
-      }
-    } while (toroot != "" && toroot != "/");
-    return file.substr(1);
-  }
-}
+      // Should copy be inverted
+      slide.toggleClass('dac-invert', resource.heroInvert || fullBleed);
+      slide.toggleClass('dac-darken', fullBleed);
 
-function find_page(url, data)
-{
-  var nodes = data;
-  var result = null;
-  for (var i in nodes) {
-    var d = nodes[i];
-    if (d[1] == url) {
-      return new Array(i);
-    }
-    else if (d[2] != null) {
-      result = find_page(url, d[2]);
-      if (result != null) {
-        return (new Array(i).concat(result));
-      }
+      // Should be clickable
+      slide.append($('<a class="dac-hero-carousel-action">').attr('href', cleanUrl(resource.url)));
     }
-  }
-  return null;
-}
 
-function init_default_navtree(toroot) {
-  // load json file for navtree data
-  $.getScript(toRoot + 'navtree_data.js', function(data, textStatus, jqxhr) {
-      // when the file is loaded, initialize the tree
-      if(jqxhr.status === 200) {
-          init_navtree("tree-list", toroot, NAVTREE_DATA);
-      }
-  });
+    var cols = $('<div class="cols dac-hero-content">');
 
-  // perform api level toggling because because the whole tree is new to the DOM
-  var selectedLevel = $("#apiLevelSelector option:selected").val();
-  toggleVisisbleApis(selectedLevel, "#side-nav");
-}
+    // inline image column
+    var rightCol = $('<div class="col-1of2 col-push-1of2 dac-hero-figure">')
+      .appendTo(cols);
 
-function init_navtree(navtree_id, toroot, root_nodes)
-{
-  var me = new Object();
-  me.toroot = toroot;
-  me.node = new Object();
+    if ((!fullBleed || isSearch) && image) {
+      rightCol.append($('<img>').attr('src', image));
+    }
 
-  me.node.li = document.getElementById(navtree_id);
-  me.node.children_data = root_nodes;
-  me.node.children = new Array();
-  me.node.children_ul = document.createElement("ul");
-  me.node.get_children_ul = function() { return me.node.children_ul; };
-  //me.node.children_ul.className = "children_ul";
-  me.node.li.appendChild(me.node.children_ul);
-  me.node.depth = 0;
+    // info column
+    $('<div class="col-1of2 col-pull-1of2">')
+      .append($('<div class="dac-hero-tag">').text(formatTag(resource)))
+      .append($('<h1 class="dac-hero-title">').text(formatTitle(resource)))
+      .append($('<p class="dac-hero-description">').text(resource.summary))
+      .append($('<a class="dac-hero-cta">')
+        .text(formatCTA(resource))
+        .attr('href', cleanUrl(resource.url))
+        .prepend($('<span class="dac-sprite dac-auto-chevron">'))
+      )
+      .appendTo(cols);
 
-  get_node(me, me.node);
+    slide.append(cols.wrap('<div class="wrap">').parent());
+    el.append(slide);
+  }
 
-  me.this_page = this_page_relative(toroot);
-  me.breadcrumbs = find_page(me.this_page, root_nodes);
-  if (me.breadcrumbs != null && me.breadcrumbs.length != 0) {
-    var mom = me.node;
-    for (var i in me.breadcrumbs) {
-      var j = me.breadcrumbs[i];
-      mom = mom.children[j];
-      expand_node(me, mom);
+  function cleanUrl(url) {
+    if (url && url.indexOf('//') === -1) {
+      url = toRoot + url;
     }
-    mom.label_div.className = mom.label_div.className + " selected";
-    addLoadEvent(function() {
-      scrollIntoView("nav-tree");
-      });
+    return url;
   }
-}
-
-
-
 
+  function formatTag(resource) {
+    // Hmm, need a better more scalable solution for this.
+    for (var i = 0, mapping; mapping = TAG_MAP[i]; i++) {
+      if (resource.tags.indexOf(mapping.from) > -1) {
+        return mapping.to;
+      }
+    }
+    return resource.type;
+  }
 
+  function formatTitle(resource) {
+    return resource.title.replace(/android developer story: /i, '');
+  }
 
+  function formatCTA(resource) {
+    return resource.type === 'youtube' ? 'Watch the video' : 'Learn more';
+  }
 
+  // jQuery plugin
+  $.fn.dacHero = function(resource, isSearch) {
+    return this.each(function() {
+      var el = $(this);
+      return new DacHero(el, resource, isSearch);
+    });
+  };
+})(jQuery);
 
-/* TODO: eliminate redundancy with non-google functions */
-function init_google_navtree(navtree_id, toroot, root_nodes)
-{
-  var me = new Object();
-  me.toroot = toroot;
-  me.node = new Object();
+(function($) {
+  'use strict';
 
-  me.node.li = document.getElementById(navtree_id);
-  if (!me.node.li) {
-    return;
+  function highlightString(label, query) {
+    query = query || '';
+    //query = query.replace('<wbr>', '').replace('.', '\\.');
+    var queryRE = new RegExp('(' + query + ')', 'ig');
+    return label.replace(queryRE, '<em>$1</em>');
   }
 
-  me.node.children_data = root_nodes;
-  me.node.children = new Array();
-  me.node.children_ul = document.createElement("ul");
-  me.node.get_children_ul = function() { return me.node.children_ul; };
-  //me.node.children_ul.className = "children_ul";
-  me.node.li.appendChild(me.node.children_ul);
-  me.node.depth = 0;
-
-  get_google_node(me, me.node);
-}
+  $.fn.highlightMatches = function(query) {
+    return this.each(function() {
+      var el = $(this);
+      var label = el.html();
+      var highlighted = highlightString(label, query);
+      el.html(highlighted);
+      el.addClass('highlighted');
+    });
+  };
+})(jQuery);
 
-function new_google_node(me, mom, text, link, children_data, api_level)
-{
-  var node = new Object();
-  var child;
-  node.children = Array();
-  node.children_data = children_data;
-  node.depth = mom.depth + 1;
-  node.get_children_ul = function() {
-      if (!node.children_ul) {
-        node.children_ul = document.createElement("ul");
-        node.children_ul.className = "tree-list-children";
-        node.li.appendChild(node.children_ul);
-      }
-      return node.children_ul;
-    };
-  node.li = document.createElement("li");
+/**
+ * History tracking.
+ * Track visited urls in localStorage.
+ */
+(function($) {
+  var PAGES_TO_STORE_ = 100;
+  var MIN_NUMBER_OF_PAGES_TO_DISPLAY_ = 6;
+  var CONTAINER_SELECTOR_ = '.dac-search-results-history-wrap';
 
-  mom.get_children_ul().appendChild(node.li);
+  /**
+   * Generate resource cards for visited pages.
+   * @param {HTMLElement} el
+   * @constructor
+   */
+  function HistoryQuery(el) {
+    this.el = $(el);
 
+    // Only show history component if enough pages have been visited.
+    if (getVisitedPages().length < MIN_NUMBER_OF_PAGES_TO_DISPLAY_) {
+      this.el.closest(CONTAINER_SELECTOR_).addClass('dac-hidden');
+      return;
+    }
 
-  if(link) {
-    child = document.createElement("a");
+    // Rename query
+    this.el.data('query', this.el.data('history-query'));
 
+    // jQuery method to populate cards.
+    this.el.resourceWidget();
   }
-  else {
-    child = document.createElement("span");
-    child.className = "tree-list-subtitle";
 
+  /**
+   * Fetch from localStorage an array of visted pages
+   * @returns {Array}
+   */
+  function getVisitedPages() {
+    var visited = localStorage.getItem('visited-pages');
+    return visited ? JSON.parse(visited) : [];
   }
-  if (children_data != null) {
-    node.li.className="nav-section";
-    node.label_div = document.createElement("div");
-    node.label_div.className = "nav-section-header-ref";
-    node.li.appendChild(node.label_div);
-    get_google_node(me, node);
-    node.label_div.appendChild(child);
-  }
-  else {
-    node.li.appendChild(child);
-  }
-  if(link) {
-    child.href = me.toroot + link;
-  }
-  node.label = document.createTextNode(text);
-  child.appendChild(node.label);
 
-  node.children_ul = null;
+  /**
+   * Return a page corresponding to cuurent pathname. If none exists, create one.
+   * @param {Array} pages
+   * @param {String} path
+   * @returns {Object} Page
+   */
+  function getPageForPath(pages, path) {
+    var page;
 
-  return node;
-}
+    // Backwards lookup for current page, last pages most likely to be visited again.
+    for (var i = pages.length - 1; i >= 0; i--) {
+      if (pages[i].path === path) {
+        page = pages[i];
 
-function get_google_node(me, mom)
-{
-  mom.children_visited = true;
-  var linkText;
-  for (var i in mom.children_data) {
-    var node_data = mom.children_data[i];
-    linkText = node_data[0];
+        // Remove page object from pages list to ensure correct ordering.
+        pages.splice(i, 1);
 
-    if(linkText.match("^"+"com.google.android")=="com.google.android"){
-      linkText = linkText.substr(19, linkText.length);
+        return page;
+      }
+    }
+
+    // If storage limit is exceeded, remove last visited path.
+    if (pages.length >= PAGES_TO_STORE_) {
+      pages.shift();
     }
-      mom.children[i] = new_google_node(me, mom, linkText, node_data[1],
-          node_data[2], node_data[3]);
+
+    return {path: path};
   }
-}
 
+  /**
+   * Add current page to back of visited array, increase hit count by 1.
+   */
+  function addCurrectPage() {
+    var path = location.pathname;
 
+    // Do not track frontpage visits.
+    if (path === '/' || path === '/index.html') {return;}
 
+    var pages = getVisitedPages();
+    var page = getPageForPath(pages, path);
 
+    // New page visits have no hit count.
+    page.hit = ~~page.hit + 1;
 
+    // Most recently visted pages are located at the end of the visited array.
+    pages.push(page);
 
-/****** NEW version of script to build google and sample navs dynamically ******/
-// TODO: update Google reference docs to tolerate this new implementation
+    localStorage.setItem('visited-pages', JSON.stringify(pages));
+  }
 
-var NODE_NAME = 0;
-var NODE_HREF = 1;
-var NODE_GROUP = 2;
-var NODE_TAGS = 3;
-var NODE_CHILDREN = 4;
+  /**
+   * Hit count compare function.
+   * @param {Object} a - page
+   * @param {Object} b - page
+   * @returns {number}
+   */
+  function byHit(a, b) {
+    if (a.hit > b.hit) {
+      return -1;
+    } else if (a.hit < b.hit) {
+      return 1;
+    }
 
-function init_google_navtree2(navtree_id, data)
-{
-  var $containerUl = $("#"+navtree_id);
-  for (var i in data) {
-    var node_data = data[i];
-    $containerUl.append(new_google_node2(node_data));
+    return 0;
   }
 
-  // Make all third-generation list items 'sticky' to prevent them from collapsing
-  $containerUl.find('li li li.nav-section').addClass('sticky');
+  /**
+   * Return a list of visited urls in a given order.
+   * @param {String} order - (recent|most-visited)
+   * @returns {Array}
+   */
+  $.dacGetVisitedUrls = function(order) {
+    var pages = getVisitedPages();
 
-  initExpandableNavItems("#"+navtree_id);
-}
+    if (order === 'recent') {
+      pages.reverse();
+    } else {
+      pages.sort(byHit);
+    }
 
-function new_google_node2(node_data)
-{
-  var linkText = node_data[NODE_NAME];
-  if(linkText.match("^"+"com.google.android")=="com.google.android"){
-    linkText = linkText.substr(19, linkText.length);
-  }
-  var $li = $('<li>');
-  var $a;
-  if (node_data[NODE_HREF] != null) {
-    $a = $('<a href="' + toRoot + node_data[NODE_HREF] + '" title="' + linkText + '" >'
-        + linkText + '</a>');
+    return pages.map(function(page) {
+      return page.path.replace(/^\//, '');
+    });
+  };
+
+  // jQuery plugin
+  $.fn.dacHistoryQuery = function() {
+    return this.each(function() {
+      var el = $(this);
+      var data = el.data('dac.recentlyVisited');
+
+      if (!data) {
+        el.data('dac.recentlyVisited', (data = new HistoryQuery(el)));
+      }
+    });
+  };
+
+  $(function() {
+    $('[data-history-query]').dacHistoryQuery();
+    // Do not block page rendering.
+    setTimeout(addCurrectPage, 0);
+  });
+})(jQuery);
+
+/* ############################################ */
+/* ##########     LOCALIZATION     ############ */
+/* ############################################ */
+/**
+ * Global helpers.
+ */
+function getBaseUri(uri) {
+  var intlUrl = (uri.substring(0, 6) === '/intl/');
+  if (intlUrl) {
+    var base = uri.substring(uri.indexOf('intl/') + 5, uri.length);
+    base = base.substring(base.indexOf('/') + 1, base.length);
+    return '/' + base;
   } else {
-    $a = $('<a href="#" onclick="return false;" title="' + linkText + '" >'
-        + linkText + '/</a>');
+    return uri;
   }
-  var $childUl = $('<ul>');
-  if (node_data[NODE_CHILDREN] != null) {
-    $li.addClass("nav-section");
-    $a = $('<div class="nav-section-header">').append($a);
-    if (node_data[NODE_HREF] == null) $a.addClass('empty');
+}
 
-    for (var i in node_data[NODE_CHILDREN]) {
-      var child_node_data = node_data[NODE_CHILDREN][i];
-      $childUl.append(new_google_node2(child_node_data));
+function changeLangPref(targetLang, submit) {
+  window.writeCookie('pref_lang', targetLang, null);
+//DD
+  $('#language').find('option[value="' + targetLang + '"]').attr('selected', true);
+  //  #######  TODO:  Remove this condition once we're stable on devsite #######
+  //  This condition is only needed if we still need to support legacy GAE server
+  if (window.devsite) {
+    // Switch language when on Devsite server
+    if (submit) {
+      $('#setlang').submit();
+    }
+  } else {
+    // Switch language when on legacy GAE server
+    if (submit) {
+      window.location = getBaseUri(location.pathname);
     }
-    $li.append($childUl);
   }
-  $li.prepend($a);
-
-  return $li;
 }
+// Redundant usage to appease jshint.
+window.changeLangPref = changeLangPref;
 
+(function() {
+  /**
+   * Whitelisted locales. Should match choices in language dropdown. Repeated here
+   * as a lot of i18n logic happens before page load and dropdown is ready.
+   */
+  var LANGUAGES = [
+    'en',
+    'es',
+    'in',
+    'ja',
+    'ko',
+    'pt-br',
+    'ru',
+    'vi',
+    'zh-cn',
+    'zh-tw'
+  ];
 
+  /**
+   * Master list of translated strings for template files.
+   */
+  var PHRASES = {
+    'newsletter': {
+      'title': 'Get the latest Android developer news and tips that will help you find success on Google Play.',
+      'requiredHint': '* Required Fields',
+      'name': 'Full name',
+      'email': 'Email address',
+      'company': 'Company / developer name',
+      'appUrl': 'One of your Play Store app URLs',
+      'business': {
+        'label': 'Which best describes your business:',
+        'apps': 'Apps',
+        'games': 'Games',
+        'both': 'Apps & Games'
+      },
+      'confirmMailingList': 'Add me to the mailing list for the monthly newsletter and occasional emails about ' +
+                            'development and Google Play opportunities.',
+      'privacyPolicy': 'I acknowledge that the information provided in this form will be subject to Google\'s ' +
+                       '<a href="https://www.google.com/policies/privacy/" target="_blank">privacy policy</a>.',
+      'languageVal': 'English',
+      'successTitle': 'Hooray!',
+      'successDetails': 'You have successfully signed up for the latest Android developer news and tips.',
+      'languageValTarget': {
+        'en': 'English',
+        'ar': 'Arabic (العربيّة)',
+        'in': 'Indonesian (Bahasa)',
+        'fr': 'French (français)',
+        'de': 'German (Deutsch)',
+        'ja': 'Japanese (日本語)',
+        'ko': 'Korean (한국어)',
+        'ru': 'Russian (Русский)',
+        'es': 'Spanish (español)',
+        'th': 'Thai (ภาษาไทย)',
+        'tr': 'Turkish (Türkçe)',
+        'vi': 'Vietnamese (tiếng Việt)',
+        'pt-br': 'Brazilian Portuguese (Português Brasileiro)',
+        'zh-cn': 'Simplified Chinese (简体中文)',
+        'zh-tw': 'Traditional Chinese (繁體中文)',
+      },
+      'resetLangTitle': "Browse this site in %{targetLang}?",
+      'resetLangTextIntro': 'You requested a page in %{targetLang}, but your language preference for this site is %{lang}.',
+      'resetLangTextCta': 'Would you like to change your language preference and browse this site in %{targetLang}? ' +
+                          'If you want to change your language preference later, use the language menu at the bottom of each page.',
+      'resetLangButtonYes': 'Change Language',
+      'resetLangButtonNo': 'Not Now'
+    }
+  };
 
+  /**
+   * Current locale.
+   */
+  var locale = (function() {
+    var lang = window.readCookie('pref_lang');
+    if (lang === 0 || LANGUAGES.indexOf(lang) === -1) {
+      lang = 'en';
+    }
+    return lang;
+  })();
+  var localeTarget = (function() {
+    var localeTarget = locale;
+    if (location.pathname.substring(0,6) == "/intl/") {
+      var target = location.pathname.split('/')[2];
+      if (!(target === 0) || (LANGUAGES.indexOf(target) === -1)) {
+        localeTarget = target;
+      }
+    }
+    return localeTarget;
+  })();
 
+  /**
+   * Global function shims for backwards compatibility
+   */
+  window.changeNavLang = function() {
+    // Already done.
+  };
 
+  window.loadLangPref = function() {
+    // Languages pref already loaded.
+  };
 
+  window.getLangPref = function() {
+    return locale;
+  };
 
+  window.getLangTarget = function() {
+    return localeTarget;
+  };
 
+  // Expose polyglot instance for advanced localization.
+  var polyglot = window.polyglot = new window.Polyglot({
+    locale: locale,
+    phrases: PHRASES
+  });
 
+  // When DOM is ready.
+  $(function() {
+    // Mark current locale in language picker.
+    $('#language').find('option[value="' + locale + '"]').attr('selected', true);
 
+    $('html').dacTranslate().on('dac:domchange', function(e) {
+      $(e.target).dacTranslate();
+    });
+  });
 
-function showGoogleRefTree() {
-  init_default_google_navtree(toRoot);
-  init_default_gcm_navtree(toRoot);
-}
+  $.fn.dacTranslate = function() {
+    // Translate strings in template markup:
+
+    // OLD
+    // Having all translations in HTML does not scale well and bloats every page.
+    // Need to migrate this to data-l JS translations below.
+    if (locale !== 'en') {
+      var $links = this.find('a[' + locale + '-lang]');
+      $links.each(function() { // for each link with a translation
+        var $link = $(this);
+        // put the desired language from the attribute as the text
+        $link.text($link.attr(locale + '-lang'));
+      });
+    }
 
-function init_default_google_navtree(toroot) {
-  // load json file for navtree data
-  $.getScript(toRoot + 'gms_navtree_data.js', function(data, textStatus, jqxhr) {
-      // when the file is loaded, initialize the tree
-      if(jqxhr.status === 200) {
-          init_google_navtree("gms-tree-list", toroot, GMS_NAVTREE_DATA);
-          highlightSidenav();
-          resizeNav();
+    // NEW
+    // A simple declarative api for JS translations. Feel free to extend as appropriate.
+
+    // Miscellaneous string compilations
+    // Build full strings from localized substrings:
+    var myLocaleTarget = window.getLangTarget();
+    var myTargetLang = window.polyglot.t("newsletter.languageValTarget." + myLocaleTarget);
+    var myLang = window.polyglot.t("newsletter.languageVal");
+    var myTargetLangTitleString = window.polyglot.t("newsletter.resetLangTitle", {targetLang: myTargetLang});
+    var myResetLangTextIntro = window.polyglot.t("newsletter.resetLangTextIntro", {targetLang: myTargetLang, lang: myLang});
+    var myResetLangTextCta = window.polyglot.t("newsletter.resetLangTextCta", {targetLang: myTargetLang});
+    //var myResetLangButtonYes = window.polyglot.t("newsletter.resetLangButtonYes", {targetLang: myTargetLang});
+
+    // Inject strings as text values in dialog components:
+    $("#langform .dac-modal-header-title").text(myTargetLangTitleString);
+    $("#langform #resetLangText").text(myResetLangTextIntro);
+    $("#langform #resetLangCta").text(myResetLangTextCta);
+    //$("#resetLangButtonYes").attr("data-t", window.polyglot.t(myResetLangButtonYes));
+
+    // Text: <div data-t="nav.home"></div>
+    // HTML: <div data-t="privacy" data-t-html></html>
+    this.find('[data-t]').each(function() {
+      var el = $(this);
+      var data = el.data();
+      if (data.t) {
+        el[data.tHtml === '' ? 'html' : 'text'](polyglot.t(data.t));
       }
-  });
-}
+    });
 
-function init_default_gcm_navtree(toroot) {
-  // load json file for navtree data
-  $.getScript(toRoot + 'gcm_navtree_data.js', function(data, textStatus, jqxhr) {
-      // when the file is loaded, initialize the tree
-      if(jqxhr.status === 200) {
-          init_google_navtree("gcm-tree-list", toroot, GCM_NAVTREE_DATA);
-          highlightSidenav();
-          resizeNav();
+    return this;
+  };
+})();
+/* ##########     END LOCALIZATION     ############ */
+
+// Translations. These should eventually be moved into language-specific files and loaded on demand.
+// jshint nonbsp:false
+switch (window.getLangPref()) {
+  case 'ar':
+    window.polyglot.extend({
+      'newsletter': {
+        'title': 'Google Play. يمكنك الحصول على آخر الأخبار والنصائح من مطوّري تطبيقات Android، مما يساعدك ' +
+          'على تحقيق النجاح على',
+        'requiredHint': '* حقول مطلوبة',
+        'name': '. الاسم بالكامل ',
+        'email': '. عنوان البريد الإلكتروني ',
+        'company': '. اسم الشركة / اسم مطوّر البرامج',
+        'appUrl': '. أحد عناوين URL لتطبيقاتك في متجر Play',
+        'business': {
+          'label': '. ما العنصر الذي يوضح طبيعة نشاطك التجاري بدقة؟ ',
+          'apps': 'التطبيقات',
+          'games': 'الألعاب',
+          'both': 'التطبيقات والألعاب'
+        },
+        'confirmMailingList': 'إضافتي إلى القائمة البريدية للنشرة الإخبارية الشهرية والرسائل الإلكترونية التي يتم' +
+          ' إرسالها من حين لآخر بشأن التطوير وفرص Google Play.',
+        'privacyPolicy': 'أقر بأن المعلومات المقدَّمة في هذا النموذج تخضع لسياسة خصوصية ' +
+          '<a href="https://www.google.com/intl/ar/policies/privacy/" target="_blank">Google</a>.',
+        'languageVal': 'Arabic (العربيّة)',
+        'successTitle': 'رائع!',
+        'successDetails': 'لقد اشتركت بنجاح للحصول على آخر الأخبار والنصائح من مطوّري برامج Android.'
       }
-  });
+    });
+    break;
+  case 'zh-cn':
+    window.polyglot.extend({
+      'newsletter': {
+        'title': '获取最新的 Android 开发者资讯和提示,助您在 Google Play 上取得成功。',
+        'requiredHint': '* 必填字段',
+        'name': '全名',
+        'email': '电子邮件地址',
+        'company': '公司/开发者名称',
+        'appUrl': '您的某个 Play 商店应用网址',
+        'business': {
+          'label': '哪一项能够最准确地描述您的业务?',
+          'apps': '应用',
+          'games': '游戏',
+          'both': '应用和游戏'
+        },
+        'confirmMailingList': '将我添加到邮寄名单,以便接收每月简报以及不定期发送的关于开发和 Google Play 商机的电子邮件。',
+        'privacyPolicy': '我确认自己了解在此表单中提供的信息受 <a href="https://www.google.com/intl/zh-CN/' +
+        'policies/privacy/" target="_blank">Google</a> 隐私权政策的约束。',
+        'languageVal': 'Simplified Chinese (简体中文)',
+        'successTitle': '太棒了!',
+        'successDetails': '您已成功订阅最新的 Android 开发者资讯和提示。'
+      }
+    });
+    break;
+  case 'zh-tw':
+    window.polyglot.extend({
+      'newsletter': {
+        'title': '獲得 Android 開發人員的最新消息和各項秘訣,讓您在 Google Play 上輕鬆邁向成功之路。',
+        'requiredHint': '* 必要欄位',
+        'name': '全名',
+        'email': '電子郵件地址',
+        'company': '公司/開發人員名稱',
+        'appUrl': '您其中一個 Play 商店應用程式的網址',
+        'business': {
+          'label': '為您的商家選取最合適的產品類別。',
+          'apps': '應用程式',
+          'games': '遊戲',
+          'both': '應用程式和遊戲'
+        },
+        'confirmMailingList': '我想加入 Google Play 的郵寄清單,以便接收每月電子報和 Google Play 不定期寄送的電子郵件,' +
+          '瞭解關於開發和 Google Play 商機的資訊。',
+        'privacyPolicy': '我瞭解,我在這張表單中提供的資訊將受到 <a href="' +
+        'https://www.google.com/intl/zh-TW/policies/privacy/" target="_blank">Google</a> 隱私權政策.',
+        'languageVal': 'Traditional Chinese (繁體中文)',
+        'successTitle': '太棒了!',
+        'successDetails': '您已經成功訂閱 Android 開發人員的最新消息和各項秘訣。'
+      }
+    });
+    break;
+  case 'fr':
+    window.polyglot.extend({
+      'newsletter': {
+        'title': 'Recevez les dernières actualités destinées aux développeurs Android, ainsi que des conseils qui ' +
+          'vous mèneront vers le succès sur Google Play.',
+        'requiredHint': '* Champs obligatoires',
+        'name': 'Nom complet',
+        'email': 'Adresse e-mail',
+        'company': 'Nom de la société ou du développeur',
+        'appUrl': 'Une de vos URL Play Store',
+        'business': {
+          'label': 'Quelle option décrit le mieux votre activité ?',
+          'apps': 'Applications',
+          'games': 'Jeux',
+          'both': 'Applications et jeux'
+        },
+        'confirmMailingList': 'Ajoutez-moi à la liste de diffusion de la newsletter mensuelle et tenez-moi informé ' +
+          'par des e-mails occasionnels de l\'évolution et des opportunités de Google Play.',
+        'privacyPolicy': 'Je comprends que les renseignements fournis dans ce formulaire seront soumis aux <a href="' +
+        'https://www.google.com/intl/fr/policies/privacy/" target="_blank">règles de confidentialité</a> de Google.',
+        'languageVal': 'French (français)',
+        'successTitle': 'Super !',
+        'successDetails': 'Vous êtes bien inscrit pour recevoir les actualités et les conseils destinés aux ' +
+          'développeurs Android.'
+      }
+    });
+    break;
+  case 'de':
+    window.polyglot.extend({
+      'newsletter': {
+        'title': 'Abonniere aktuelle Informationen und Tipps für Android-Entwickler und werde noch erfolgreicher ' +
+          'bei Google Play.',
+        'requiredHint': '* Pflichtfelder',
+        'name': 'Vollständiger Name',
+        'email': 'E-Mail-Adresse',
+        'company': 'Unternehmens-/Entwicklername',
+        'appUrl': 'Eine der URLs deiner Play Store App',
+        'business': {
+          'label': 'Welche der folgenden Kategorien beschreibt dein Unternehmen am besten?',
+          'apps': 'Apps',
+          'games': 'Spiele',
+          'both': 'Apps und Spiele'
+        },
+        'confirmMailingList': 'Meine E-Mail-Adresse soll zur Mailingliste hinzugefügt werden, damit ich den ' +
+          'monatlichen Newsletter sowie gelegentlich E-Mails zu Entwicklungen und Optionen bei Google Play erhalte.',
+        'privacyPolicy': 'Ich bestätige, dass die in diesem Formular bereitgestellten Informationen gemäß der ' +
+          '<a href="https://www.google.com/intl/de/policies/privacy/" target="_blank">Datenschutzerklärung</a> von ' +
+          'Google verwendet werden dürfen.',
+        'languageVal': 'German (Deutsch)',
+        'successTitle': 'Super!',
+        'successDetails': 'Du hast dich erfolgreich angemeldet und erhältst jetzt aktuelle Informationen und Tipps ' +
+          'für Android-Entwickler.'
+      }
+    });
+    break;
+  case 'in':
+    window.polyglot.extend({
+      'newsletter': {
+        'title': 'Receba as dicas e as notícias mais recentes para os desenvolvedores Android e seja bem-sucedido ' +
+        'no Google Play.',
+        'requiredHint': '* Bidang Wajib Diisi',
+        'name': 'Nama lengkap',
+        'email': 'Alamat email',
+        'company': 'Nama pengembang / perusahaan',
+        'appUrl': 'Salah satu URL aplikasi Play Store Anda',
+        'business': {
+          'label': 'Dari berikut ini, mana yang paling cocok dengan bisnis Anda?',
+          'apps': 'Aplikasi',
+          'games': 'Game',
+          'both': 'Aplikasi dan Game'
+        },
+        'confirmMailingList': 'Tambahkan saya ke milis untuk mendapatkan buletin bulanan dan email sesekali mengenai ' +
+          'perkembangan dan kesempatan yang ada di Google Play.',
+        'privacyPolicy': 'Saya memahami bahwa informasi yang diberikan dalam formulir ini tunduk pada <a href="' +
+        'https://www.google.com/intl/in/policies/privacy/" target="_blank">kebijakan privasi</a> Google.',
+        'languageVal': 'Indonesian (Bahasa)',
+        'successTitle': 'Hore!',
+        'successDetails': 'Anda berhasil mendaftar untuk kiat dan berita pengembang Android terbaru.'
+      }
+    });
+    break;
+  case 'it':
+    //window.polyglot.extend({
+    //  'newsletter': {
+    //    'title': 'Receba as dicas e as notícias mais recentes para os desenvolvedores Android e seja bem-sucedido ' +
+    //    'no Google Play.',
+    //    'requiredHint': '* Campos obrigatórios',
+    //    'name': 'Nome completo',
+    //    'email': 'Endereço de Email',
+    //    'company': 'Nome da empresa / do desenvolvedor',
+    //    'appUrl': 'URL de um dos seus apps da Play Store',
+    //    'business': {
+    //      'label': 'Qual das seguintes opções melhor descreve sua empresa?',
+    //      'apps': 'Apps',
+    //      'games': 'Jogos',
+    //      'both': 'Apps e Jogos'
+    //    },
+    //    'confirmMailingList': 'Inscreva-me na lista de e-mails para que eu receba o boletim informativo mensal, ' +
+    //    'bem como e-mails ocasionais sobre o desenvolvimento e as oportunidades do Google Play.',
+    //    'privacyPolicy': 'Reconheço que as informações fornecidas neste formulário estão sujeitas à <a href="' +
+    //    'https://www.google.com.br/policies/privacy/" target="_blank">Política de Privacidade</a> do Google.',
+    //    'languageVal': 'Italian (italiano)',
+    //    'successTitle': 'Uhu!',
+    //    'successDetails': 'Você se inscreveu para receber as notícias e as dicas mais recentes para os ' +
+    //    'desenvolvedores Android.',
+    //  }
+    //});
+    break;
+  case 'ja':
+    window.polyglot.extend({
+      'newsletter': {
+        'title': 'Google Play での成功に役立つ Android デベロッパー向けの最新ニュースやおすすめの情報をお届けします。',
+        'requiredHint': '* 必須',
+        'name': '氏名',
+        'email': 'メールアドレス',
+        'company': '会社名 / デベロッパー名',
+        'appUrl': 'Play ストア アプリの URL(いずれか 1 つ)',
+        'business': {
+          'label': 'お客様のビジネスに最もよく当てはまるものをお選びください。',
+          'apps': 'アプリ',
+          'games': 'ゲーム',
+          'both': 'アプリとゲーム'
+        },
+        'confirmMailingList': '開発や Google Play の最新情報に関する毎月発行のニュースレターや不定期発行のメールを受け取る',
+        'privacyPolicy': 'このフォームに入力した情報に <a href="https://www.google.com/intl/ja/policies/privacy/" ' +
+          'target="_blank">Google</a> のプライバシー ポリシーが適用',
+        'languageVal': 'Japanese (日本語)',
+        'successTitle': '完了です!',
+        'successDetails': 'Android デベロッパー向けの最新ニュースやおすすめの情報の配信登録が完了しました。'
+      }
+    });
+    break;
+  case 'ko':
+    window.polyglot.extend({
+      'newsletter': {
+        'title': 'Google Play에서 성공을 거두는 데 도움이 되는 최신 Android 개발자 소식 및 도움말을 받아 보세요.',
+        'requiredHint': '* 필수 입력란',
+        'name': '이름',
+        'email': '이메일 주소',
+        'company': '회사/개발자 이름',
+        'appUrl': 'Play 스토어 앱 URL 중 1개',
+        'business': {
+          'label': '다음 중 내 비즈니스를 가장 잘 설명하는 단어는 무엇인가요?',
+          'apps': '앱',
+          'games': '게임',
+          'both': '앱 및 게임'
+        },
+        'confirmMailingList': '개발 및 Google Play 관련 소식에 관한 월별 뉴스레터 및 비정기 이메일을 받아보겠습니다.',
+        'privacyPolicy': '이 양식에 제공한 정보는 <a href="https://www.google.com/intl/ko/policies/privacy/" ' +
+          'target="_blank">Google의</a> 개인정보취급방침에 따라 사용됨을',
+        'languageVal':'Korean (한국어)',
+        'successTitle': '축하합니다!',
+        'successDetails': '최신 Android 개발자 뉴스 및 도움말을 받아볼 수 있도록 가입을 완료했습니다.'
+      }
+    });
+    break;
+  case 'pt-br':
+    window.polyglot.extend({
+      'newsletter': {
+        'title': 'Receba as dicas e as notícias mais recentes para os desenvolvedores Android e seja bem-sucedido ' +
+        'no Google Play.',
+        'requiredHint': '* Campos obrigatórios',
+        'name': 'Nome completo',
+        'email': 'Endereço de Email',
+        'company': 'Nome da empresa / do desenvolvedor',
+        'appUrl': 'URL de um dos seus apps da Play Store',
+        'business': {
+          'label': 'Qual das seguintes opções melhor descreve sua empresa?',
+          'apps': 'Apps',
+          'games': 'Jogos',
+          'both': 'Apps e Jogos'
+        },
+        'confirmMailingList': 'Inscreva-me na lista de e-mails para que eu receba o boletim informativo mensal, ' +
+        'bem como e-mails ocasionais sobre o desenvolvimento e as oportunidades do Google Play.',
+        'privacyPolicy': 'Reconheço que as informações fornecidas neste formulário estão sujeitas à <a href="' +
+        'https://www.google.com.br/policies/privacy/" target="_blank">Política de Privacidade</a> do Google.',
+        'languageVal': 'Brazilian Portuguese (Português Brasileiro)',
+        'successTitle': 'Uhu!',
+        'successDetails': 'Você se inscreveu para receber as notícias e as dicas mais recentes para os ' +
+        'desenvolvedores Android.'
+      }
+    });
+    break;
+  case 'ru':
+    window.polyglot.extend({
+      'newsletter': {
+        'title': 'Хотите получать последние новости и советы для разработчиков Google Play? Заполните эту форму.',
+        'requiredHint': '* Обязательные поля',
+        'name': 'Полное имя',
+        'email': 'Адрес электронной почты',
+        'company': 'Название компании или имя разработчика',
+        'appUrl': 'Ссылка на любое ваше приложение в Google Play',
+        'business': {
+          'label': 'Что вы создаете?',
+          'apps': 'Приложения',
+          'games': 'Игры',
+          'both': 'Игры и приложения'
+        },
+        'confirmMailingList': 'Я хочу получать ежемесячную рассылку для разработчиков и другие полезные новости ' +
+          'Google Play.',
+        'privacyPolicy': 'Я предоставляю эти данные в соответствии с <a href="' +
+          'https://www.google.com/intl/ru/policies/privacy/" target="_blank">Политикой конфиденциальности</a> Google.',
+        'languageVal': 'Russian (Русский)',
+        'successTitle': 'Поздравляем!',
+        'successDetails': 'Теперь вы подписаны на последние новости и советы для разработчиков Android.'
+      }
+    });
+    break;
+  case 'es':
+    window.polyglot.extend({
+      'newsletter': {
+        'title': 'Recibe las últimas noticias y sugerencias para programadores de Android y logra tener éxito en ' +
+          'Google Play.',
+        'requiredHint': '* Campos obligatorios',
+        'name': 'Dirección de correo electrónico',
+        'email': 'Endereço de Email',
+        'company': 'Nombre de la empresa o del programador',
+        'appUrl': 'URL de una de tus aplicaciones de Play Store',
+        'business': {
+          'label': '¿Qué describe mejor a tu empresa?',
+          'apps': 'Aplicaciones',
+          'games': 'Juegos',
+          'both': 'Juegos y aplicaciones'
+        },
+        'confirmMailingList': 'Deseo unirme a la lista de distribución para recibir el boletín informativo mensual ' +
+          'y correos electrónicos ocasionales sobre desarrollo y oportunidades de Google Play.',
+        'privacyPolicy': 'Acepto que la información que proporcioné en este formulario cumple con la <a href="' +
+        'https://www.google.com/intl/es/policies/privacy/" target="_blank">política de privacidad</a> de Google.',
+        'languageVal': 'Spanish (español)',
+        'successTitle': '¡Felicitaciones!',
+        'successDetails': 'El registro para recibir las últimas noticias y sugerencias para programadores de Android ' +
+          'se realizó correctamente.'
+      }
+    });
+    break;
+  case 'th':
+    window.polyglot.extend({
+      'newsletter': {
+        'title': 'รับข่าวสารล่าสุดสำหรับนักพัฒนาซอฟต์แวร์ Android ตลอดจนเคล็ดลับที่จะช่วยให้คุณประสบความสำเร็จบน ' +
+          'Google Play',
+        'requiredHint': '* ช่องที่ต้องกรอก',
+        'name': 'ชื่อและนามสกุล',
+        'email': 'ที่อยู่อีเมล',
+        'company': 'ชื่อบริษัท/นักพัฒนาซอฟต์แวร์',
+        'appUrl': 'URL แอปใดแอปหนึ่งของคุณใน Play สโตร์',
+        'business': {
+          'label': 'ข้อใดตรงกับธุรกิจของคุณมากที่สุด',
+          'apps': 'แอป',
+          'games': 'เกม',
+          'both': 'แอปและเกม'
+        },
+        'confirmMailingList': 'เพิ่มฉันลงในรายชื่ออีเมลเพื่อรับจดหมายข่าวรายเดือนและอีเมลเป็นครั้งคราวเกี่ยวกับก' +
+          'ารพัฒนาซอฟต์แวร์และโอกาสใน Google Play',
+        'privacyPolicy': 'ฉันรับทราบว่าข้อมูลที่ให้ไว้ในแบบฟอร์มนี้จะเป็นไปตามนโยบายส่วนบุคคลของ ' +
+          '<a href="https://www.google.com/intl/th/policies/privacy/" target="_blank">Google</a>',
+        'languageVal': 'Thai (ภาษาไทย)',
+        'successTitle': 'ไชโย!',
+        'successDetails': 'คุณลงชื่อสมัครรับข่าวสารและเคล็ดลับล่าสุดสำหรับนักพัฒนาซอฟต์แวร์ Android เสร็จเรียบร้อยแล้ว'
+      }
+    });
+    break;
+  case 'tr':
+    window.polyglot.extend({
+      'newsletter': {
+        'title': 'Google Play\'de başarılı olmanıza yardımcı olacak en son Android geliştirici haberleri ve ipuçları.',
+        'requiredHint': '* Zorunlu Alanlar',
+        'name': 'Tam ad',
+        'email': 'E-posta adresi',
+        'company': 'Şirket / geliştirici adı',
+        'appUrl': 'Play Store uygulama URL\'lerinizden biri',
+        'business': {
+          'label': 'İşletmenizi en iyi hangisi tanımlar?',
+          'apps': 'Uygulamalar',
+          'games': 'Oyunlar',
+          'both': 'Uygulamalar ve Oyunlar'
+        },
+        'confirmMailingList': 'Beni, geliştirme ve Google Play fırsatlarıyla ilgili ara sıra gönderilen e-posta ' +
+          'iletilerine ilişkin posta listesine ve aylık haber bültenine ekle.',
+        'privacyPolicy': 'Bu formda sağlanan bilgilerin Google\'ın ' +
+          '<a href="https://www.google.com/intl/tr/policies/privacy/" target="_blank">Gizlilik Politikası\'na</a> ' +
+          'tabi olacağını kabul ediyorum.',
+        'languageVal': 'Turkish (Türkçe)',
+        'successTitle': 'Yaşasın!',
+        'successDetails': 'En son Android geliştirici haberleri ve ipuçlarına başarıyla kaydoldunuz.'
+      }
+    });
+    break;
+  case 'vi':
+    window.polyglot.extend({
+      'newsletter': {
+        'title': 'Nhận tin tức và mẹo mới nhất dành cho nhà phát triển Android sẽ giúp bạn tìm thấy thành công trên ' +
+          'Google Play.',
+        'requiredHint': '* Các trường bắt buộc',
+        'name': 'Tên đầy đủ',
+        'email': 'Địa chỉ email',
+        'company': 'Tên công ty/nhà phát triển',
+        'appUrl': 'Một trong số các URL ứng dụng trên cửa hàng Play của bạn',
+        'business': {
+          'label': 'Lựa chọn nào sau đây mô tả chính xác nhất doanh nghiệp của bạn?',
+          'apps': 'Ứng dụng',
+          'games': 'Trò chơi',
+          'both': 'Ứng dụng và trò chơi'
+        },
+        'confirmMailingList': 'Thêm tôi vào danh sách gửi thư cho bản tin hàng tháng và email định kỳ về việc phát ' +
+          'triển và cơ hội của Google Play.',
+        'privacyPolicy': 'Tôi xác nhận rằng thông tin được cung cấp trong biểu mẫu này tuân thủ chính sách bảo mật ' +
+          'của <a href="https://www.google.com/intl/vi/policies/privacy/" target="_blank">Google</a>.',
+        'languageVal': 'Vietnamese (tiếng Việt)',
+        'successTitle': 'Thật tuyệt!',
+        'successDetails': 'Bạn đã đăng ký thành công nhận tin tức và mẹo mới nhất dành cho nhà phát triển của Android.'
+      }
+    });
+    break;
 }
 
-function showSamplesRefTree() {
-  init_default_samples_navtree(toRoot);
-}
+(function($) {
+  'use strict';
 
-function init_default_samples_navtree(toroot) {
-  // load json file for navtree data
-  $.getScript(toRoot + 'samples_navtree_data.js', function(data, textStatus, jqxhr) {
-      // when the file is loaded, initialize the tree
-      if(jqxhr.status === 200) {
-          // hack to remove the "about the samples" link then put it back in
-          // after we nuke the list to remove the dummy static list of samples
-          var $firstLi = $("#nav.samples-nav > li:first-child").clone();
-          $("#nav.samples-nav").empty();
-          $("#nav.samples-nav").append($firstLi);
-
-          init_google_navtree2("nav.samples-nav", SAMPLES_NAVTREE_DATA);
-          highlightSidenav();
-          resizeNav();
-          if ($("#jd-content #samples").length) {
-            showSamples();
-          }
+  function Modal(el, options) {
+    this.el = $(el);
+    this.options = $.extend({}, options);
+    this.isOpen = false;
+
+    this.el.on('click', function(event) {
+      if (!$.contains(this.el.find('.dac-modal-window')[0], event.target)) {
+        return this.el.trigger('modal-close');
       }
-  });
-}
+    }.bind(this));
 
-/* TOGGLE INHERITED MEMBERS */
+    this.el.on('modal-open', this.open_.bind(this));
+    this.el.on('modal-close', this.close_.bind(this));
+    this.el.on('modal-toggle', this.toggle_.bind(this));
+  }
 
-/* Toggle an inherited class (arrow toggle)
- * @param linkObj  The link that was clicked.
- * @param expand  'true' to ensure it's expanded. 'false' to ensure it's closed.
- *                'null' to simply toggle.
- */
-function toggleInherited(linkObj, expand) {
-    var base = linkObj.getAttribute("id");
-    var list = document.getElementById(base + "-list");
-    var summary = document.getElementById(base + "-summary");
-    var trigger = document.getElementById(base + "-trigger");
-    var a = $(linkObj);
-    if ( (expand == null && a.hasClass("closed")) || expand ) {
-        list.style.display = "none";
-        summary.style.display = "block";
-        trigger.src = toRoot + "assets/images/triangle-opened.png";
-        a.removeClass("closed");
-        a.addClass("opened");
-    } else if ( (expand == null && a.hasClass("opened")) || (expand == false) ) {
-        list.style.display = "block";
-        summary.style.display = "none";
-        trigger.src = toRoot + "assets/images/triangle-closed.png";
-        a.removeClass("opened");
-        a.addClass("closed");
-    }
-    return false;
-}
+  Modal.prototype.toggle_ = function() {
+    this.el.trigger('modal-' + (this.isOpen ? 'close' : 'open'));
+  };
 
-/* Toggle all inherited classes in a single table (e.g. all inherited methods)
- * @param linkObj  The link that was clicked.
- * @param expand  'true' to ensure it's expanded. 'false' to ensure it's closed.
- *                'null' to simply toggle.
- */
-function toggleAllInherited(linkObj, expand) {
-  var a = $(linkObj);
-  var table = $(a.parent().parent().parent()); // ugly way to get table/tbody
-  var expandos = $(".jd-expando-trigger", table);
-  if ( (expand == null && a.text() == "[Expand]") || expand ) {
-    expandos.each(function(i) {
-      toggleInherited(this, true);
-    });
-    a.text("[Collapse]");
-  } else if ( (expand == null && a.text() == "[Collapse]") || (expand == false) ) {
-    expandos.each(function(i) {
-      toggleInherited(this, false);
-    });
-    a.text("[Expand]");
+  Modal.prototype.close_ = function() {
+    this.el.removeClass('dac-active');
+    $('body').removeClass('dac-modal-open');
+    this.isOpen = false;
+  };
+
+  Modal.prototype.open_ = function() {
+    this.el.addClass('dac-active');
+    $('body').addClass('dac-modal-open');
+    this.isOpen = true;
+  };
+
+  function onClickToggleModal(event) {
+    event.preventDefault();
+    var toggle = $(event.currentTarget);
+    var options = toggle.data();
+    var modal = options.modalToggle ? $('[data-modal="' + options.modalToggle + '"]') :
+      toggle.closest('[data-modal]');
+    modal.trigger('modal-toggle');
   }
-  return false;
-}
 
-/* Toggle all inherited members in the class (link in the class title)
- */
-function toggleAllClassInherited() {
-  var a = $("#toggleAllClassInherited"); // get toggle link from class title
-  var toggles = $(".toggle-all", $("#body-content"));
-  if (a.text() == "[Expand All]") {
-    toggles.each(function(i) {
-      toggleAllInherited(this, true);
+  /**
+   * jQuery plugin
+   * @param  {object} options - Override default options.
+   */
+  $.fn.dacModal = function(options) {
+    return this.each(function() {
+      new Modal(this, options);
     });
-    a.text("[Collapse All]");
-  } else {
-    toggles.each(function(i) {
-      toggleAllInherited(this, false);
+  };
+
+  $.fn.dacToggleModal = function(options) {
+    return this.each(function() {
+      new ToggleModal(this, options);
     });
-    a.text("[Expand All]");
+  };
+
+  /**
+   * Data Attribute API
+   */
+  $(document).on('ready.aranja', function() {
+    $('[data-modal]').each(function() {
+      $(this).dacModal($(this).data());
+    });
+
+    $('html').on('click.modal', '[data-modal-toggle]', onClickToggleModal);
+
+    // Check if url anchor is targetting a toggle to open the modal.
+    if (location.hash) {
+      $(location.hash + '[data-modal-toggle]').trigger('click');
+    }
+
+    if (window.getLangTarget() !== window.getLangPref()) {
+          $('#langform').trigger('modal-open');
+          $("#langform button.yes").attr("onclick","window.changeLangPref('" + window.getLangTarget() + "', true);  return false;");
+          $("#langform button.no").attr("onclick","window.changeLangPref('" + window.getLangPref() + "', true); return false;");
+    }
+  });
+})(jQuery);
+
+/* Fullscreen - Toggle fullscreen mode for reference pages */
+(function($) {
+  'use strict';
+
+  /**
+   * @param {HTMLElement} el - The DOM element.
+   * @constructor
+   */
+  function Fullscreen(el) {
+    this.el = $(el);
+    this.html = $('html');
+    this.icon = this.el.find('.dac-sprite');
+    this.isFullscreen = window.readCookie(Fullscreen.COOKIE_) === 'true';
+    this.activate_();
+    this.el.on('click.dac-fullscreen', this.toggleHandler_.bind(this));
   }
-  return false;
-}
 
-/* Expand all inherited members in the class. Used when initiating page search */
-function ensureAllInheritedExpanded() {
-  var toggles = $(".toggle-all", $("#body-content"));
-  toggles.each(function(i) {
-    toggleAllInherited(this, true);
-  });
-  $("#toggleAllClassInherited").text("[Collapse All]");
-}
+  /**
+   * Cookie name for storing the state
+   * @type {string}
+   * @private
+   */
+  Fullscreen.COOKIE_ = 'fullscreen';
 
+  /**
+   * Classes to modify the DOM
+   * @type {{mode: string, fullscreen: string, fullscreenExit: string}}
+   * @private
+   */
+  Fullscreen.CLASSES_ = {
+    mode: 'dac-fullscreen-mode',
+    fullscreen: 'dac-fullscreen',
+    fullscreenExit: 'dac-fullscreen-exit'
+  };
 
-/* HANDLE KEY EVENTS
- * - Listen for Ctrl+F (Cmd on Mac) and expand all inherited members (to aid page search)
- */
-var agent = navigator['userAgent'].toLowerCase();
-var mac = agent.indexOf("macintosh") != -1;
+  /**
+   * Event listener for toggling fullscreen mode
+   * @param {MouseEvent} event
+   * @private
+   */
+  Fullscreen.prototype.toggleHandler_ = function(event) {
+    event.stopPropagation();
+    this.toggle(!this.isFullscreen, true);
+  };
 
-$(document).keydown( function(e) {
-var control = mac ? e.metaKey && !e.ctrlKey : e.ctrlKey; // get ctrl key
-  if (control && e.which == 70) {  // 70 is "F"
-    ensureAllInheritedExpanded();
-  }
-});
+  /**
+   * Change the DOM based on current state.
+   * @private
+   */
+  Fullscreen.prototype.activate_ = function() {
+    this.icon.toggleClass(Fullscreen.CLASSES_.fullscreen, !this.isFullscreen);
+    this.icon.toggleClass(Fullscreen.CLASSES_.fullscreenExit, this.isFullscreen);
+    this.html.toggleClass(Fullscreen.CLASSES_.mode, this.isFullscreen);
+  };
 
+  /**
+   * Toggle fullscreen mode and store the state in a cookie.
+   */
+  Fullscreen.prototype.toggle = function() {
+    this.isFullscreen = !this.isFullscreen;
+    window.writeCookie(Fullscreen.COOKIE_, this.isFullscreen, null);
+    this.activate_();
+  };
 
+  /**
+   * jQuery plugin
+   */
+  $.fn.dacFullscreen = function() {
+    return this.each(function() {
+      new Fullscreen($(this));
+    });
+  };
+})(jQuery);
 
+(function($) {
+  'use strict';
 
+  /**
+   * @param {HTMLElement} selected - The link that is selected in the nav.
+   * @constructor
+   */
+  function HeaderTabs(selected) {
 
+    // Don't highlight any tabs on the index page
+    if (location.pathname === '/index.html' || location.pathname === '/') {
+      //return;
+    }
 
-/* On-demand functions */
+    this.selected = $(selected);
+    this.selectedParent = this.selected.closest('.dac-nav-secondary').siblings('a');
+    this.links = $('.dac-header-tabs a');
 
-/** Move sample code line numbers out of PRE block and into non-copyable column */
-function initCodeLineNumbers() {
-  var numbers = $("#codesample-block a.number");
-  if (numbers.length) {
-    $("#codesample-line-numbers").removeClass("hidden").append(numbers);
+    this.selectActiveTab();
   }
 
-  $(document).ready(function() {
-    // select entire line when clicked
-    $("span.code-line").click(function() {
-      if (!shifted) {
-        selectText(this);
-      }
-    });
-    // invoke line link on double click
-    $(".code-line").dblclick(function() {
-      document.location.hash = $(this).attr('id');
-    });
-    // highlight the line when hovering on the number
-    $("#codesample-line-numbers a.number").mouseover(function() {
-      var id = $(this).attr('href');
-      $(id).css('background','#e7e7e7');
-    });
-    $("#codesample-line-numbers a.number").mouseout(function() {
-      var id = $(this).attr('href');
-      $(id).css('background','none');
-    });
-  });
-}
+  HeaderTabs.prototype.selectActiveTab = function() {
+    var section = null;
 
-// create SHIFT key binder to avoid the selectText method when selecting multiple lines
-var shifted = false;
-$(document).bind('keyup keydown', function(e){shifted = e.shiftKey; return true;} );
+    if (this.selectedParent.length) {
+      section = this.selectedParent.text();
+    } else {
+      section = this.selected.text();
+    }
 
-// courtesy of jasonedelman.com
-function selectText(element) {
-    var doc = document
-        , range, selection
-    ;
-    if (doc.body.createTextRange) { //ms
-        range = doc.body.createTextRange();
-        range.moveToElementText(element);
-        range.select();
-    } else if (window.getSelection) { //all others
-        selection = window.getSelection();
-        range = doc.createRange();
-        range.selectNodeContents(element);
-        selection.removeAllRanges();
-        selection.addRange(range);
+    if (section) {
+      this.links.removeClass('selected');
+
+      this.links.filter(function() {
+        return $(this).text() === $.trim(section);
+      }).addClass('selected');
     }
-}
+  };
 
+  /**
+   * jQuery plugin
+   */
+  $.fn.dacHeaderTabs = function() {
+    return this.each(function() {
+      new HeaderTabs(this);
+    });
+  };
+})(jQuery);
 
+(function($) {
+  'use strict';
+  var icon = $('<i/>').addClass('dac-sprite dac-nav-forward');
+  var config = JSON.parse(window.localStorage.getItem('global-navigation') || '{}');
+  var forwardLink = $('<span/>')
+    .addClass('dac-nav-link-forward')
+    .html(icon)
+    .on('click', swap_);
 
+  /**
+   * @constructor
+   */
+  function Nav(navigation) {
+    $('.dac-nav-list').dacCurrentPage().dacHeaderTabs().dacSidebarToggle($('body'));
 
-/** Display links and other information about samples that match the
-    group specified by the URL */
-function showSamples() {
-  var group = $("#samples").attr('class');
-  $("#samples").html("<p>Here are some samples for <b>" + group + "</b> apps:</p>");
+    navigation.find('[data-reference-tree]').dacReferenceNav();
 
-  var $ul = $("<ul>");
-  $selectedLi = $("#nav li.selected");
+    setupViews_(navigation.children().eq(0).children());
 
-  $selectedLi.children("ul").children("li").each(function() {
-      var $li = $("<li>").append($(this).find("a").first().clone());
-      $ul.append($li);
-  });
+    initCollapsedNavs(navigation.find('.dac-nav-sub-slider'));
 
-  $("#samples").append($ul);
+    $('#dac-main-navigation').scrollIntoView('.selected')
+  }
 
-}
+  function updateStore(icon) {
+    var navClass = getCurrentLandingPage_(icon);
+    var isExpanded = icon.hasClass('dac-expand-less-black');
+    var expandedNavs = config.expanded || [];
+    if (isExpanded) {
+      expandedNavs.push(navClass);
+    } else {
+      expandedNavs = expandedNavs.filter(function(item) {
+        return item !== navClass;
+      });
+    }
+    config.expanded = expandedNavs;
+    window.localStorage.setItem('global-navigation', JSON.stringify(config));
+  }
 
+  function toggleSubNav_(icon) {
+    var isExpanded = icon.hasClass('dac-expand-less-black');
+    icon.toggleClass('dac-expand-less-black', !isExpanded);
+    icon.toggleClass('dac-expand-more-black', isExpanded);
+    icon.data('sub-navigation.dac').slideToggle(200);
 
+    updateStore(icon);
+  }
 
-/* ########################################################## */
-/* ###################  RESOURCE CARDS  ##################### */
-/* ########################################################## */
+  function handleSubNavToggle_(event) {
+    event.preventDefault();
+    var icon = $(event.target);
+    toggleSubNav_(icon);
+  }
 
-/** Handle resource queries, collections, and grids (sections). Requires
-    jd_tag_helpers.js and the *_unified_data.js to be loaded. */
+  function getCurrentLandingPage_(icon) {
+    return icon.closest('li')[0].className.replace('dac-nav-item ', '');
+  }
 
-(function() {
-  // Prevent the same resource from being loaded more than once per page.
-  var addedPageResources = {};
+  // Setup sub navigation collapse/expand
+  function initCollapsedNavs(toggleIcons) {
+    toggleIcons.each(setInitiallyActive_($('body')));
+    toggleIcons.on('click', handleSubNavToggle_);
 
-  $(document).ready(function() {
-    // Need to initialize hero carousel before other sections for dedupe
-    // to work correctly.
-    $('[data-carousel-query]').dacCarouselQuery();
+  }
 
-    $('.resource-widget').each(function() {
-      initResourceWidget(this);
-    });
+  function setInitiallyActive_(body) {
+    var expandedNavs = config.expanded || [];
+    return function(i, icon) {
+      icon = $(icon);
+      var subNav = icon.next();
+
+      if (!subNav.length) {
+        return;
+      }
 
-    /* Pass the line height to ellipsisfade() to adjust the height of the
-    text container to show the max number of lines possible, without
-    showing lines that are cut off. This works with the css ellipsis
-    classes to fade last text line and apply an ellipsis char. */
+      var landingPageClass = getCurrentLandingPage_(icon);
+      var expanded = expandedNavs.indexOf(landingPageClass) >= 0;
+      landingPageClass = landingPageClass === 'home' ? 'about' : landingPageClass;
 
-    //card text currently uses 20px line height.
-    var lineHeight = 20;
-    $('.card-info .text').ellipsisfade(lineHeight);
-  });
+      // TODO: Should read from localStorage
+      var visible = body.hasClass(landingPageClass) || expanded;
 
-  /*
-    Three types of resource layouts:
-    Flow - Uses a fixed row-height flow using float left style.
-    Carousel - Single card slideshow all same dimension absolute.
-    Stack - Uses fixed columns and flexible element height.
-  */
-  function initResourceWidget(widget) {
-    var $widget = $(widget);
-    var isFlow = $widget.hasClass('resource-flow-layout'),
-        isCarousel = $widget.hasClass('resource-carousel-layout'),
-        isStack = $widget.hasClass('resource-stack-layout');
-
-    // remove illegal col-x class which is not relevant anymore thanks to responsive styles.
-    var m = $widget.get(0).className.match(/\bcol-(\d+)\b/);
-    if (m && !$widget.is('.cols > *')) {
-      $widget.removeClass('col-' + m[1]);
-    }
-
-    var opts = {
-      cardSizes: ($widget.data('cardsizes') || '').split(','),
-      maxResults: parseInt($widget.data('maxresults') || '100', 10),
-      initialResults: $widget.data('initialResults'),
-      itemsPerPage: $widget.data('itemsperpage'),
-      sortOrder: $widget.data('sortorder'),
-      query: $widget.data('query'),
-      section: $widget.data('section'),
-      /* Added by LFL 6/6/14 */
-      resourceStyle: $widget.data('resourcestyle') || 'card',
-      stackSort: $widget.data('stacksort') || 'true'
+      icon.data('sub-navigation.dac', subNav);
+      icon.toggleClass('dac-expand-less-black', visible);
+      icon.toggleClass('dac-expand-more-black', !visible);
+      subNav.toggle(visible);
     };
+  }
 
-    // run the search for the set of resources to show
+  function setupViews_(views) {
+    if (views.length === 1) {
+      // Active tier 1 nav.
+      views.addClass('dac-active');
+    } else {
+      // Activate back button and tier 2 nav.
+      var langAttr = window.getLangPref();
+      console.log("langAttr is " + langAttr);
+      views.slice(0, 2).addClass('dac-active');
+      var selectedNav = views.eq(2).find('.selected').after(forwardLink);
+      //select the localized text if available else the selectedNav value
+      if (langAttr!='en') {
+        $('.dac-nav-back-title').text(selectedNav.attr(langAttr + '-lang'));
+      } else {
+        $('.dac-nav-back-title').text(selectedNav.text());
+      }
+    }
 
-    var resources = buildResourceList(opts);
+    // Navigation should animate.
+    setTimeout(function() {
+      views.removeClass('dac-no-anim');
+    }, 10);
+  }
 
-    if (isFlow) {
-      drawResourcesFlowWidget($widget, opts, resources);
-    } else if (isCarousel) {
-      drawResourcesCarouselWidget($widget, opts, resources);
-    } else if (isStack) {
-      /* Looks like this got removed and is not used, so repurposing for the
-          homepage style layout.
-          Modified by LFL 6/6/14
-      */
-      //var sections = buildSectionList(opts);
-      opts['numStacks'] = $widget.data('numstacks');
-      drawResourcesStackWidget($widget, opts, resources/*, sections*/);
-    }
+  function swap_(event) {
+    event.preventDefault();
+    $(event.currentTarget).trigger('swap-content');
   }
 
-  /* Initializes a Resource Carousel Widget */
-  function drawResourcesCarouselWidget($widget, opts, resources) {
-    $widget.empty();
-    var plusone = false; // stop showing plusone buttons on cards
+  /**
+   * jQuery plugin
+   */
+  $.fn.dacNav = function() {
+    return this.each(function() {
+      new Nav($(this));
+    });
+  };
+})(jQuery);
 
-    $widget.addClass('resource-card slideshow-container')
-      .append($('<a>').addClass('slideshow-prev').text('Prev'))
-      .append($('<a>').addClass('slideshow-next').text('Next'));
+/* global NAVTREE_DATA */
+(function($) {
+  /**
+   * Build the reference navigation with namespace dropdowns.
+   * @param {jQuery} el - The DOM element.
+   */
+  function buildReferenceNav(el) {
+    var namespaceList = el.find('[data-reference-namespaces]');
+    var resources = el.find('[data-reference-resources]');
+    var selected = namespaceList.find('.selected');
+
+    // Links should be toggleable.
+    namespaceList.find('a').addClass('dac-reference-nav-toggle dac-closed');
+
+    // Load in all resources
+    $.getScript('/navtree_data.js', function(data, textStatus, xhr) {
+      if (xhr.status === 200) {
+        namespaceList.on('click', 'a.dac-reference-nav-toggle', toggleResourcesHandler);
+      }
+    });
 
-    var css = { 'width': $widget.width() + 'px',
-                'height': $widget.height() + 'px' };
+    // No setup required if no resources are present
+    if (!resources.length) {
+      return;
+    }
 
-    var $ul = $('<ul>');
+    // The resources should be a part of selected namespace.
+    var overview = addResourcesToView(resources, selected);
 
-    for (var i = 0; i < resources.length; ++i) {
-      var $card = $('<a>')
-        .attr('href', cleanUrl(resources[i].url))
-        .decorateResourceCard(resources[i],plusone);
+    // Currently viewing Overview
+    if (location.pathname === overview.attr('href')) {
+      overview.parent().addClass('selected');
+    }
 
-      $('<li>').css(css)
-          .append($card)
-          .appendTo($ul);
+    // Open currently selected resource
+    var listsToOpen = selected.children().eq(1);
+    listsToOpen = listsToOpen.add(listsToOpen.find('.selected').parent()).show();
+
+    // Mark dropdowns as open
+    listsToOpen.prev().removeClass('dac-closed');
+
+    // Scroll into view
+    namespaceList.scrollIntoView(selected);
+  }
+
+  /**
+   * Handles the toggling of resources.
+   * @param {Event} event
+   */
+  function toggleResourcesHandler(event) {
+    event.preventDefault();
+    var el = $(this);
+
+    // If resources for given namespace is not present, fetch correct data.
+    if (this.tagName === 'A' && !this.hasResources) {
+      addResourcesToView(buildResourcesViewForData(getDataForNamespace(el.text())), el.parent());
     }
 
-    $('<div>').addClass('frame')
-      .append($ul)
-      .appendTo($widget);
+    el.toggleClass('dac-closed').next().slideToggle(200);
+  }
 
-    $widget.dacSlideshow({
-      auto: true,
-      btnPrev: '.slideshow-prev',
-      btnNext: '.slideshow-next'
+  /**
+   * @param {String} namespace
+   * @returns {Array} namespace data
+   */
+  function getDataForNamespace(namespace) {
+    var namespaceData = NAVTREE_DATA.filter(function(data) {
+      return data[0] === namespace;
     });
-  };
 
-  /* Initializes a Resource Card Stack Widget (column-based layout)
-     Modified by LFL 6/6/14
+    return namespaceData.length ? namespaceData[0][2] : [];
+  }
+
+  /**
+   * Build a list item for a resource
+   * @param {Array} resource
+   * @returns {String}
    */
-  function drawResourcesStackWidget($widget, opts, resources, sections) {
-    // Don't empty widget, grab all items inside since they will be the first
-    // items stacked, followed by the resource query
-    var plusone = false; // stop showing plusone buttons on cards
-    var cards = $widget.find('.resource-card').detach().toArray();
-    var numStacks = opts.numStacks || 1;
-    var $stacks = [];
-    var urlString;
+  function buildResourceItem(resource) {
+    return '<li class="api apilevel-' + resource[3] + '"><a href="/' + resource[1] + '">' + resource[0] + '</a></li>';
+  }
 
-    for (var i = 0; i < numStacks; ++i) {
-      $stacks[i] = $('<div>').addClass('resource-card-stack')
-          .appendTo($widget);
-    }
+  /**
+   * Build resources list items.
+   * @param {Array} resources
+   * @returns {String}
+   */
+  function buildResourceList(resources) {
+    return '<li><h2>' + resources[0] + '</h2><ul>' + resources[2].map(buildResourceItem).join('') + '</ul>';
+  }
 
-    var sectionResources = [];
+  /**
+   * Build a resources view
+   * @param {Array} data
+   * @returns {jQuery} resources in an unordered list.
+   */
+  function buildResourcesViewForData(data) {
+    return $('<ul>' + data.map(buildResourceList).join('') + '</ul>');
+  }
 
-    // Extract any subsections that are actually resource cards
-    if (sections) {
-      for (var i = 0; i < sections.length; ++i) {
-        if (!sections[i].sections || !sections[i].sections.length) {
-          // Render it as a resource card
-          sectionResources.push(
-            $('<a>')
-              .addClass('resource-card section-card')
-              .attr('href', cleanUrl(sections[i].resource.url))
-              .decorateResourceCard(sections[i].resource,plusone)[0]
-          );
+  /**
+   * Add resources to a containing view.
+   * @param {jQuery} resources
+   * @param {jQuery} view
+   * @returns {jQuery} the overview link.
+   */
+  function addResourcesToView(resources, view) {
+    var namespace = view.children().eq(0);
+    var overview = $('<a href="' + namespace.attr('href') + '">Overview</a>');
+
+    // Mark namespace with content;
+    namespace[0].hasResources = true;
+
+    // Add correct classes / event listeners to resources.
+    resources.prepend($('<li>').html(overview))
+      .find('a')
+        .addClass('dac-reference-nav-resource')
+      .end()
+        .find('h2')
+        .addClass('dac-reference-nav-toggle dac-closed')
+        .on('click', toggleResourcesHandler)
+      .end()
+        .add(resources.find('ul'))
+        .addClass('dac-reference-nav-resources')
+      .end()
+        .appendTo(view);
+
+    return overview;
+  }
+
+  /**
+   * jQuery plugin
+   */
+  $.fn.dacReferenceNav = function() {
+    return this.each(function() {
+      buildReferenceNav($(this));
+    });
+  };
+})(jQuery);
+
+/** Scroll a container to make a target element visible
+ This is called when the page finished loading. */
+$.fn.scrollIntoView = function(target) {
+  if ('string' === typeof target) {
+    target = this.find(target);
+  }
+  if (this.is(':visible')) {
+    if (target.length == 0) {
+      // If no selected item found, exit
+      return;
+    }
+
+    // get the target element's offset from its container nav by measuring the element's offset
+    // relative to the document then subtract the container nav's offset relative to the document
+    var targetOffset = target.offset().top - this.offset().top;
+    var containerHeight = this.height();
+    if (targetOffset > containerHeight * .8) { // multiply nav height by .8 so we move up the item
+      // if it's more than 80% down the nav
+      // scroll the item up by an amount equal to 80% the container height
+      this.scrollTop(targetOffset - (containerHeight * .8));
+    }
+  }
+};
 
+(function($) {
+  $.fn.dacCurrentPage = function() {
+    // Highlight the header tabs...
+    // highlight Design tab
+    var baseurl = getBaseUri(window.location.pathname);
+    var urlSegments = baseurl.split('/');
+    var navEl = this;
+    var body = $('body');
+    var subNavEl = navEl.find('.dac-nav-secondary');
+    var parentNavEl;
+    var selected;
+    // In NDK docs, highlight appropriate sub-nav
+    if (body.hasClass('ndk')) {
+      if (body.hasClass('guide')) {
+        selected = navEl.find('> li.guides > a').addClass('selected');
+      } else if (body.hasClass('reference')) {
+        selected = navEl.find('> li.reference > a').addClass('selected');
+      } else if (body.hasClass('samples')) { 
+        selected = navEl.find('> li.samples > a').addClass('selected');
+      } else if (body.hasClass('downloads')) { 
+        selected = navEl.find('> li.downloads > a').addClass('selected');
+      }
+    } else if (body.hasClass('design')) {
+      selected = navEl.find('> li.design > a').addClass('selected');
+      // highlight Home nav
+    } else if (body.hasClass('about')) {
+      parentNavEl = navEl.find('> li.home > a');
+      parentNavEl.addClass('has-subnav');
+      // In Home docs, also highlight appropriate sub-nav
+      if (urlSegments[1] === 'wear' || urlSegments[1] === 'tv' ||
+        urlSegments[1] === 'auto') {
+        selected = subNavEl.find('li.' + urlSegments[1] + ' > a').addClass('selected');
+      } else if (urlSegments[1] === 'about') {
+        selected = subNavEl.find('li.versions > a').addClass('selected');
+      } else {
+        selected = parentNavEl.removeClass('has-subnav').addClass('selected');
+      }
+      // highlight Develop nav
+    } else if (body.hasClass('develop') || body.hasClass('google')) {
+      parentNavEl = navEl.find('> li.develop > a');
+      parentNavEl.addClass('has-subnav');
+      // In Develop docs, also highlight appropriate sub-nav
+      if (urlSegments[1] === 'training') {
+        selected = subNavEl.find('li.training > a').addClass('selected');
+      } else if (urlSegments[1] === 'guide') {
+        selected = subNavEl.find('li.guide > a').addClass('selected');
+      } else if (urlSegments[1] === 'reference') {
+        // If the root is reference, but page is also part of Google Services, select Google
+        if (body.hasClass('google')) {
+          selected = subNavEl.find('li.google > a').addClass('selected');
         } else {
-          cards.push(
-            $('<div>')
-              .addClass('resource-card section-card-menu')
-              .decorateResourceSection(sections[i],plusone)[0]
-          );
+          selected = subNavEl.find('li.reference > a').addClass('selected');
         }
+      } else if ((urlSegments[1] === 'tools') || (urlSegments[1] === 'sdk')) {
+        selected = subNavEl.find('li.tools > a').addClass('selected');
+      } else if (body.hasClass('google')) {
+        selected = subNavEl.find('li.google > a').addClass('selected');
+      } else if (body.hasClass('samples')) {
+        selected = subNavEl.find('li.samples > a').addClass('selected');
+      } else {
+        selected = parentNavEl.removeClass('has-subnav').addClass('selected');
+      }
+      // highlight Distribute nav
+    } else if (body.hasClass('distribute')) {
+      parentNavEl = navEl.find('> li.distribute > a');
+      parentNavEl.addClass('has-subnav');
+      // In Distribute docs, also highlight appropriate sub-nav
+      if (urlSegments[2] === 'users') {
+        selected = subNavEl.find('li.users > a').addClass('selected');
+      } else if (urlSegments[2] === 'engage') {
+        selected = subNavEl.find('li.engage > a').addClass('selected');
+      } else if (urlSegments[2] === 'monetize') {
+        selected = subNavEl.find('li.monetize > a').addClass('selected');
+      } else if (urlSegments[2] === 'analyze') {
+        selected = subNavEl.find('li.analyze > a').addClass('selected');
+      } else if (urlSegments[2] === 'tools') {
+        selected = subNavEl.find('li.disttools > a').addClass('selected');
+      } else if (urlSegments[2] === 'stories') {
+        selected = subNavEl.find('li.stories > a').addClass('selected');
+      } else if (urlSegments[2] === 'essentials') {
+        selected = subNavEl.find('li.essentials > a').addClass('selected');
+      } else if (urlSegments[2] === 'googleplay') {
+        selected = subNavEl.find('li.googleplay > a').addClass('selected');
+      } else {
+        selected = parentNavEl.removeClass('has-subnav').addClass('selected');
       }
     }
+    return $(selected);
+  };
+})(jQuery);
 
-    cards = cards.concat(sectionResources);
-
-    for (var i = 0; i < resources.length; ++i) {
-      var $card = createResourceElement(resources[i], opts);
-
-      if (opts.resourceStyle.indexOf('related') > -1) {
-        $card.addClass('related-card');
-      }
+(function($) {
+  'use strict';
 
-      cards.push($card[0]);
-    }
+  /**
+   * Toggle the visabilty of the mobile navigation.
+   * @param {HTMLElement} el - The DOM element.
+   * @param {Object} options
+   * @constructor
+   */
+  function ToggleNav(el, options) {
+    this.el = $(el);
+    this.options = $.extend({}, ToggleNav.DEFAULTS_, options);
+    this.body = $(document.body);
+    this.navigation_ = this.body.find(this.options.navigation);
+    this.el.on('click', this.clickHandler_.bind(this));
+  }
 
-    if (opts.stackSort != 'false') {
-      for (var i = 0; i < cards.length; ++i) {
-        // Find the stack with the shortest height, but give preference to
-        // left to right order.
-        var minHeight = $stacks[0].height();
-        var minIndex = 0;
+  ToggleNav.BREAKPOINT_ = 980;
 
-        for (var j = 1; j < numStacks; ++j) {
-          var height = $stacks[j].height();
-          if (height < minHeight - 45) {
-            minHeight = height;
-            minIndex = j;
-          }
-        }
+  /**
+   * Open on correct sizes
+   */
+  function toggleSidebarVisibility(body) {
+    var wasClosed = ('' + localStorage.getItem('navigation-open')) === 'false';
 
-        $stacks[minIndex].append($(cards[i]));
-      }
+    if (wasClosed) {
+      body.removeClass(ToggleNav.DEFAULTS_.activeClass);
+    } else if (window.innerWidth >= ToggleNav.BREAKPOINT_) {
+      body.addClass(ToggleNav.DEFAULTS_.activeClass);
+    } else {
+      body.removeClass(ToggleNav.DEFAULTS_.activeClass);
     }
+  }
 
+  /**
+   * ToggleNav Default Settings
+   * @type {{body: boolean, dimmer: string, navigation: string, activeClass: string}}
+   * @private
+   */
+  ToggleNav.DEFAULTS_ = {
+    body: true,
+    dimmer: '.dac-nav-dimmer',
+    animatingClass: 'dac-nav-animating',
+    navigation: '[data-dac-nav]',
+    activeClass: 'dac-nav-open'
   };
 
-  /*
-    Create a resource card using the given resource object and a list of html
-     configured options. Returns a jquery object containing the element.
-  */
-  function createResourceElement(resource, opts, plusone) {
-    var $el;
+  /**
+   * The actual toggle logic.
+   * @param {Event} event
+   * @private
+   */
+  ToggleNav.prototype.clickHandler_ = function(event) {
+    event.preventDefault();
+    var animatingClass = this.options.animatingClass;
+    var body = this.body;
 
-    // The difference here is that generic cards are not entirely clickable
-    // so its a div instead of an a tag, also the generic one is not given
-    // the resource-card class so it appears with a transparent background
-    // and can be styled in whatever way the css setup.
-    if (opts.resourceStyle == 'generic') {
-      $el = $('<div>')
-        .addClass('resource')
-        .attr('href', cleanUrl(resource.url))
-        .decorateResource(resource, opts);
-    } else {
-      var cls = 'resource resource-card';
+    body.addClass(animatingClass);
+    body.toggleClass(this.options.activeClass);
 
-      $el = $('<a>')
-        .addClass(cls)
-        .attr('href', cleanUrl(resource.url))
-        .decorateResourceCard(resource, plusone);
+    setTimeout(function() {
+      body.removeClass(animatingClass);
+    }, this.navigation_.transitionDuration());
+
+    if (window.innerWidth >= ToggleNav.BREAKPOINT_) {
+      localStorage.setItem('navigation-open', body.hasClass(this.options.activeClass));
     }
+  };
 
-    return $el;
-  }
+  /**
+   * jQuery plugin
+   * @param  {object} options - Override default options.
+   */
+  $.fn.dacToggleMobileNav = function() {
+    return this.each(function() {
+      var el = $(this);
+      new ToggleNav(el, el.data());
+    });
+  };
 
-  function createResponsiveFlowColumn(cardSize) {
-    var cardWidth = parseInt(cardSize.match(/(\d+)/)[1], 10);
-    var column = $('<div>').addClass('col-' + (cardWidth / 3) + 'of6');
-    if (cardWidth < 9) {
-      column.addClass('col-tablet-1of2');
-    } else if (cardWidth > 9 && cardWidth < 18) {
-      column.addClass('col-tablet-1of1');
-    }
-    if (cardWidth < 18) {
-      column.addClass('col-mobile-1of1')
-    }
-    return column;
-  }
+  $.fn.dacSidebarToggle = function(body) {
+    toggleSidebarVisibility(body);
+    $(window).on('resize', toggleSidebarVisibility.bind(null, body));
+  };
 
-  /* Initializes a flow widget, see distribute.scss for generating accompanying css */
-  function drawResourcesFlowWidget($widget, opts, resources) {
-    $widget.empty().addClass('cols');
-    var cardSizes = opts.cardSizes || ['6x6'];
-    var initialResults = opts.initialResults || resources.length;
-    var i = 0, j = 0;
-    var plusone = false; // stop showing plusone buttons on cards
-    var cardParent = $widget;
-
-    while (i < resources.length) {
-
-      if (i === initialResults && initialResults < resources.length) {
-        // Toggle remaining cards
-        cardParent = $('<div class="dac-toggle-content clearfix">').appendTo($widget);
-        $widget.addClass('dac-toggle');
-        $('<div class="col-1of1 dac-section-links dac-text-center">')
-          .append(
-            $('<div class="dac-section-link" data-toggle="section">')
-              .append('<span class="dac-toggle-expand">More<i class="dac-sprite dac-auto-unfold-more"></i></span>')
-              .append('<span class="dac-toggle-collapse">Less<i class="dac-sprite dac-auto-unfold-less"></i></span>')
-          )
-          .appendTo($widget)
-      }
+  /**
+   * Data Attribute API
+   */
+  $(function() {
+    $('[data-dac-toggle-nav]').dacToggleMobileNav();
+  });
+})(jQuery);
 
-      var cardSize = cardSizes[j++ % cardSizes.length];
-      cardSize = cardSize.replace(/^\s+|\s+$/,'');
+(function($) {
+  'use strict';
 
-      var column = createResponsiveFlowColumn(cardSize).appendTo(cardParent);
+  /**
+   * Submit the newsletter form to a Google Form.
+   * @param {HTMLElement} el - The Form DOM element.
+   * @constructor
+   */
+  function NewsletterForm(el) {
+    this.el = $(el);
+    this.form = this.el.find('form');
+    $('<iframe/>').hide()
+      .attr('name', 'dac-newsletter-iframe')
+      .attr('src', '')
+      .insertBefore(this.form);
+    this.el.find('[data-newsletter-language]').val(window.polyglot.t('newsletter.languageVal'));
+    this.form.on('submit', this.submitHandler_.bind(this));
+  }
 
-      // A stack has a third dimension which is the number of stacked items
-      var isStack = cardSize.match(/(\d+)x(\d+)x(\d+)/);
-      var stackCount = 0;
-      var $stackDiv = null;
+  /**
+   * Milliseconds until modal has vanished after modal-close is triggered.
+   * @type {number}
+   * @private
+   */
+  NewsletterForm.CLOSE_DELAY_ = 300;
 
-      if (isStack) {
-        // Create a stack container which should have the dimensions defined
-        // by the product of the items inside.
-        $stackDiv = $('<div>').addClass('resource-card-stack resource-card-' + isStack[1]
-            + 'x' + isStack[2] * isStack[3]) .appendTo(column);
-      }
+  /**
+   * Switch view to display form after close.
+   * @private
+   */
+  NewsletterForm.prototype.closeHandler_ = function() {
+    setTimeout(function() {
+      this.el.trigger('swap-reset');
+    }.bind(this), NewsletterForm.CLOSE_DELAY_);
+  };
 
-      // Build each stack item or just a single item
-      do {
-        var resource = resources[i];
+  /**
+   * Reset the modal to initial state.
+   * @private
+   */
+  NewsletterForm.prototype.reset_ = function() {
+    this.form.trigger('reset');
+    this.el.one('modal-close', this.closeHandler_.bind(this));
+  };
 
-        var $card = createResourceElement(resources[i], opts, plusone);
+  /**
+   * Display a success view on submit.
+   * @private
+   */
+  NewsletterForm.prototype.submitHandler_ = function() {
+    this.el.one('swap-complete', this.reset_.bind(this));
+    this.el.trigger('swap-content');
+  };
 
-        $card.addClass('resource-card-' + cardSize +
-          ' resource-card-' + resource.type);
+  /**
+   * jQuery plugin
+   * @param  {object} options - Override default options.
+   */
+  $.fn.dacNewsletterForm = function(options) {
+    return this.each(function() {
+      new NewsletterForm(this, options);
+    });
+  };
 
-        if (isStack) {
-          $card.addClass('resource-card-' + isStack[1] + 'x' + isStack[2]);
-          if (++stackCount == parseInt(isStack[3])) {
-            $card.addClass('resource-card-row-stack-last');
-            stackCount = 0;
-          }
-        } else {
-          stackCount = 0;
-        }
+  /**
+   * Data Attribute API
+   */
+  $(document).on('ready.aranja', function() {
+    $('[data-newsletter]').each(function() {
+      $(this).dacNewsletterForm();
+    });
+  });
+})(jQuery);
 
-        $card.appendTo($stackDiv || column);
+/* globals METADATA, YOUTUBE_RESOURCES, BLOGGER_RESOURCES */
+window.metadata = {};
 
-      } while (++i < resources.length && stackCount > 0);
-    }
+/**
+ * Prepare metadata and indices for querying.
+ */
+window.metadata.prepare = (function() {
+  // Helper functions.
+  function mergeArrays() {
+    return Array.prototype.concat.apply([], arguments);
   }
 
-  /* Build a site map of resources using a section as a root. */
-  function buildSectionList(opts) {
-    if (opts.section && SECTION_BY_ID[opts.section]) {
-      return SECTION_BY_ID[opts.section].sections || [];
+  /**
+   * Creates lookup maps for a resource index.
+   * I.e. where MAP['some tag'][resource.id] === true when that resource has 'some tag'.
+   * @param resourceDict
+   * @returns {{}}
+   */
+  function buildResourceLookupMap(resourceDict) {
+    var map = {};
+    for (var key in resourceDict) {
+      var dictForKey = {};
+      var srcArr = resourceDict[key];
+      for (var i = 0; i < srcArr.length; i++) {
+        dictForKey[srcArr[i].index] = true;
+      }
+      map[key] = dictForKey;
     }
-    return [];
+    return map;
   }
 
-  function buildResourceList(opts) {
-    return $.queryResources(opts);
+  /**
+   * Merges metadata maps for english and the current language into the global store.
+   */
+  function mergeMetadataMap(name, locale) {
+    if (locale && locale !== 'en' && METADATA[locale]) {
+      METADATA[name] = $.extend(METADATA.en[name], METADATA[locale][name]);
+    } else {
+      METADATA[name] = METADATA.en[name];
+    }
   }
 
-  $.queryResources = function(opts) {
-    var maxResults = opts.maxResults || 100;
+  /**
+   * Index all resources by type, url, tag and category.
+   * @param resources
+   */
+  function createIndices(resources) {
+    // URL, type, tag and category lookups
+    var byType = METADATA.byType = {};
+    var byUrl = METADATA.byUrl = {};
+    var byTag = METADATA.byTag = {};
+    var byCategory = METADATA.byCategory = {};
+
+    for (var i = 0; i < resources.length; i++) {
+      var res = resources[i];
+
+      // Store index.
+      res.index = i;
+
+      // Index by type.
+      var type = res.type;
+      if (type) {
+        byType[type] = byType[type] || [];
+        byType[type].push(res);
+      }
 
-    var query = opts.query || '';
-    var expressions = parseResourceQuery(query);
-    var addedResourceIndices = {};
-    var results = [];
+      // Index by tag.
+      var tags = res.tags || [];
+      for (var j = 0; j < tags.length; j++) {
+        var tag = tags[j];
+        if (tag) {
+          byTag[tag] = byTag[tag] || [];
+          byTag[tag].push(res);
+        }
+      }
 
-    for (var i = 0; i < expressions.length; i++) {
-      var clauses = expressions[i];
+      // Index by category.
+      var category = res.category;
+      if (category) {
+        byCategory[category] = byCategory[category] || [];
+        byCategory[category].push(res);
+      }
 
-      // build initial set of resources from first clause
-      var firstClause = clauses[0];
-      var resources = [];
-      switch (firstClause.attr) {
-        case 'type':
-          resources = ALL_RESOURCES_BY_TYPE[firstClause.value];
-          break;
-        case 'lang':
-          resources = ALL_RESOURCES_BY_LANG[firstClause.value];
-          break;
-        case 'tag':
-          resources = ALL_RESOURCES_BY_TAG[firstClause.value];
-          break;
-        case 'collection':
-          var urls = RESOURCE_COLLECTIONS[firstClause.value].resources || [];
-          resources = urls.map(function(url){ return ALL_RESOURCES_BY_URL[url]; });
-          break;
-        case 'section':
-          var urls = SITE_MAP[firstClause.value].sections || [];
-          resources = urls.map(function(url){ return ALL_RESOURCES_BY_URL[url]; });
-          break;
+      // Index by url.
+      var url = res.url;
+      if (url) {
+        res.baseUrl = url.replace(/^intl\/\w+[\/]/, '');
+        byUrl[res.baseUrl] = res;
       }
-      // console.log(firstClause.attr + ':' + firstClause.value);
-      resources = resources || [];
+    }
+    METADATA.hasType = buildResourceLookupMap(byType);
+    METADATA.hasTag = buildResourceLookupMap(byTag);
+    METADATA.hasCategory = buildResourceLookupMap(byCategory);
+  }
+
+  return function() {
+    // Only once.
+    if (METADATA.all) { return; }
+
+    // Get current language.
+    var locale = getLangPref();
+
+    // Merge english resources.
+    METADATA.all = mergeArrays(
+      METADATA.en.about,
+      METADATA.en.design,
+      METADATA.en.distribute,
+      METADATA.en.develop,
+      YOUTUBE_RESOURCES,
+      BLOGGER_RESOURCES,
+      METADATA.en.extras
+    );
+
+    // Merge local language resources.
+    if (locale !== 'en' && METADATA[locale]) {
+      METADATA.all = mergeArrays(
+        METADATA.all,
+        METADATA[locale].about,
+        METADATA[locale].design,
+        METADATA[locale].distribute,
+        METADATA[locale].develop,
+        METADATA[locale].extras
+      );
+    }
+
+    mergeMetadataMap('collections', locale);
+    mergeMetadataMap('searchHeroCollections', locale);
+    mergeMetadataMap('carousel', locale);
+
+    // Create query indicies for resources.
+    createIndices(METADATA.all, locale);
+
+    // Reference metadata.
+    METADATA.androidReference = window.DATA;
+    METADATA.googleReference = mergeArrays(window.GMS_DATA, window.GCM_DATA);
+  };
+})();
 
-      // use additional clauses to filter corpus
-      if (clauses.length > 1) {
-        var otherClauses = clauses.slice(1);
-        resources = resources.filter(getResourceMatchesClausesFilter(otherClauses));
-      }
+/* global METADATA, util */
+window.metadata.query = (function($) {
+  var pageMap = {};
 
-      // filter out resources already added
-      if (i > 1) {
-        resources = resources.filter(getResourceNotAlreadyAddedFilter(addedResourceIndices));
-      }
+  function buildResourceList(opts) {
+    window.metadata.prepare();
+    var expressions = parseResourceQuery(opts.query || '');
+    var instanceMap = {};
+    var results = [];
 
-      // add to list of already added indices
-      for (var j = 0; j < resources.length; j++) {
-        if (resources[j]) {
-          addedResourceIndices[resources[j].index] = 1;
-        }
-      }
+    for (var i = 0; i < expressions.length; i++) {
+      var clauses = expressions[i];
 
-      // concat to final results list
-      results = results.concat(resources);
+      // Get all resources for first clause
+      var resources = getResourcesForClause(clauses.shift());
+
+      // Concat to final results list
+      results = results.concat(resources.map(filterResources(clauses, i > 0, instanceMap)).filter(filterEmpty));
     }
 
+    // Set correct order
     if (opts.sortOrder && results.length) {
-      var attr = opts.sortOrder;
-
-      if (opts.sortOrder == 'random') {
-        var i = results.length, j, temp;
-        while (--i) {
-          j = Math.floor(Math.random() * (i + 1));
-          temp = results[i];
-          results[i] = results[j];
-          results[j] = temp;
-        }
-      } else {
-        var desc = attr.charAt(0) == '-';
-        if (desc) {
-          attr = attr.substring(1);
-        }
-        results = results.sort(function(x,y) {
-          return (desc ? -1 : 1) * (parseInt(x[attr], 10) - parseInt(y[attr], 10));
-        });
-      }
+      results = opts.sortOrder === 'random' ? util.shuffle(results) : results.sort(sortResultsByKey(opts.sortOrder));
+    }
+
+    // Slice max results.
+    if (opts.maxResults !== Infinity) {
+      results = results.slice(0, opts.maxResults);
     }
 
-    results = results.filter(getResourceNotAlreadyAddedFilter(addedPageResources));
-    results = results.slice(0, maxResults);
+    // Remove page level duplicates
+    if (opts.allowDuplicates === undefined || opts.allowDuplicates === 'false') {
+      results = results.filter(removePageLevelDuplicates);
 
-    for (var j = 0; j < results.length; ++j) {
-      addedPageResources[results[j].index] = 1;
+      for (var index = 0; index < results.length; ++index) {
+        pageMap[results[index].index] = 1;
+      }
     }
 
     return results;
   }
 
-
-  function getResourceNotAlreadyAddedFilter(addedResourceIndices) {
+  function filterResources(clauses, removeDuplicates, map) {
     return function(resource) {
-      return resource && !addedResourceIndices[resource.index];
+      var resourceIsAllowed = true;
+
+      // References must be defined.
+      if (resource === undefined) {
+        return;
+      }
+
+      // Get canonical (localized) version of resource if possible.
+      resource = METADATA.byUrl[resource.baseUrl] || METADATA.byUrl[resource.url] || resource;
+
+      // Filter out resources already used
+      if (removeDuplicates) {
+        resourceIsAllowed = !map[resource.index];
+      }
+
+      // Must fulfill all criteria
+      if (clauses.length > 0) {
+        resourceIsAllowed = resourceIsAllowed && doesResourceMatchClauses(resource, clauses);
+      }
+
+      // Mark resource as used.
+      if (resourceIsAllowed) {
+        map[resource.index] = 1;
+      }
+
+      return resourceIsAllowed && resource;
     };
   }
 
+  function filterEmpty(resource) {
+    return resource;
+  }
+
+  function sortResultsByKey(key) {
+    var desc = key.charAt(0) === '-';
 
-  function getResourceMatchesClausesFilter(clauses) {
-    return function(resource) {
-      return doesResourceMatchClauses(resource, clauses);
+    if (desc) {
+      key = key.substring(1);
+    }
+
+    return function(x, y) {
+      return (desc ? -1 : 1) * (parseInt(x[key], 10) - parseInt(y[key], 10));
     };
   }
 
+  function getResourcesForClause(clause) {
+    switch (clause.attr) {
+      case 'type':
+        return METADATA.byType[clause.value];
+      case 'tag':
+        return METADATA.byTag[clause.value];
+      case 'collection':
+        var resources = METADATA.collections[clause.value] || {};
+        return getResourcesByUrlCollection(resources.resources);
+      case 'history':
+        return getResourcesByUrlCollection($.dacGetVisitedUrls(clause.value));
+      case 'section':
+        return getResourcesByUrlCollection([clause.value].sections);
+      default:
+        return [];
+    }
+  }
+
+  function getResourcesByUrlCollection(resources) {
+    return (resources || []).map(function(url) {
+      return METADATA.byUrl[url];
+    });
+  }
+
+  function removePageLevelDuplicates(resource) {
+    return resource && !pageMap[resource.index];
+  }
 
   function doesResourceMatchClauses(resource, clauses) {
     for (var i = 0; i < clauses.length; i++) {
       var map;
       switch (clauses[i].attr) {
         case 'type':
-          map = IS_RESOURCE_OF_TYPE[clauses[i].value];
-          break;
-        case 'lang':
-          map = IS_RESOURCE_IN_LANG[clauses[i].value];
+          map = METADATA.hasType[clauses[i].value];
           break;
         case 'tag':
-          map = IS_RESOURCE_TAGGED[clauses[i].value];
+          map = METADATA.hasTag[clauses[i].value];
           break;
       }
 
@@ -3931,19 +4892,10 @@ function showSamples() {
         return clauses[i].negative;
       }
     }
-    return true;
-  }
-
-  function cleanUrl(url)
-  {
-    if (url && url.indexOf('//') === -1) {
-      url = toRoot + url;
-    }
 
-    return url;
+    return true;
   }
 
-
   function parseResourceQuery(query) {
     // Parse query into array of expressions (expression e.g. 'tag:foo + type:video')
     var expressions = [];
@@ -3961,1136 +4913,975 @@ function showSamples() {
         var parts = clauseStr.split(':');
         var clause = {};
 
-        clause.attr = parts[0].replace(/^\s+|\s+$/g,'');
+        clause.attr = parts[0].replace(/^\s+|\s+$/g, '');
         if (clause.attr) {
-          if (clause.attr.charAt(0) == '+') {
+          if (clause.attr.charAt(0) === '+') {
             clause.attr = clause.attr.substring(1);
-          } else if (clause.attr.charAt(0) == '-') {
+          } else if (clause.attr.charAt(0) === '-') {
             clause.negative = true;
             clause.attr = clause.attr.substring(1);
           }
         }
 
         if (parts.length > 1) {
-          clause.value = parts[1].replace(/^\s+|\s+$/g,'');
-        }
-
-        clauses.push(clause);
-      }
-
-      if (!clauses.length) {
-        continue;
-      }
-
-      expressions.push(clauses);
-    }
-
-    return expressions;
-  }
-})();
-
-(function($) {
-
-  /*
-    Utility method for creating dom for the description area of a card.
-    Used in decorateResourceCard and decorateResource.
-  */
-  function buildResourceCardDescription(resource, plusone) {
-    var $description = $('<div>').addClass('description ellipsis');
-
-    $description.append($('<div>').addClass('text').html(resource.summary));
-
-    if (resource.cta) {
-      $description.append($('<a>').addClass('cta').html(resource.cta));
-    }
-
-    if (plusone) {
-      var plusurl = resource.url.indexOf("//") > -1 ? resource.url :
-        "//developer.android.com/" + resource.url;
-
-      $description.append($('<div>').addClass('util')
-        .append($('<div>').addClass('g-plusone')
-          .attr('data-size', 'small')
-          .attr('data-align', 'right')
-          .attr('data-href', plusurl)));
-    }
-
-    return $description;
-  }
-
-
-  /* Simple jquery function to create dom for a standard resource card */
-  $.fn.decorateResourceCard = function(resource,plusone) {
-    var section = resource.group || resource.type;
-    var imgUrl = resource.image ||
-      'assets/images/resource-card-default-android.jpg';
-
-    if (imgUrl.indexOf('//') === -1) {
-      imgUrl = toRoot + imgUrl;
-    }
-
-    if (resource.type === 'youtube') {
-      $('<div>').addClass('play-button')
-        .append($('<i class="dac-sprite dac-play-white">'))
-        .appendTo(this);
-    }
-
-    $('<div>').addClass('card-bg')
-      .css('background-image', 'url(' + (imgUrl || toRoot +
-        'assets/images/resource-card-default-android.jpg') + ')')
-      .appendTo(this);
-
-    $('<div>').addClass('card-info' + (!resource.summary ? ' empty-desc' : ''))
-      .append($('<div>').addClass('section').text(section))
-      .append($('<div>').addClass('title').html(resource.title))
-      .append(buildResourceCardDescription(resource, plusone))
-      .appendTo(this);
-
-    return this;
-  };
-
-  /* Simple jquery function to create dom for a resource section card (menu) */
-  $.fn.decorateResourceSection = function(section,plusone) {
-    var resource = section.resource;
-    //keep url clean for matching and offline mode handling
-    var urlPrefix = resource.image.indexOf("//") > -1 ? "" : toRoot;
-    var $base = $('<a>')
-        .addClass('card-bg')
-        .attr('href', resource.url)
-        .append($('<div>').addClass('card-section-icon')
-          .append($('<div>').addClass('icon'))
-          .append($('<div>').addClass('section').html(resource.title)))
-      .appendTo(this);
-
-    var $cardInfo = $('<div>').addClass('card-info').appendTo(this);
-
-    if (section.sections && section.sections.length) {
-      // Recurse the section sub-tree to find a resource image.
-      var stack = [section];
-
-      while (stack.length) {
-        if (stack[0].resource.image) {
-          $base.css('background-image', 'url(' + urlPrefix + stack[0].resource.image + ')');
-          break;
-        }
-
-        if (stack[0].sections) {
-          stack = stack.concat(stack[0].sections);
-        }
-
-        stack.shift();
-      }
-
-      var $ul = $('<ul>')
-        .appendTo($cardInfo);
-
-      var max = section.sections.length > 3 ? 3 : section.sections.length;
-
-      for (var i = 0; i < max; ++i) {
-
-        var subResource = section.sections[i];
-        if (!plusone) {
-          $('<li>')
-            .append($('<a>').attr('href', subResource.url)
-              .append($('<div>').addClass('title').html(subResource.title))
-              .append($('<div>').addClass('description ellipsis')
-                .append($('<div>').addClass('text').html(subResource.summary))
-                .append($('<div>').addClass('util'))))
-          .appendTo($ul);
-        } else {
-          $('<li>')
-            .append($('<a>').attr('href', subResource.url)
-              .append($('<div>').addClass('title').html(subResource.title))
-              .append($('<div>').addClass('description ellipsis')
-                .append($('<div>').addClass('text').html(subResource.summary))
-                .append($('<div>').addClass('util')
-                  .append($('<div>').addClass('g-plusone')
-                    .attr('data-size', 'small')
-                    .attr('data-align', 'right')
-                    .attr('data-href', resource.url)))))
-          .appendTo($ul);
-        }
-      }
-
-      // Add a more row
-      if (max < section.sections.length) {
-        $('<li>')
-          .append($('<a>').attr('href', resource.url)
-            .append($('<div>')
-              .addClass('title')
-              .text('More')))
-        .appendTo($ul);
-      }
-    } else {
-      // No sub-resources, just render description?
-    }
-
-    return this;
-  };
-
-
-
-
-  /* Render other types of resource styles that are not cards. */
-  $.fn.decorateResource = function(resource, opts) {
-    var imgUrl = resource.image ||
-      'assets/images/resource-card-default-android.jpg';
-    var linkUrl = resource.url;
-
-    if (imgUrl.indexOf('//') === -1) {
-      imgUrl = toRoot + imgUrl;
-    }
-
-    if (linkUrl && linkUrl.indexOf('//') === -1) {
-      linkUrl = toRoot + linkUrl;
-    }
-
-    $(this).append(
-      $('<div>').addClass('image')
-        .css('background-image', 'url(' + imgUrl + ')'),
-      $('<div>').addClass('info').append(
-        $('<h4>').addClass('title').html(resource.title),
-        $('<p>').addClass('summary').html(resource.summary),
-        $('<a>').attr('href', linkUrl).addClass('cta').html('Learn More')
-      )
-    );
-
-    return this;
-  };
-})(jQuery);
-
-
-/* Calculate the vertical area remaining */
-(function($) {
-    $.fn.ellipsisfade= function(lineHeight) {
-        this.each(function() {
-            // get element text
-            var $this = $(this);
-            var remainingHeight = $this.parent().parent().height();
-            $this.parent().siblings().each(function ()
-            {
-              if ($(this).is(":visible")) {
-                var h = $(this).outerHeight(true);
-                remainingHeight = remainingHeight - h;
-              }
-            });
-
-            adjustedRemainingHeight = ((remainingHeight)/lineHeight>>0)*lineHeight
-            $this.parent().css({'height': adjustedRemainingHeight});
-            $this.css({'height': "auto"});
-        });
-
-        return this;
-    };
-}) (jQuery);
-
-/*
-  Fullscreen Carousel
-
-  The following allows for an area at the top of the page that takes over the
-  entire browser height except for its top offset and an optional bottom
-  padding specified as a data attribute.
-
-  HTML:
-
-  <div class="fullscreen-carousel">
-    <div class="fullscreen-carousel-content">
-      <!-- content here -->
-    </div>
-    <div class="fullscreen-carousel-content">
-      <!-- content here -->
-    </div>
-
-    etc ...
+          clause.value = parts[1].replace(/^\s+|\s+$/g, '');
+        }
 
-  </div>
+        clauses.push(clause);
+      }
 
-  Control over how the carousel takes over the screen can mostly be defined in
-  a css file. Setting min-height on the .fullscreen-carousel-content elements
-  will prevent them from shrinking to far vertically when the browser is very
-  short, and setting max-height on the .fullscreen-carousel itself will prevent
-  the area from becoming to long in the case that the browser is stretched very
-  tall.
+      if (!clauses.length) {
+        continue;
+      }
 
-  There is limited functionality for having multiple sections since that request
-  was removed, but it is possible to add .next-arrow and .prev-arrow elements to
-  scroll between multiple content areas.
-*/
+      expressions.push(clauses);
+    }
 
-(function() {
-  $(document).ready(function() {
-    $('.fullscreen-carousel').each(function() {
-      initWidget(this);
-    });
-  });
+    return expressions;
+  }
 
-  function initWidget(widget) {
-    var $widget = $(widget);
+  return buildResourceList;
+})(jQuery);
 
-    var topOffset = $widget.offset().top;
-    var padBottom = parseInt($widget.data('paddingbottom')) || 0;
-    var maxHeight = 0;
-    var minHeight = 0;
-    var $content = $widget.find('.fullscreen-carousel-content');
-    var $nextArrow = $widget.find('.next-arrow');
-    var $prevArrow = $widget.find('.prev-arrow');
-    var $curSection = $($content[0]);
+/* global METADATA, getLangPref */
 
-    if ($content.length <= 1) {
-      $nextArrow.hide();
-      $prevArrow.hide();
-    } else {
-      $nextArrow.click(function() {
-        var index = ($content.index($curSection) + 1);
-        $curSection.hide();
-        $curSection = $($content[index >= $content.length ? 0 : index]);
-        $curSection.show();
-      });
+window.metadata.search = (function() {
+  'use strict';
 
-      $prevArrow.click(function() {
-        var index = ($content.index($curSection) - 1);
-        $curSection.hide();
-        $curSection = $($content[index < 0 ? $content.length - 1 : 0]);
-        $curSection.show();
-      });
-    }
+  var currentLang = getLangPref();
 
-    // Just hide all content sections except first.
-    $content.each(function(index) {
-      if ($(this).height() > minHeight) minHeight = $(this).height();
-      $(this).css({position: 'absolute',  display: index > 0 ? 'none' : ''});
-    });
+  function search(query) {
+    window.metadata.prepare();
+    return {
+      android: findDocsMatches(query, METADATA.androidReference),
+      docs: findDocsMatches(query, METADATA.googleReference),
+      resources: findResourceMatches(query)
+    };
+  }
 
-    // Register for changes to window size, and trigger.
-    $(window).resize(resizeWidget);
-    resizeWidget();
+  function findDocsMatches(query, data) {
+    var results = [];
 
-    function resizeWidget() {
-      var height = $(window).height() - topOffset - padBottom;
-      $widget.width($(window).width());
-      $widget.height(height < minHeight ? minHeight :
-        (maxHeight && height > maxHeight ? maxHeight : height));
+    for (var i = 0; i < data.length; i++) {
+      var s = data[i];
+      if (query.length !== 0 && s.label.toLowerCase().indexOf(query.toLowerCase()) !== -1) {
+        results.push(s);
+      }
     }
+
+    rankAutocompleteApiResults(query, results);
+
+    return results;
   }
-})();
 
+  function findResourceMatches(query) {
+    var results = [];
 
+    // Search for matching JD docs
+    if (query.length >= 2) {
+      /* In some langs, spaces may be optional between certain non-Ascii word-glyphs. For
+       * those langs, only match query at word boundaries if query includes Ascii chars only.
+       */
+      var NO_BOUNDARY_LANGUAGES = ['ja','ko','vi','zh-cn','zh-tw'];
+      var isAsciiOnly = /^[\u0000-\u007f]*$/.test(query);
+      var noBoundaries = (NO_BOUNDARY_LANGUAGES.indexOf(window.getLangPref()) !== -1);
+      var exprBoundary = (!isAsciiOnly && noBoundaries) ? '' : '(?:^|\\s)';
+      var queryRegex = new RegExp(exprBoundary + query.toLowerCase(), 'g');
+        
+      var all = METADATA.all;
+      for (var i = 0; i < all.length; i++) {
+        // current search comparison, with counters for tag and title,
+        // used later to improve ranking
+        var s = all[i];
+        s.matched_tag = 0;
+        s.matched_title = 0;
+        var matched = false;
+
+        // Check if query matches any tags; work backwards toward 1 to assist ranking
+        if (s.keywords) {
+          for (var j = s.keywords.length - 1; j >= 0; j--) {
+            // it matches a tag
+            if (s.keywords[j].toLowerCase().match(queryRegex)) {
+              matched = true;
+              s.matched_tag = j + 1; // add 1 to index position
+            }
+          }
+        }
 
+        // Check if query matches doc title
+        if (s.title.toLowerCase().match(queryRegex)) {
+          matched = true;
+          s.matched_title = 1;
+        }
 
+        // Remember the doc if it matches either
+        if (matched) {
+          results.push(s);
+        }
+      }
 
-/*
-  Tab Carousel
+      // Improve the current results
+      results = lookupBetterResult(results);
 
-  The following allows tab widgets to be installed via the html below. Each
-  tab content section should have a data-tab attribute matching one of the
-  nav items'. Also each tab content section should have a width matching the
-  tab carousel.
+      // Rank/sort all the matched pages
+      rankAutocompleteDocResults(results);
 
-  HTML:
+      return results;
+    }
+  }
 
-  <div class="tab-carousel">
-    <ul class="tab-nav">
-      <li><a href="#" data-tab="handsets">Handsets</a>
-      <li><a href="#" data-tab="wearable">Wearable</a>
-      <li><a href="#" data-tab="tv">TV</a>
-    </ul>
+  // Replaces a match with another resource by url, if it exists.
+  function lookupReplacementByUrl(match, url) {
+    var replacement = METADATA.byUrl[url];
 
-    <div class="tab-carousel-content">
-      <div data-tab="handsets">
-        <!--Full width content here-->
-      </div>
+    // Replacement resource does not exists.
+    if (!replacement) { return; }
 
-      <div data-tab="wearable">
-        <!--Full width content here-->
-      </div>
+    replacement.matched_title = Math.max(replacement.matched_title, match.matched_title);
+    replacement.matched_tag = Math.max(replacement.matched_tag, match.matched_tag);
 
-      <div data-tab="tv">
-        <!--Full width content here-->
-      </div>
-    </div>
-  </div>
+    return replacement;
+  }
 
-*/
-(function() {
-  $(document).ready(function() {
-    $('.tab-carousel').each(function() {
-      initWidget(this);
-    });
-  });
+  // Find the localized version of a page if it exists.
+  function lookupLocalizedVersion(match) {
+    return METADATA.byUrl[match.baseUrl] || METADATA.byUrl[match.url];
+  }
 
-  function initWidget(widget) {
-    var $widget = $(widget);
-    var $nav = $widget.find('.tab-nav');
-    var $anchors = $nav.find('[data-tab]');
-    var $li = $nav.find('li');
-    var $contentContainer = $widget.find('.tab-carousel-content');
-    var $tabs = $contentContainer.find('[data-tab]');
-    var $curTab = $($tabs[0]); // Current tab is first tab.
-    var width = $widget.width();
+  // Find the main page for a tutorial when matching a subpage.
+  function lookupTutorialIndex(match) {
+    // Guard for non index tutorial pages.
+    if (match.type !== 'training' || match.url.indexOf('index.html') >= 0) { return; }
 
-    // Setup nav interactivity.
-    $anchors.click(function(evt) {
-      evt.preventDefault();
-      var query = '[data-tab=' + $(this).data('tab') + ']';
-      transitionWidget($tabs.filter(query));
-    });
+    var indexUrl = match.url.replace(/[^\/]+$/, 'index.html');
+    return lookupReplacementByUrl(match, indexUrl);
+  }
 
-    // Add highlight for navigation on first item.
-    var $highlight = $('<div>').addClass('highlight')
-      .css({left:$li.position().left + 'px', width:$li.outerWidth() + 'px'})
-      .appendTo($nav);
+  // Find related results which are a better match for the user.
+  function lookupBetterResult(matches) {
+    var newMatches = [];
 
-    // Store height since we will change contents to absolute.
-    $contentContainer.height($contentContainer.height());
+    matches = matches.filter(function(match) {
+      var newMatch = match;
+      newMatch = lookupTutorialIndex(newMatch) || newMatch;
+      newMatch = lookupLocalizedVersion(newMatch) || newMatch;
 
-    // Absolutely position tabs so they're ready for transition.
-    $tabs.each(function(index) {
-      $(this).css({position: 'absolute', left: index > 0 ? width + 'px' : '0'});
+      if (newMatch !== match) {
+        newMatches.push(newMatch);
+      }
+
+      return newMatch === match;
     });
 
-    function transitionWidget($toTab) {
-      if (!$curTab.is($toTab)) {
-        var curIndex = $tabs.index($curTab[0]);
-        var toIndex = $tabs.index($toTab[0]);
-        var dir = toIndex > curIndex ? 1 : -1;
+    return toUnique(newMatches.concat(matches));
+  }
 
-        // Animate content sections.
-        $toTab.css({left:(width * dir) + 'px'});
-        $curTab.animate({left:(width * -dir) + 'px'});
-        $toTab.animate({left:'0'});
+  /* Order the jd doc result list based on match quality */
+  function rankAutocompleteDocResults(matches) {
+    if (!matches || !matches.length) {
+      return;
+    }
 
-        // Animate navigation highlight.
-        $highlight.animate({left:$($li[toIndex]).position().left + 'px',
-          width:$($li[toIndex]).outerWidth() + 'px'})
+    var _resultScoreFn = function(match) {
+      var score = 1.0;
 
-        // Store new current section.
-        $curTab = $toTab;
+      // if the query matched a tag
+      if (match.matched_tag > 0) {
+        // multiply score by factor relative to position in tags list (max of 3)
+        score *= 3 / match.matched_tag;
+
+        // if it also matched the title
+        if (match.matched_title > 0) {
+          score *= 2;
+        }
+      } else if (match.matched_title > 0) {
+        score *= 3;
       }
-    }
-  }
-})();
 
-/**
- * Auto TOC
- *
- * Upgrades h2s on the page to have a rule and be toggle-able on mobile.
- */
-(function($) {
-  var upgraded = false;
-  var h2Titles;
+      if (match.lang === currentLang) {
+        score *= 5;
+      }
 
-  function initWidget() {
-    // add HRs below all H2s (except for a few other h2 variants)
-    // Consider doing this with css instead.
-    h2Titles = $('h2').not('#qv h2, #tb h2, .sidebox h2, #devdoc-nav h2, h2.norule');
-    h2Titles.css({marginBottom:0}).after('<hr/>');
+      return score;
+    };
 
-    // Exit early if on older browser.
-    if (!window.matchMedia) {
-      return;
+    for (var i = 0; i < matches.length; i++) {
+      matches[i].__resultScore = _resultScoreFn(matches[i]);
     }
 
-    // Only run logic in mobile layout.
-    var query = window.matchMedia('(max-width: 719px)');
-    if (query.matches) {
-      makeTogglable();
-    } else {
-      query.addListener(makeTogglable);
-    }
-  }
+    matches.sort(function(a, b) {
+      var n = b.__resultScore - a.__resultScore;
 
-  function makeTogglable() {
-    // Only run this logic once.
-    if (upgraded) { return; }
-    upgraded = true;
+      if (n === 0) {
+        // lexicographical sort if scores are the same
+        n = (a.title < b.title) ? -1 : 1;
+      }
 
-    // Only make content h2s togglable.
-    var contentTitles = h2Titles.filter('#jd-content *');
+      return n;
+    });
+  }
 
-    // If there are more than 1
-    if (contentTitles.size() < 2) {
+  /* Order the result list based on match quality */
+  function rankAutocompleteApiResults(query, matches) {
+    query = query || '';
+    if (!matches || !matches.length) {
       return;
     }
 
-    contentTitles.each(function() {
-      // Find all the relevant nodes.
-      var $title = $(this);
-      var $hr = $title.next();
-      var $contents = $hr.nextUntil('h2, .next-docs');
-      var $section = $($title)
-        .add($hr)
-        .add($title.prev('a[name]'))
-        .add($contents);
-      var $anchor = $section.first().prev();
-      var anchorMethod = 'after';
-      if ($anchor.length === 0) {
-        $anchor = $title.parent();
-        anchorMethod = 'prepend';
+    // helper function that gets the last occurence index of the given regex
+    // in the given string, or -1 if not found
+    var _lastSearch = function(s, re) {
+      if (s === '') {
+        return -1;
+      }
+      var l = -1;
+      var tmp;
+      while ((tmp = s.search(re)) >= 0) {
+        if (l < 0) {
+          l = 0;
+        }
+        l += tmp;
+        s = s.substr(tmp + 1);
       }
+      return l;
+    };
 
-      // Some h2s are in their own container making it pretty hard to find the end, so skip.
-      if ($contents.length === 0) {
-        return;
+    // helper function that counts the occurrences of a given character in
+    // a given string
+    var _countChar = function(s, c) {
+      var n = 0;
+      for (var i = 0; i < s.length; i++) {
+        if (s.charAt(i) === c) {
+          ++n;
+        }
       }
+      return n;
+    };
 
-      // Remove from DOM before messing with it. DOM is slow!
-      $section.detach();
+    var queryLower = query.toLowerCase();
+    var queryAlnum = (queryLower.match(/\w+/) || [''])[0];
+    var partPrefixAlnumRE = new RegExp('\\b' + queryAlnum);
+    var partExactAlnumRE = new RegExp('\\b' + queryAlnum + '\\b');
 
-      // Add mobile-only expand arrows.
-      $title.prepend('<span class="dac-visible-mobile-inline-block">' +
-          '<i class="dac-toggle-expand dac-sprite dac-expand-more-black"></i>' +
-          '<i class="dac-toggle-collapse dac-sprite dac-expand-less-black"></i>' +
-          '</span>')
-        .attr('data-toggle', 'section');
+    var _resultScoreFn = function(result) {
+      // scores are calculated based on exact and prefix matches,
+      // and then number of path separators (dots) from the last
+      // match (i.e. favoring classes and deep package names)
+      var score = 1.0;
+      var labelLower = result.label.toLowerCase();
+      var t;
+      var partsAfter;
+      t = _lastSearch(labelLower, partExactAlnumRE);
+      if (t >= 0) {
+        // exact part match
+        partsAfter = _countChar(labelLower.substr(t + 1), '.');
+        score *= 200 / (partsAfter + 1);
+      } else {
+        t = _lastSearch(labelLower, partPrefixAlnumRE);
+        if (t >= 0) {
+          // part prefix match
+          partsAfter = _countChar(labelLower.substr(t + 1), '.');
+          score *= 20 / (partsAfter + 1);
+        }
+      }
 
-      // Wrap in magic markup.
-      $section = $section.wrapAll('<div class="dac-toggle dac-mobile">').parent();
-      $contents.wrapAll('<div class="dac-toggle-content"><div>'); // extra div used for max-height calculation.
+      return score;
+    };
 
-      // Pre-expand section if requested.
-      if ($title.hasClass('is-expanded')) {
-        $section.addClass('is-expanded');
+    for (var i = 0; i < matches.length; i++) {
+      // if the API is deprecated, default score is 0; otherwise, perform scoring
+      if (matches[i].deprecated === 'true') {
+        matches[i].__resultScore = 0;
+      } else {
+        matches[i].__resultScore = _resultScoreFn(matches[i]);
       }
+    }
 
-      // Pre-expand section if targetted by hash.
-      if (location.hash && $section.find(location.hash).length) {
-        $section.addClass('is-expanded');
+    matches.sort(function(a, b) {
+      var n = b.__resultScore - a.__resultScore;
+
+      if (n === 0) {
+        // lexicographical sort if scores are the same
+        n = (a.label < b.label) ? -1 : 1;
       }
 
-      // Add it back to the dom.
-      $anchor[anchorMethod].call($anchor, $section);
+      return n;
     });
   }
 
-  $(function() {
-    initWidget();
-  });
-})(jQuery);
+  // Destructive but fast toUnique.
+  // http://stackoverflow.com/a/25082874
+  function toUnique(array) {
+    var c;
+    var b = array.length || 1;
+
+    while (c = --b) {
+      while (c--) {
+        if (array[b] === array[c]) {
+          array.splice(c, 1);
+        }
+      }
+    }
+    return array;
+  }
+
+  return search;
+})();
 
 (function($) {
   'use strict';
 
   /**
-   * Toggle Floating Label state.
-   * @param {HTMLElement} el - The DOM element.
+   * Smoothly scroll to location on current page.
+   * @param el
    * @param options
    * @constructor
    */
-  function FloatingLabel(el, options) {
+  function ScrollButton(el, options) {
     this.el = $(el);
-    this.options = $.extend({}, FloatingLabel.DEFAULTS_, options);
-    this.group = this.el.closest('.dac-form-input-group');
-    this.input = this.group.find('.dac-form-input');
+    this.target = $(this.el.attr('href'));
+    this.options = $.extend({}, ScrollButton.DEFAULTS_, options);
 
-    this.checkValue_ = this.checkValue_.bind(this);
-    this.checkValue_();
+    if (typeof this.options.offset === 'string') {
+      this.options.offset = $(this.options.offset).height();
+    }
 
-    this.input.on('focus', function() {
-      this.group.addClass('dac-focused');
-    }.bind(this));
-    this.input.on('blur', function() {
-      this.group.removeClass('dac-focused');
-      this.checkValue_();
-    }.bind(this));
-    this.input.on('keyup', this.checkValue_);
+    this.el.on('click', this.clickHandler_.bind(this));
   }
 
   /**
-   * The label is moved out of the textbox when it has a value.
+   * Default options
+   * @type {{duration: number, easing: string, offset: number, scrollContainer: string}}
+   * @private
    */
-  FloatingLabel.prototype.checkValue_ = function() {
-    if (this.input.val().length) {
-      this.group.addClass('dac-has-value');
-    } else {
-      this.group.removeClass('dac-has-value');
+  ScrollButton.DEFAULTS_ = {
+    duration: 300,
+    easing: 'swing',
+    offset: '.dac-header',
+    scrollContainer: 'html, body'
+  };
+
+  /**
+   * Scroll logic
+   * @param event
+   * @private
+   */
+  ScrollButton.prototype.clickHandler_ = function(event) {
+    if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) {
+      return;
     }
+
+    event.preventDefault();
+
+    var position = this.getTargetPosition();
+    $(this.options.scrollContainer).animate({
+      scrollTop: position - this.options.offset
+    }, this.options);
+  };
+
+  ScrollButton.prototype.getTargetPosition = function() {
+    if (this.options.scrollContainer === ScrollButton.DEFAULTS_.scrollContainer) {
+      return this.target.offset().top;
+    }
+    var scrollContainer = $(this.options.scrollContainer)[0];
+    var currentEl = this.target[0];
+    var pos = 0;
+    while (currentEl !== scrollContainer && currentEl !== null) {
+      pos += currentEl.offsetTop;
+      currentEl = currentEl.offsetParent;
+    }
+    return pos;
   };
 
   /**
    * jQuery plugin
    * @param  {object} options - Override default options.
    */
-  $.fn.dacFloatingLabel = function(options) {
+  $.fn.dacScrollButton = function(options) {
     return this.each(function() {
-      new FloatingLabel(this, options);
+      new ScrollButton(this, options);
     });
   };
 
+  /**
+   * Data Attribute API
+   */
   $(document).on('ready.aranja', function() {
-    $('.dac-form-floatlabel').each(function() {
-      $(this).dacFloatingLabel($(this).data());
+    $('[data-scroll-button]').each(function() {
+      $(this).dacScrollButton($(this).data());
     });
   });
 })(jQuery);
 
-/* global toRoot, CAROUSEL_OVERRIDE */
+/* global getLangPref */
 (function($) {
-  // Ordering matters
-  var TAG_MAP = [
-    {from: 'developerstory', to: 'Android Developer Story'},
-    {from: 'googleplay', to: 'Google Play'}
-  ];
-
-  function DacCarouselQuery(el) {
-    this.el = $(el);
+  var LANG;
 
-    var opts = this.el.data();
-    opts.maxResults = parseInt(opts.maxResults || '100', 10);
-    opts.query = opts.carouselQuery;
-    var resources = $.queryResources(opts);
+  function getSearchLang() {
+    if (!LANG) {
+      LANG = getLangPref();
 
-    this.el.empty();
-    $(resources).map(function() {
-      var resource = $.extend({}, this, CAROUSEL_OVERRIDE[this.url]);
-      var slide = $('<article class="dac-expand dac-hero">');
-      var image = cleanUrl(resource.heroImage || resource.image);
-      var fullBleed = image && !resource.heroColor;
+      // Fix zh-cn to be zh-CN.
+      LANG = LANG.replace(/-\w+/, function(m) { return m.toUpperCase(); });
+    }
+    return LANG;
+  }
 
-      // Configure background
-      slide.css({
-        backgroundImage: fullBleed ? 'url(' + image + ')' : '',
-        backgroundColor: resource.heroColor || ''
-      });
+  function customSearch(query, start) {
+    var searchParams = {
+      // current cse instance:
+      //cx: '001482626316274216503:zu90b7s047u',
+      // new cse instance:
+      cx: '000521750095050289010:zpcpi1ea4s8',
+      key: 'AIzaSyCFhbGnjW06dYwvRCU8h_zjdpS4PYYbEe8',
+      q: query,
+      start: start || 1,
+      num: 6,
+      hl: getSearchLang(),
+      fields: 'queries,items(pagemap,link,title,htmlSnippet,formattedUrl)'
+    };
 
-      // Should copy be inverted
-      slide.toggleClass('dac-invert', resource.heroInvert || fullBleed);
-      slide.toggleClass('dac-darken', fullBleed);
+    return $.get('https://content.googleapis.com/customsearch/v1?' +  $.param(searchParams));
+  }
 
-      // Should be clickable
-      slide.append($('<a class="dac-hero-carousel-action">').attr('href', cleanUrl(resource.url)));
+  function renderResults(el, results) {
+    if (!results.items) {
+      el.append($('<div>').text('No results'));
+      return;
+    }
 
-      var cols = $('<div class="cols dac-hero-content">');
+    for (var i = 0; i < results.items.length; i++) {
+      var item = results.items[i];
+      var hasImage = item.pagemap && item.pagemap.cse_thumbnail;
+      var sectionMatch = item.link.match(/developer\.android\.com\/(\w*)/);
+      var section = (sectionMatch && sectionMatch[1]) || 'blog';
 
-      // inline image column
-      var rightCol = $('<div class="col-1of2 col-push-1of2 dac-hero-figure">')
-        .appendTo(cols);
+      var entry = $('<div>').addClass('dac-custom-search-entry cols');
 
-      if (!fullBleed && image) {
-        rightCol.append($('<img>').attr('src', image));
+      if (hasImage) {
+        var image = item.pagemap.cse_thumbnail[0];
+        entry.append($('<div>').addClass('col-1of6')
+          .append($('<div>').addClass('dac-custom-search-image').css('background-image', 'url(' + image.src + ')')));
       }
 
-      // info column
-      $('<div class="col-1of2 col-pull-1of2">')
-        .append($('<div class="dac-hero-tag">').text(formatTag(resource)))
-        .append($('<h1 class="dac-hero-title">').text(formatTitle(resource)))
-        .append($('<p class="dac-hero-description">').text(resource.summary))
-        .append($('<a class="dac-hero-cta">')
-          .text(formatCTA(resource))
-          .attr('href', cleanUrl(resource.url))
-          .prepend($('<span class="dac-sprite dac-auto-chevron">'))
+      entry.append($('<div>').addClass(hasImage ? 'col-5of6' : 'col-6of6')
+        .append($('<p>').addClass('dac-custom-search-section').text(section))
+        .append(
+          $('<a>').text(item.title).attr('href', item.link).wrap('<h2>').parent().addClass('dac-custom-search-title')
         )
-        .appendTo(cols);
+        .append($('<p>').addClass('dac-custom-search-snippet').html(item.htmlSnippet.replace(/<br>/g, '')))
+        .append($('<a>').addClass('dac-custom-search-link').text(item.formattedUrl).attr('href', item.link)));
 
-      slide.append(cols.wrap('<div class="wrap">').parent());
-      return slide[0];
-    }).prependTo(this.el);
-
-    // Pagination element.
-    this.el.append('<div class="dac-hero-carousel-pagination"><div class="wrap" data-carousel-pagination>');
+      el.append(entry);
+    }
 
-    this.el.dacCarousel();
-  }
+    if (results.queries.nextPage) {
+      var loadMoreButton = $('<button id="dac-custom-search-load-more">')
+        .addClass('dac-custom-search-load-more')
+        .text('Load more')
+        .click(function() {
+          loadMoreResults(el, results);
+        });
 
-  function cleanUrl(url) {
-    if (url && url.indexOf('//') === -1) {
-      url = toRoot + url;
+      el.append(loadMoreButton);
     }
-    return url;
   }
 
-  function formatTag(resource) {
-    // Hmm, need a better more scalable solution for this.
-    for (var i = 0, mapping; mapping = TAG_MAP[i]; i++) {
-      if (resource.tags.indexOf(mapping.from) > -1) {
-        return mapping.to;
-      }
-    }
-    return resource.type;
-  }
+  function loadMoreResults(el, results) {
+    var query = results.queries.request.searchTerms;
+    var start = results.queries.nextPage.startIndex;
+    var loadMoreButton = el.find('#dac-custom-search-load-more');
 
-  function formatTitle(resource) {
-    return resource.title.replace(/android developer story: /i, '');
-  }
+    loadMoreButton.text('Loading more...');
 
-  function formatCTA(resource) {
-    return resource.type === 'youtube' ? 'Watch the video' : 'Learn more';
+    customSearch(query, start).then(function(results) {
+      loadMoreButton.remove();
+      renderResults(el, results);
+    });
   }
 
-  // jQuery plugin
-  $.fn.dacCarouselQuery = function() {
-    return this.each(function() {
-      var el = $(this);
-      var data = el.data('dac.carouselQuery');
+  $.fn.customSearch = function(query) {
+    var el = $(this);
 
-      if (!data) { el.data('dac.carouselQuery', (data = new DacCarouselQuery(el))); }
+    customSearch(query).then(function(results) {
+      el.empty();
+      renderResults(el, results);
     });
   };
-
-  // Data API
-  $(function() {
-    $('[data-carousel-query]').dacCarouselQuery();
-  });
 })(jQuery);
 
+/* global METADATA */
+
 (function($) {
-  /**
-   * A CSS based carousel, inspired by SequenceJS.
-   * @param {jQuery} el
-   * @param {object} options
-   * @constructor
-   */
-  function DacCarousel(el, options) {
-    this.el = $(el);
-    this.options = options = $.extend({}, DacCarousel.OPTIONS, this.el.data(), options || {});
-    this.frames = this.el.find(options.frameSelector);
-    this.count = this.frames.size();
-    this.current = options.start;
+  $.fn.dacSearchRenderHero = function(resources, query) {
+    var el = $(this);
+    el.empty();
 
-    this.initPagination();
-    this.initEvents();
-    this.initFrame();
-  }
+    var resource = METADATA.searchHeroCollections[query];
 
-  DacCarousel.OPTIONS = {
-    auto:      true,
-    autoTime:  10000,
-    autoMinTime: 5000,
-    btnPrev:   '[data-carousel-prev]',
-    btnNext:   '[data-carousel-next]',
-    frameSelector: 'article',
-    loop:      true,
-    start:     0,
-    swipeThreshold: 160,
-    pagination: '[data-carousel-pagination]'
-  };
+    if (resource) {
+      el.dacHero(resource, true);
+      el.show();
 
-  DacCarousel.prototype.initPagination = function() {
-    this.pagination = $([]);
-    if (!this.options.pagination) { return; }
+      return true;
+    } else {
+      el.hide();
+    }
+  };
+})(jQuery);
 
-    var pagination = $('<ul class="dac-pagination">');
-    var parent = this.el;
-    if (typeof this.options.pagination === 'string') { parent = this.el.find(this.options.pagination); }
+(function($) {
+  $.fn.dacSearchRenderReferences = function(results, query) {
+    var referenceCard = $('.suggest-card.reference');
+    referenceCard.data('searchreferences.dac', {results: results, query: query});
+    renderResults(referenceCard, results, query, false);
+  };
 
-    if (this.count > 1) {
-      for (var i = 0; i < this.count; i++) {
-        var li = $('<li class="dac-pagination-item">').text(i);
-        if (i === this.options.start) { li.addClass('active'); }
-        li.click(this.go.bind(this, i));
+  var ROW_COUNT_COLLAPSED = 7;
+  var ROW_COUNT_EXPANDED = 33;
+  var ROW_COUNT_GOOGLE_COLLAPSED = 1;
+  var ROW_COUNT_GOOGLE_EXPANDED = 8;
 
-        pagination.append(li);
-      }
-      this.pagination = pagination.children();
-      parent.append(pagination);
+  function onSuggestionClick(e) {
+    var normalClick = e.which === 1 && !e.ctrlKey && !e.shiftKey && !e.metaKey;
+    if (normalClick) {
+      e.preventDefault();
     }
-  };
 
-  DacCarousel.prototype.initEvents = function() {
-    var that = this;
+    // When user clicks a suggested document, track it
+    var url = $(e.currentTarget).attr('href');
+    ga('send', 'event', 'Suggestion Click', 'clicked: ' + url,
+        'query: ' + $('#search_autocomplete').val().toLowerCase(),
+        {hitCallback: function() {
+          if (normalClick) {
+            document.location = url;
+          }
+        }});
+  }
 
-    this.touch = {
-      start: {x: 0, y: 0},
-      end:   {x: 0, y: 0}
-    };
+  function buildLink(match) {
+    var link = $('<a>').attr('href', window.toRoot + match.link);
 
-    this.el.on('touchstart', this.touchstart_.bind(this));
-    this.el.on('touchend', this.touchend_.bind(this));
-    this.el.on('touchmove', this.touchmove_.bind(this));
+    var label = match.label;
+    var classNameStart = label.match(/[A-Z]/) ? label.search(/[A-Z]/) : label.lastIndexOf('.') + 1;
 
-    this.el.hover(function() {
-      that.pauseRotateTimer();
-    }, function() {
-      that.startRotateTimer();
-    });
+    var newLink = '<span class="namespace">' +
+      label.substr(0, classNameStart) +
+      '</span><br />' +
+      label.substr(classNameStart, label.length);
 
-    $(this.options.btnPrev).click(function(e) {
-      e.preventDefault();
-      that.prev();
-    });
+    link.html(newLink);
+    return link;
+  }
 
-    $(this.options.btnNext).click(function(e) {
-      e.preventDefault();
-      that.next();
-    });
-  };
+  function buildSuggestion(match, query) {
+    var li = $('<li>').addClass('dac-search-results-reference-entry');
 
-  DacCarousel.prototype.touchstart_ = function(event) {
-    var t = event.originalEvent.touches[0];
-    this.touch.start = {x: t.screenX, y: t.screenY};
-  };
+    var link = buildLink(match);
+    link.highlightMatches(query);
+    li.append(link);
+    return li[0];
+  }
 
-  DacCarousel.prototype.touchend_ = function() {
-    var deltaX = this.touch.end.x - this.touch.start.x;
-    var deltaY = Math.abs(this.touch.end.y - this.touch.start.y);
-    var shouldSwipe = (deltaY < Math.abs(deltaX)) && (Math.abs(deltaX) >= this.options.swipeThreshold);
+  function buildResults(results, query) {
+    return results.map(function(match) {
+      return buildSuggestion(match, query);
+    });
+  }
 
-    if (shouldSwipe) {
-      if (deltaX > 0) {
-        this.prev();
-      } else {
-        this.next();
-      }
+  function renderAndroidResults(list, gMatches, query) {
+    list.empty();
+
+    var header = $('<li class="dac-search-results-reference-header">Reference</li>');
+    list.append(header);
+
+    if (gMatches.length > 0) {
+      list.removeClass('no-results');
+
+      var resources = buildResults(gMatches, query);
+      list.append(resources);
+
+      return true;
+    } else {
+      list.append('<li class="dac-search-results-reference-entry-empty">No results</li>');
     }
-  };
+  }
 
-  DacCarousel.prototype.touchmove_ = function(event) {
-    var t = event.originalEvent.touches[0];
-    this.touch.end = {x: t.screenX, y: t.screenY};
-  };
+  function renderGoogleDocsResults(list, gGoogleMatches, query) {
+    list = $('.suggest-card.reference ul');
 
-  DacCarousel.prototype.initFrame = function() {
-    this.frames.removeClass('active').eq(this.options.start).addClass('active');
-  };
+    if (gGoogleMatches.length > 0) {
+      list.append('<li class="dac-search-results-reference-header">in Google Services</li>');
 
-  DacCarousel.prototype.startRotateTimer = function() {
-    if (!this.options.auto || this.rotateTimer) { return; }
-    this.rotateTimer = setTimeout(this.next.bind(this), this.options.autoTime);
-  };
+      var resources = buildResults(gGoogleMatches, query);
+      list.append(resources);
 
-  DacCarousel.prototype.pauseRotateTimer = function() {
-    clearTimeout(this.rotateTimer);
-    this.rotateTimer = null;
-  };
+      return true;
+    }
+  }
 
-  DacCarousel.prototype.prev = function() {
-    this.go(this.current - 1);
-  };
+  function renderResults(referenceCard, results, query, expanded) {
+    var list = referenceCard.find('ul');
+    list.toggleClass('is-expanded', !!expanded);
 
-  DacCarousel.prototype.next = function() {
-    this.go(this.current + 1);
-  };
+    // Figure out how many results we can show in our fixed size box.
+    var total = expanded ? ROW_COUNT_EXPANDED : ROW_COUNT_COLLAPSED;
+    var googleCount = expanded ? ROW_COUNT_GOOGLE_EXPANDED : ROW_COUNT_GOOGLE_COLLAPSED;
+    googleCount = Math.max(googleCount, total - results.android.length);
+    googleCount = Math.min(googleCount, results.docs.length);
 
-  DacCarousel.prototype.go = function(next) {
-    // Figure out what the next slide is.
-    while (this.count > 0 && next >= this.count) { next -= this.count; }
-    while (next < 0) { next += this.count; }
+    if (googleCount > 0) {
+      // If there are google results, reserve space for its header.
+      googleCount++;
+    }
 
-    // Cancel if we're already on that slide.
-    if (next === this.current) { return; }
+    var androidCount = Math.max(0, total - googleCount);
+    if (androidCount === 0) {
+      // Reserve space for "No reference results"
+      googleCount--;
+    }
 
-    // Prepare next slide.
-    this.frames.eq(next).removeClass('out');
+    renderAndroidResults(list, results.android.slice(0, androidCount), query);
+    renderGoogleDocsResults(list, results.docs.slice(0, googleCount - 1), query);
 
-    // Recalculate styles before starting slide transition.
-    this.el.resolveStyles();
-    // Update pagination
-    this.pagination.removeClass('active').eq(next).addClass('active');
+    var totalResults = results.android.length + results.docs.length;
+    if (totalResults === 0) {
+      list.addClass('no-results');
+    }
 
-    // Transition out current frame
-    this.frames.eq(this.current).toggleClass('active out');
+    // Tweak see more logic to account for references.
+    var hasMore = totalResults > ROW_COUNT_COLLAPSED && !util.matchesMedia('mobile');
+    var searchEl = $('#search-resources');
+    searchEl.toggleClass('dac-has-more', searchEl.hasClass('dac-has-more') || (hasMore && !expanded));
+    searchEl.toggleClass('dac-has-less', searchEl.hasClass('dac-has-less') || (hasMore && expanded));
+  }
 
-    // Transition in a new frame
-    this.frames.eq(next).toggleClass('active');
+  function onToggleMore(e) {
+    var link = $(e.currentTarget);
+    var referenceCard = $('.suggest-card.reference');
+    var data = referenceCard.data('searchreferences.dac');
 
-    this.current = next;
-  };
+    if (util.matchesMedia('mobile')) { return; }
 
-  // Helper which resolves new styles for an element, so it can start transitioning
-  // from the new values.
-  $.fn.resolveStyles = function() {
-    /*jshint expr:true*/
-    this[0] && this[0].offsetTop;
-    return this;
-  };
+    renderResults(referenceCard, data.results, data.query, link.data('toggle') === 'show-more');
+  }
 
-  // jQuery plugin
-  $.fn.dacCarousel = function() {
-    this.each(function() {
-      var $el = $(this);
-      $el.data('dac-carousel', new DacCarousel(this));
+  $(document).on('click', '.dac-search-results-resources [data-toggle="show-more"]', onToggleMore);
+  $(document).on('click', '.dac-search-results-resources [data-toggle="show-less"]', onToggleMore);
+  $(document).on('click', '.suggest-card.reference a', onSuggestionClick);
+})(jQuery);
+
+(function($) {
+  function highlightPage(query, page) {
+    page.find('.title').highlightMatches(query);
+  }
+
+  $.fn.dacSearchRenderResources = function(gDocsMatches, query) {
+    this.resourceWidget(gDocsMatches, {
+      itemsPerPage: 18,
+      initialResults: 6,
+      cardSizes: ['6x2'],
+      onRenderPage: highlightPage.bind(null, query)
     });
+
     return this;
   };
-
-  // Data API
-  $(function() {
-    $('[data-carousel]').dacCarousel();
-  });
 })(jQuery);
 
-(function($) {
+/*global metadata */
+
+(function($, metadata) {
   'use strict';
 
-  function Modal(el, options) {
-    this.el = $(el);
-    this.options = $.extend({}, ToggleModal.DEFAULTS_, options);
-    this.isOpen = false;
+  function Search() {
+    this.body = $('body');
+    this.lastQuery = null;
+    this.searchResults = $('#search-results');
+    this.searchClose = $('[data-search-close]');
+    this.searchClear = $('[data-search-clear]');
+    this.searchInput = $('#search_autocomplete');
+    this.searchResultsContent = $('#dac-search-results-content');
+    this.searchResultsFor = $('#search-results-for');
+    this.searchResultsHistory = $('#dac-search-results-history');
+    this.searchResultsResources = $('#search-resources');
+    this.searchResultsHero = $('#dac-search-results-hero');
+    this.searchResultsReference = $('#dac-search-results-reference');
+    this.searchHeader = $('[data-search]').data('search-input.dac');
+  }
 
-    this.el.on('click', function(event) {
-      if (!$.contains($('.dac-modal-window')[0], event.target)) {
-        return this.el.trigger('modal-close');
+  Search.prototype.init = function() {
+    if (this.checkRedirectToIndex()) { return; }
+
+    this.searchHistory = window.dacStore('search-history');
+
+    this.searchInput.focus(this.onSearchChanged.bind(this));
+    this.searchInput.keydown(this.handleKeyboardShortcut.bind(this));
+    this.searchInput.on('input', this.onSearchChanged.bind(this));
+    this.searchClear.click(this.clear.bind(this));
+    this.searchClose.click(this.close.bind(this));
+
+    this.customSearch = $.fn.debounce(function(query) {
+      $('#dac-custom-search-results').customSearch(query);
+    }, 1000);
+
+    // Start search shortcut (/)
+    $('body').keyup(function(event) {
+      if (event.which === 191 && $(event.target).is(':not(:input)')) {
+        this.searchInput.focus();
       }
     }.bind(this));
 
-    this.el.on('modal-open', this.open_.bind(this));
-    this.el.on('modal-close', this.close_.bind(this));
-    this.el.on('modal-toggle', this.toggle_.bind(this));
-  }
-
-  Modal.prototype.toggle_ = function() {
-    this.el.trigger('modal-' + (this.isOpen ? 'close' : 'open'));
+    $(window).on('popstate', this.onPopState.bind(this));
+    $(window).hashchange(this.onHashChange.bind(this));
+    this.onHashChange();
   };
 
-  Modal.prototype.close_ = function() {
-    this.el.removeClass('dac-active');
-    $('body').removeClass('dac-modal-open');
-    this.isOpen = false;
+  Search.prototype.checkRedirectToIndex = function() {
+    var query = this.getUrlQuery();
+    var target = window.getLangTarget();
+    var prefix = (target !== 'en') ? '/intl/' + target : '';
+    var pathname = location.pathname.slice(prefix.length);
+    if (query != null && pathname !== '/index.html') {
+      location.href = prefix + '/index.html' + location.hash;
+      return true;
+    }
   };
 
-  Modal.prototype.open_ = function() {
-    this.el.addClass('dac-active');
-    $('body').addClass('dac-modal-open');
-    this.isOpen = true;
+  Search.prototype.handleKeyboardShortcut = function(event) {
+    // Close (esc)
+    if (event.which === 27) {
+      this.searchClose.trigger('click');
+      event.preventDefault();
+    }
+
+    // Previous result (up arrow)
+    if (event.which === 38) {
+      this.previousResult();
+      event.preventDefault();
+    }
+
+    // Next result (down arrow)
+    if (event.which === 40) {
+      this.nextResult();
+      event.preventDefault();
+    }
+
+    // Navigate to result (enter)
+    if (event.which === 13) {
+      this.navigateToResult();
+      event.preventDefault();
+    }
   };
 
-  function ToggleModal(el, options) {
-    this.el = $(el);
-    this.options = $.extend({}, ToggleModal.DEFAULTS_, options);
-    this.modal = this.options.modalToggle ? $('[data-modal="' + this.options.modalToggle + '"]') :
-      this.el.closest('[data-modal]');
+  Search.prototype.goToResult = function(relativeIndex) {
+    var links = this.searchResults.find('a').filter(':visible');
+    var selectedLink = this.searchResults.find('.dac-selected');
 
-    this.el.on('click', this.clickHandler_.bind(this));
-  }
+    if (selectedLink.length) {
+      var found = $.inArray(selectedLink[0], links);
 
-  ToggleModal.prototype.clickHandler_ = function(event) {
-    event.preventDefault();
-    this.modal.trigger('modal-toggle');
+      selectedLink.removeClass('dac-selected');
+      links.eq(found + relativeIndex).addClass('dac-selected');
+      return true;
+    } else {
+      if (relativeIndex > 0) {
+        links.first().addClass('dac-selected');
+      }
+    }
   };
 
-  /**
-   * jQuery plugin
-   * @param  {object} options - Override default options.
-   */
-  $.fn.dacModal = function(options) {
-    return this.each(function() {
-      new Modal(this, options);
-    });
+  Search.prototype.previousResult = function() {
+    this.goToResult(-1);
   };
 
-  $.fn.dacToggleModal = function(options) {
-    return this.each(function() {
-      new ToggleModal(this, options);
-    });
+  Search.prototype.nextResult = function() {
+    this.goToResult(1);
   };
 
-  /**
-   * Data Attribute API
-   */
-  $(document).on('ready.aranja', function() {
-    $('[data-modal]').each(function() {
-      $(this).dacModal($(this).data());
-    });
+  Search.prototype.navigateToResult = function() {
+    var query = this.getQuery();
+    var selectedLink = this.searchResults.find('.dac-selected');
 
-    $('[data-modal-toggle]').each(function() {
-      $(this).dacToggleModal($(this).data());
-    });
-  });
-})(jQuery);
+    if (selectedLink.length) {
+      selectedLink[0].click();
+    } else {
+      this.searchHistory.push(query);
+      this.addQueryToUrl(query);
 
-(function($) {
-  'use strict';
+      var isMobileOrTablet = typeof window.orientation !== 'undefined';
 
-  /**
-   * Toggle the visabilty of the mobile navigation.
-   * @param {HTMLElement} el - The DOM element.
-   * @param options
-   * @constructor
-   */
-  function ToggleNav(el, options) {
-    this.el = $(el);
-    this.options = $.extend({}, ToggleNav.DEFAULTS_, options);
-    this.options.target = [this.options.navigation];
+      if (isMobileOrTablet) {
+        this.searchInput.blur();
+      }
+    }
+  };
 
-    if (this.options.body) {this.options.target.push('body')}
-    if (this.options.dimmer) {this.options.target.push(this.options.dimmer)}
+  Search.prototype.onHashChange = function() {
+    var query = this.getUrlQuery();
+    if (query != null && query !== this.getQuery()) {
+      this.searchInput.val(query);
+      this.onSearchChanged();
+    }
+  };
 
-    this.el.on('click', this.clickHandler_.bind(this));
-  }
+  Search.prototype.clear = function() {
+    this.searchInput.val('');
+    window.location.hash = '';
+    this.onSearchChanged();
+    this.searchInput.focus();
+  };
 
-  /**
-   * ToggleNav Default Settings
-   * @type {{body: boolean, dimmer: string, navigation: string, toggleClass: string}}
-   * @private
-   */
-  ToggleNav.DEFAULTS_ = {
-    body: true,
-    dimmer: '.dac-nav-dimmer',
-    navigation: '[data-dac-nav]',
-    toggleClass: 'dac-nav-open'
+  Search.prototype.close = function() {
+    this.removeQueryFromUrl();
+    this.searchInput.blur();
+    this.hideOverlay();
   };
 
-  /**
-   * The actual toggle logic.
-   * @param event
-   * @private
-   */
-  ToggleNav.prototype.clickHandler_ = function(event) {
-    event.preventDefault();
-    $(this.options.target.join(', ')).toggleClass(this.options.toggleClass);
+  Search.prototype.getUrlQuery = function() {
+    var queryMatch = location.hash.match(/q=(.*)&?/);
+    return queryMatch && queryMatch[1] && decodeURI(queryMatch[1]);
   };
 
-  /**
-   * jQuery plugin
-   * @param  {object} options - Override default options.
-   */
-  $.fn.dacToggleMobileNav = function(options) {
-    return this.each(function() {
-      new ToggleNav(this, options);
-    });
+  Search.prototype.getQuery = function() {
+    return this.searchInput.val().replace(/(^ +)|( +$)/g, '');
   };
 
-  /**
-   * Data Attribute API
-   */
-  $(window).on('load.aranja', function() {
-    $('[data-dac-toggle-nav]').each(function() {
-      $(this).dacToggleMobileNav($(this).data());
-    });
-  });
-})(jQuery);
+  Search.prototype.onSearchChanged = function() {
+    var query = this.getQuery();
 
-(function($) {
-  'use strict';
+    this.showOverlay();
+    this.render(query);
+  };
 
-  /**
-   * Submit the newsletter form to a Google Form.
-   * @param {HTMLElement} el - The Form DOM element.
-   * @constructor
-   */
-  function NewsletterForm(el) {
-    this.el = $(el);
-    this.form = this.el.find('form');
-    $('<iframe/>').hide()
-      .attr('name', 'dac-newsletter-iframe')
-      .attr('src', '')
-      .insertBefore(this.form);
-    this.form.on('submit', this.submitHandler_.bind(this));
-  }
+  Search.prototype.render = function(query) {
+    if (this.lastQuery === query) { return; }
 
-  /**
-   * Milliseconds until modal has vanished after modal-close is triggered.
-   * @type {number}
-   * @private
-   */
-  NewsletterForm.CLOSE_DELAY_ = 300;
+    if (query.length < 2) {
+      query = '';
+    }
 
-  /**
-   * Switch view to display form after close.
-   * @private
-   */
-  NewsletterForm.prototype.closeHandler_ = function() {
-    setTimeout(function() {
-      this.el.trigger('swap-reset');
-    }.bind(this), NewsletterForm.CLOSE_DELAY_);
+    this.lastQuery = query;
+    this.searchResultsFor.text(query);
+    this.customSearch(query);
+    var metadataResults = metadata.search(query);
+    this.searchResultsResources.dacSearchRenderResources(metadataResults.resources, query);
+    this.searchResultsReference.dacSearchRenderReferences(metadataResults, query);
+    var hasHero = this.searchResultsHero.dacSearchRenderHero(metadataResults.resources, query);
+    var hasQuery = !!query;
+
+    this.searchResultsReference.toggle(!hasHero);
+    this.searchResultsContent.toggle(hasQuery);
+    this.searchResultsHistory.toggle(!hasQuery);
+    this.addQueryToUrl(query);
+    this.pushState();
   };
 
-  /**
-   * Reset the modal to initial state.
-   * @private
-   */
-  NewsletterForm.prototype.reset_ = function() {
-    this.form.trigger('reset');
-    this.el.one('modal-close', this.closeHandler_.bind(this));
+  Search.prototype.addQueryToUrl = function(query) {
+    var hash = 'q=' + encodeURI(query);
+
+    if (query) {
+      if (window.history.replaceState) {
+        window.history.replaceState(null, '', '#' + hash);
+      } else {
+        window.location.hash = hash;
+      }
+    }
   };
 
-  /**
-   * Display a success view on submit.
-   * @private
-   */
-  NewsletterForm.prototype.submitHandler_ = function() {
-    this.el.one('swap-complete', this.reset_.bind(this));
-    this.el.trigger('swap-content');
+  Search.prototype.onPopState = function() {
+    if (!this.getUrlQuery()) {
+      this.hideOverlay();
+      this.searchHeader.unsetActiveState();
+    }
   };
 
-  /**
-   * jQuery plugin
-   * @param  {object} options - Override default options.
-   */
-  $.fn.dacNewsletterForm = function(options) {
-    return this.each(function() {
-      new NewsletterForm(this, options);
-    });
+  Search.prototype.removeQueryFromUrl = function() {
+    window.location.hash = '';
+  };
+
+  Search.prototype.pushState = function() {
+    if (window.history.pushState && !this.lastQuery.length) {
+      window.history.pushState(null, '');
+    }
+  };
+
+  Search.prototype.showOverlay = function() {
+    this.body.addClass('dac-modal-open dac-search-open');
+  };
+
+  Search.prototype.hideOverlay = function() {
+    this.body.removeClass('dac-modal-open dac-search-open');
   };
 
-  /**
-   * Data Attribute API
-   */
   $(document).on('ready.aranja', function() {
-    $('[data-newsletter]').each(function() {
-      $(this).dacNewsletterForm();
-    });
+    var search = new Search();
+    search.init();
   });
-})(jQuery);
-
-(function($) {
-  'use strict';
+})(jQuery, metadata);
 
+window.dacStore = (function(window) {
   /**
-   * Smoothly scroll to location on current page.
-   * @param el
-   * @param options
+   * Creates a new persistent store.
+   * If localStorage is unavailable, the items are stored in memory.
+   *
    * @constructor
+   * @param {string} name    The name of the store
+   * @param {number} maxSize The maximum number of items the store can hold.
    */
-  function ScrollButton(el, options) {
-    this.el = $(el);
-    this.target = $(this.el.attr('href'));
-    this.options = $.extend({}, ScrollButton.DEFAULTS_, options);
+  var Store = function(name, maxSize) {
+    var content = [];
 
-    if (typeof this.options.offset === 'string') {
-      this.options.offset = $(this.options.offset).height();
+    var hasLocalStorage = !!window.localStorage;
+
+    if (hasLocalStorage) {
+      try {
+        content = JSON.parse(window.localStorage.getItem(name) || []);
+      } catch (e) {
+        // Store contains invalid data
+        window.localStorage.removeItem(name);
+      }
     }
 
-    this.el.on('click', this.clickHandler_.bind(this));
-  }
+    function push(item) {
+      if (content[0] === item) {
+        return;
+      }
 
-  /**
-   * Default options
-   * @type {{duration: number, easing: string, offset: number, scrollContainer: string}}
-   * @private
-   */
-  ScrollButton.DEFAULTS_ = {
-    duration: 300,
-    easing: 'swing',
-    offset: 0,
-    scrollContainer: 'html, body'
-  };
+      content.unshift(item);
 
-  /**
-   * Scroll logic
-   * @param event
-   * @private
-   */
-  ScrollButton.prototype.clickHandler_ = function(event) {
-    if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) {
-      return;
+      if (maxSize) {
+        content.splice(maxSize, content.length);
+      }
+
+      if (hasLocalStorage) {
+        window.localStorage.setItem(name, JSON.stringify(content));
+      }
     }
 
-    event.preventDefault();
+    function all() {
+      // Return a copy
+      return content.slice();
+    }
 
-    $(this.options.scrollContainer).animate({
-      scrollTop: this.target.offset().top - this.options.offset
-    }, this.options);
+    return {
+      push: push,
+      all: all
+    };
   };
 
-  /**
-   * jQuery plugin
-   * @param  {object} options - Override default options.
-   */
-  $.fn.dacScrollButton = function(options) {
-    return this.each(function() {
-      new ScrollButton(this, options);
-    });
+  var stores = {
+    'search-history': new Store('search-history', 3)
   };
 
   /**
-   * Data Attribute API
+   * Get a named persistent store.
+   * @param  {string} name
+   * @return {Store}
    */
-  $(document).on('ready.aranja', function() {
-    $('[data-scroll-button]').each(function() {
-      $(this).dacScrollButton($(this).data());
-    });
-  });
-})(jQuery);
+  return function getStore(name) {
+    return stores[name];
+  };
+})(window);
 
 (function($) {
   'use strict';
@@ -5107,10 +5898,12 @@ function showSamples() {
   function SwapContent(el, options) {
     this.el = $(el);
     this.options = $.extend({}, SwapContent.DEFAULTS_, options);
+    this.options.dynamic = this.options.dynamic === 'true';
     this.containers = this.el.find(this.options.container);
     this.initiallyActive = this.containers.children('.' + this.options.activeClass).eq(0);
     this.el.on('swap-content', this.swap.bind(this));
     this.el.on('swap-reset', this.reset.bind(this));
+    this.el.find(this.options.swapButton).on('click', this.swap.bind(this));
   }
 
   /**
@@ -5121,6 +5914,8 @@ function showSamples() {
   SwapContent.DEFAULTS_ = {
     activeClass: 'dac-active',
     container: '[data-swap-container]',
+    dynamic: 'true',
+    swapButton: '[data-swap-button]',
     transitionSpeed: 500
   };
 
@@ -5154,9 +5949,15 @@ function showSamples() {
    * Perform the swap of content.
    */
   SwapContent.prototype.swap = function() {
-    console.log(this.containers);
     this.containers.each(function(index, container) {
       container = $(container);
+
+      if (!this.options.dynamic) {
+        container.children().toggleClass(this.options.activeClass);
+        this.complete.bind(this);
+        return;
+      }
+
       container.height(this.currentHeight(container)).children().toggleClass(this.options.activeClass);
       container.animate({height: this.currentHeight(container)}, this.options.transitionSpeed,
         this.complete.bind(this));
@@ -5183,6 +5984,178 @@ function showSamples() {
   });
 })(jQuery);
 
+/* Tabs */
+(function($) {
+  'use strict';
+
+  /**
+   * @param {HTMLElement} el - The DOM element.
+   * @param {Object} options
+   * @constructor
+   */
+  function Tabs(el, options) {
+    this.el = $(el);
+    this.options = $.extend({}, Tabs.DEFAULTS_, options);
+    this.init();
+  }
+
+  Tabs.DEFAULTS_ = {
+    activeClass: 'dac-active',
+    viewDataAttr: 'tab-view',
+    itemDataAttr: 'tab-item'
+  };
+
+  Tabs.prototype.init = function() {
+    var itemDataAttribute = '[data-' + this.options.itemDataAttr + ']';
+    this.tabEl_ = this.el.find(itemDataAttribute);
+    this.tabViewEl_ = this.el.find('[data-' + this.options.viewDataAttr + ']');
+    this.el.on('click.dac-tabs', itemDataAttribute, this.changeTabs.bind(this));
+  };
+
+  Tabs.prototype.changeTabs = function(event) {
+    var current = $(event.currentTarget);
+    var index = current.index();
+
+    if (current.hasClass(this.options.activeClass)) {
+      current.add(this.tabViewEl_.eq(index)).removeClass(this.options.activeClass);
+    } else {
+      this.tabEl_.add(this.tabViewEl_).removeClass(this.options.activeClass);
+      current.add(this.tabViewEl_.eq(index)).addClass(this.options.activeClass);
+    }
+  };
+
+  /**
+   * jQuery plugin
+   */
+  $.fn.dacTabs = function() {
+    return this.each(function() {
+      var el = $(this);
+      new Tabs(el, el.data());
+    });
+  };
+
+  /**
+   * Data Attribute API
+   */
+  $(function() {
+    $('[data-tabs]').dacTabs();
+  });
+})(jQuery);
+
+/* Toast Component */
+(function($) {
+  'use strict';
+  /**
+   * @constant
+   * @type {String}
+   */
+  var LOCAL_STORAGE_KEY = 'toast-closed-index';
+
+  /**
+   * Dictionary from local storage.
+   */
+  var toastDictionary = localStorage.getItem(LOCAL_STORAGE_KEY);
+  toastDictionary = toastDictionary ? JSON.parse(toastDictionary) : {};
+
+  /**
+   * Variable used for caching the body.
+   */
+  var bodyCached;
+
+  /**
+   * @param {HTMLElement} el - The DOM element.
+   * @param {Object} options
+   * @constructor
+   */
+  function Toast(el, options) {
+    this.el = $(el);
+    this.options = $.extend({}, Toast.DEFAULTS_, options);
+    this.init();
+  }
+
+  Toast.DEFAULTS_ = {
+    closeBtnClass: 'dac-toast-close-btn',
+    closeDuration: 200,
+    visibleClass: 'dac-visible',
+    wrapClass: 'dac-toast-wrap'
+  };
+
+  /**
+   * Generate a close button.
+   * @returns {*|HTMLElement}
+   */
+  Toast.prototype.closeBtn = function() {
+    this.closeBtnEl = this.closeBtnEl || $('<button class="' + this.options.closeBtnClass + '">' +
+      '<i class="dac-sprite dac-close-black"></i>' +
+    '</button>');
+    return this.closeBtnEl;
+  };
+
+  /**
+   * Initialize a new toast element
+   */
+  Toast.prototype.init = function() {
+    this.hash = this.el.text().replace(/[\s\n\t]/g, '').split('').slice(0, 128).join('');
+
+    if (toastDictionary[this.hash]) {
+      return;
+    }
+
+    this.closeBtn().on('click', this.onClickHandler.bind(this));
+    this.el.find('.' + this.options.wrapClass).append(this.closeBtn());
+    this.el.addClass(this.options.visibleClass);
+    this.dynamicPadding(this.el.outerHeight());
+  };
+
+  /**
+   * Add padding to make sure all page is visible.
+   */
+  Toast.prototype.dynamicPadding = function(val) {
+    var currentPadding = parseInt(bodyCached.css('padding-bottom') || 0);
+    bodyCached.css('padding-bottom', val + currentPadding);
+  };
+
+  /**
+   * Remove a toast from the DOM
+   */
+  Toast.prototype.remove = function() {
+    this.dynamicPadding(-this.el.outerHeight());
+    this.el.remove();
+  };
+
+  /**
+   * Handle removal of the toast.
+   */
+  Toast.prototype.onClickHandler = function() {
+    // Only fadeout toasts from top of stack. Others are removed immediately.
+    var duration = this.el.index() === 0 ? this.options.closeDuration : 0;
+    this.el.fadeOut(duration, this.remove.bind(this));
+
+    // Save closed state.
+    toastDictionary[this.hash] = 1;
+    localStorage.setItem(LOCAL_STORAGE_KEY, JSON.stringify(toastDictionary));
+  };
+
+  /**
+   * jQuery plugin
+   * @param  {object} options - Override default options.
+   */
+  $.fn.dacToast = function() {
+    return this.each(function() {
+      var el = $(this);
+      new Toast(el, el.data());
+    });
+  };
+
+  /**
+   * Data Attribute API
+   */
+  $(function() {
+    bodyCached = $('#body-content');
+    $('[data-toast]').dacToast();
+  });
+})(jQuery);
+
 (function($) {
   function Toggle(el) {
     $(el).on('click.dac.togglesection', this.toggle);
@@ -5227,8 +6200,12 @@ function showSamples() {
 
     // If we're hiding, first set the maxHeight we're transitioning from.
     if (!visible) {
-      $el.css('maxHeight', contentHeight + 'px')
-        .resolveStyles();
+      $el.css({
+          transitionDuration: '0s',
+          maxHeight: contentHeight + 'px'
+        })
+        .resolveStyles()
+        .css('transitionDuration', '');
     }
 
     // Transition to new state
@@ -5236,7 +6213,12 @@ function showSamples() {
 
     // Reset maxHeight to css value after transition.
     setTimeout(function() {
-      $el.css('maxHeight', '');
+      $el.css({
+          transitionDuration: '0s',
+          maxHeight: ''
+        })
+        .resolveStyles()
+        .css('transitionDuration', '');
     }, duration);
   }
 
@@ -5261,3 +6243,244 @@ function showSamples() {
   $(document)
     .on('click.toggle', '[data-toggle="section"]', Toggle.prototype.toggle);
 })(jQuery);
+
+(function(window) {
+  /**
+   * Media query breakpoints. Should match CSS.
+   */
+  var BREAKPOINTS = {
+    mobile: [0, 719],
+    tablet: [720, 959],
+    desktop: [960, 9999]
+  };
+
+  /**
+   * Fisher-Yates Shuffle (Knuth shuffle).
+   * @param {Array} input
+   * @returns {Array} shuffled array.
+   */
+  function shuffle(input) {
+    for (var i = input.length; i >= 0; i--) {
+      var randomIndex = Math.floor(Math.random() * (i + 1));
+      var randomItem = input[randomIndex];
+      input[randomIndex] = input[i];
+      input[i] = randomItem;
+    }
+
+    return input;
+  }
+
+  /**
+   * Matches media breakpoints like in CSS.
+   * @param {string} form of either mobile, tablet or desktop.
+   */
+  function matchesMedia(form) {
+    var breakpoint = BREAKPOINTS[form];
+    return window.innerWidth >= breakpoint[0] && window.innerWidth <= breakpoint[1];
+  }
+
+  window.util = {
+    shuffle: shuffle,
+    matchesMedia: matchesMedia
+  };
+})(window);
+
+(function($, window) {
+  'use strict';
+
+  var YouTubePlayer = (function() {
+    var player;
+
+    function VideoPlayer() {
+      this.mPlayerPaused = false;
+      this.doneSetup = false;
+    }
+
+    VideoPlayer.prototype.setup = function() {
+      // loads the IFrame Player API code asynchronously.
+      $.getScript('https://www.youtube.com/iframe_api');
+
+      // Add the shadowbox HTML to the body
+      $('body').prepend(
+'<div id="video-player" class="Video">' +
+  '<div id="video-overlay" class="Video-overlay" />' +
+  '<div class="Video-container">' +
+    '<div class="Video-frame">' +
+      '<span class="Video-loading">Loading&hellip;</span>' +
+      '<div id="youTubePlayer"></div>' +
+    '</div>' +
+    '<div class="Video-controls">' +
+      '<button id="picture-in-picture" class="Video-button Video-button--picture-in-picture">' +
+      '<button id="close-video" class="Video-button Video-button--close" />' +
+    '</div>' +
+  '</div>' +
+'</div>');
+
+      this.videoPlayer = $('#video-player');
+
+      var pictureInPictureButton = this.videoPlayer.find('#picture-in-picture');
+      pictureInPictureButton.on('click.aranja', this.toggleMinimizeVideo.bind(this));
+
+      var videoOverlay = this.videoPlayer.find('#video-overlay');
+      var closeButton = this.videoPlayer.find('#close-video');
+      var closeVideo = this.closeVideo.bind(this);
+      videoOverlay.on('click.aranja', closeVideo);
+      closeButton.on('click.aranja', closeVideo);
+
+      this.doneSetup = true;
+    };
+
+    VideoPlayer.prototype.startYouTubePlayer = function(videoId) {
+      this.videoPlayer.show();
+
+      if (!this.isLoaded) {
+        this.queueVideo = videoId;
+        return;
+      }
+
+      this.mPlayerPaused = false;
+      // check if we've already created this player
+      if (!this.youTubePlayer) {
+        // check if there's a start time specified
+        var idAndHash = videoId.split('#');
+        var startTime = 0;
+        if (idAndHash.length > 1) {
+          startTime = idAndHash[1].split('t=')[1] !== undefined ? idAndHash[1].split('t=')[1] : 0;
+        }
+        // enable localized player
+        var lang = getLangPref();
+        var captionsOn = lang === 'en' ? 0 : 1;
+
+        this.youTubePlayer = new YT.Player('youTubePlayer', {
+          height: 720,
+          width: 1280,
+          videoId: idAndHash[0],
+          // jscs:disable requireCamelCaseOrUpperCaseIdentifiers
+          playerVars: {start: startTime, hl: lang, cc_load_policy: captionsOn},
+          // jscs:enable
+          events: {
+            'onReady': this.onPlayerReady.bind(this),
+            'onStateChange': this.onPlayerStateChange.bind(this)
+          }
+        });
+      } else {
+        // if a video different from the one already playing was requested, cue it up
+        if (videoId !== this.getVideoId()) {
+          this.youTubePlayer.cueVideoById(videoId);
+        }
+        this.youTubePlayer.playVideo();
+      }
+    };
+
+    VideoPlayer.prototype.onPlayerReady = function(event) {
+      if (!isMobile) {
+        event.target.playVideo();
+        this.mPlayerPaused = false;
+      }
+    };
+
+    VideoPlayer.prototype.toggleMinimizeVideo = function(event) {
+      event.stopPropagation();
+      this.videoPlayer.toggleClass('Video--picture-in-picture');
+    };
+
+    VideoPlayer.prototype.closeVideo = function() {
+      try {
+        this.youTubePlayer.pauseVideo();
+      } catch (e) {
+      }
+      this.videoPlayer.fadeOut(200, function() {
+        this.videoPlayer.removeClass('Video--picture-in-picture');
+      }.bind(this));
+    };
+
+    VideoPlayer.prototype.getVideoId = function() {
+      // jscs:disable requireCamelCaseOrUpperCaseIdentifiers
+      return this.youTubePlayer && this.youTubePlayer.getVideoData().video_id;
+      // jscs:enable
+    };
+
+    /* Track youtube playback for analytics */
+    VideoPlayer.prototype.onPlayerStateChange = function(event) {
+      var videoId = this.getVideoId();
+      var currentTime = this.youTubePlayer && this.youTubePlayer.getCurrentTime();
+
+      // Video starts, send the video ID
+      if (event.data === YT.PlayerState.PLAYING) {
+        if (this.mPlayerPaused) {
+          ga('send', 'event', 'Videos', 'Resume', videoId);
+        } else {
+          // track the start playing event so we know from which page the video was selected
+          ga('send', 'event', 'Videos', 'Start: ' + videoId, 'on: ' + document.location.href);
+        }
+        this.mPlayerPaused = false;
+      }
+
+      // Video paused, send video ID and video elapsed time
+      if (event.data === YT.PlayerState.PAUSED) {
+        ga('send', 'event', 'Videos', 'Paused', videoId, currentTime);
+        this.mPlayerPaused = true;
+      }
+
+      // Video finished, send video ID and video elapsed time
+      if (event.data === YT.PlayerState.ENDED) {
+        ga('send', 'event', 'Videos', 'Finished', videoId, currentTime);
+        this.mPlayerPaused = true;
+      }
+    };
+
+    return {
+      getPlayer: function() {
+        if (!player) {
+          player = new VideoPlayer();
+        }
+
+        return player;
+      }
+    };
+  })();
+
+  var videoPlayer = YouTubePlayer.getPlayer();
+
+  window.onYouTubeIframeAPIReady = function() {
+    videoPlayer.isLoaded = true;
+
+    if (videoPlayer.queueVideo) {
+      videoPlayer.startYouTubePlayer(videoPlayer.queueVideo);
+    }
+  };
+
+  function wrapLinkInPlayer(e) {
+    e.preventDefault();
+
+    if (!videoPlayer.doneSetup) {
+      videoPlayer.setup();
+    }
+
+    var videoIdMatches = $(e.currentTarget).attr('href').match(/(?:youtu.be\/|v=)([^&]*)/);
+    var videoId = videoIdMatches && videoIdMatches[1];
+
+    if (videoId) {
+      videoPlayer.startYouTubePlayer(videoId);
+    }
+  }
+
+  $(document).on('click.video', 'a[href*="youtube.com/watch"], a[href*="youtu.be"]', wrapLinkInPlayer);
+})(jQuery, window);
+
+/**
+ * Wide table
+ *
+ * Wraps tables in a scrollable area so you can read them on mobile.
+ */
+(function($) {
+  function initWideTable() {
+    $('table.jd-sumtable').each(function(i, table) {
+      $(table).wrap('<div class="dac-expand wide-table">');
+    });
+  }
+
+  $(function() {
+    initWideTable();
+  });
+})(jQuery);
index 44eae97..2372d44 100644 (file)
@@ -14,8 +14,6 @@
   <a name="top"></a>
 <?cs include:"header.cs" ?>
 
-<div class="col-12"  id="doc-col">
-
 <div id="api-info-block">
 
 <?cs # are there inherited members ?>
@@ -670,7 +668,6 @@ From <?cs var:cl.kind ?>
 </div> <!-- jd-content -->
 
 <?cs include:"footer.cs" ?>
-</div><!-- end doc-content -->
 
 <?cs include:"trailer.cs" ?>
 
index 32966a0..3bdfbea 100644 (file)
@@ -13,8 +13,6 @@
   <a name="top"></a>
 <?cs include:"header.cs" ?>
 
-<div class="col-12" id="doc-col">
-
 <div id="jd-header">
 <h1><?cs var:page.title ?></h1>
 </div>
@@ -46,7 +44,6 @@
 </div><!-- end jd-content -->
 
 <?cs include:"footer.cs" ?>
-</div><!-- end doc-content -->
 
 <?cs include:"trailer.cs" ?>
 
index fc39cf7..d857ffb 100644 (file)
@@ -1,55 +1,8 @@
 <?cs def:custom_masthead() ?>
-<a name="top"></a>
-
-<!-- dialog to prompt lang pref change when loaded from hardcoded URL
-<div id="langMessage" style="display:none">
-  <div>
-    <div class="lang en">
-      <p>You requested a page in English, would you like to proceed with this language setting?</p>
-    </div>
-    <div class="lang es">
-      <p>You requested a page in Spanish (Español), would you like to proceed with this language setting?</p>
-    </div>
-    <div class="lang ja">
-      <p>You requested a page in Japanese (日本語), would you like to proceed with this language setting?</p>
-    </div>
-    <div class="lang ko">
-      <p>You requested a page in Korean (한국어), would you like to proceed with this language setting?</p>
-    </div>
-    <div class="lang ru">
-      <p>You requested a page in Russian (Русский), would you like to proceed with this language setting?</p>
-    </div>
-    <div class="lang zh-cn">
-      <p>You requested a page in Simplified Chinese (简体中文), would you like to proceed with this language setting?</p>
-    </div>
-    <div class="lang zh-tw">
-      <p>You requested a page in Traditional Chinese (繁體中文), would you like to proceed with this language setting?</p>
-    </div>
-    <a href="#" class="button yes" onclick="return false;">
-      <span class="lang en">Yes</span>
-      <span class="lang es">Sí</span>
-      <span class="lang ja">Yes</span>
-      <span class="lang ko">Yes</span>
-      <span class="lang ru">Yes</span>
-      <span class="lang zh-cn">是的</span>
-      <span class="lang zh-tw">没有</span>
-    </a>
-    <a href="#" class="button" onclick="$('#langMessage').hide();return false;">
-      <span class="lang en">No</span>
-      <span class="lang es">No</span>
-      <span class="lang ja">No</span>
-      <span class="lang ko">No</span>
-      <span class="lang ru">No</span>
-      <span class="lang zh-cn">没有</span>
-      <span class="lang zh-tw">没有</span>
-    </a>
-  </div>
-</div> -->
-
-<?cs if:!devsite ?><?cs # leave out the global header for devsite; it is in devsite template ?>
+  <a name="top"></a>
   <!-- Header -->
   <div id="header-wrapper">
-    <div class="dac-header" id="header"><?cs call:butter_bar() ?>
+    <div class="dac-header <?cs if:ndk ?>dac-ndk<?cs /if ?>" id="header">
       <div class="dac-header-inner">
         <a class="dac-nav-toggle" data-dac-toggle-nav href="javascript:;" title="Open navigation">
           <span class="dac-nav-hamburger">
             <span class="dac-nav-hamburger-bot"></span>
           </span>
         </a>
-        <?cs if:ndk ?><a class="dac-header-logo" href="<?cs var:toroot ?>ndk/index.html">
-          <img class="dac-header-logo-image" src="<?cs var:toroot ?>assets/images/android_logo_ndk.png"
-              srcset="<?cs var:toroot ?>assets/images/android_logo_ndk@2x.png 2x"
+        <?cs if:ndk ?><a class="dac-header-logo" style="width:144px;" href="<?cs var:toroot
+        ?>ndk/index.html">
+          <img class="dac-header-logo-image" src="<?cs var:toroot ?>assets/images/android_logo.png"
+              srcset="<?cs var:toroot ?>assets/images/android_logo@2x.png 2x"
               width="32" height="36" alt="Android" /> NDK
           </a><?cs else ?><a class="dac-header-logo" href="<?cs var:toroot ?>index.html">
           <img class="dac-header-logo-image" src="<?cs var:toroot ?>assets/images/android_logo.png"
               width="32" height="36" alt="Android" /> Developers
           </a><?cs /if ?>
 
-        <ul class="dac-header-crumbs">
-          <?cs # More <li> elements added here with javascript ?>
-          <?cs if:!section.landing ?><li class="dac-header-crumbs-item"><span class="dac-header-crumbs-link current <?cs
-            if:ndk ?>ndk<?cs /if ?>"><?cs var:page.title ?></a></li><?cs
-          /if ?>
-        </ul>
-
-        <?cs # ADD SEARCH AND MENU ?>
-        <?cs if:!ndk ?>
-        <?cs call:header_search_widget() ?>
-        <?cs /if ?>
+        <?cs if:ndk
+        ?><ul class="dac-header-tabs">
+          <li>
+            <a href="<?cs var:toroot ?>ndk/guides/index.html" class="dac-header-tab"
+            zh-tw-lang="API 指南"
+            zh-cn-lang="API 指南"
+            ru-lang="Руководства по API"
+            ko-lang="API 가이드"
+            ja-lang="API ガイド"
+            es-lang="Guías de la API">Guides</a>
+          </li>
+          <li>
+            <a href="<?cs var:toroot ?>ndk/reference/index.html" class="dac-header-tab"
+            zh-tw-lang="參考資源"
+            zh-cn-lang="参考"
+            ru-lang="Справочник"
+            ko-lang="참조문서"
+            ja-lang="リファレンス"
+            es-lang="Referencia">Reference</a>
+          </li>
+          <li>
+            <a href="<?cs var:toroot ?>ndk/samples/index.html" class="dac-header-tab"
+           >Samples</a>
+          </li>
+          <li>
+            <a href="<?cs var:toroot ?>ndk/downloads/index.html" class="dac-header-tab"
+            >Downloads</a>
+          </li>
+        </ul><?cs else
+        ?><ul class="dac-header-tabs">
+          <li>
+          <a class="dac-header-tab" href="<?cs var:toroot ?>design/index.html"
+             zh-tw-lang="設計"
+             zh-cn-lang="设计"
+             ru-lang="Проектирование"
+             ko-lang="디자인"
+             ja-lang="設計"
+             es-lang="Diseñar">Design</a>
+          </li>
+          <li>
+          <a class="dac-header-tab" href="<?cs var:toroot ?>develop/index.html"
+             zh-tw-lang="開發"
+             zh-cn-lang="开发"
+             ru-lang="Разработка"
+             ko-lang="개발"
+             ja-lang="開発"
+             es-lang="Desarrollar">Develop</a>
+          </li>
+          <li>
+          <a class="dac-header-tab" href="<?cs var:toroot ?>distribute/index.html"
+             zh-tw-lang="發佈"
+             zh-cn-lang="分发"
+             ru-lang="Распространение"
+             ko-lang="배포"
+             ja-lang="配布"
+             es-lang="Distribuir">Distribute</a>
+          </li>
+        </ul><?cs
+        /if ?>
 
         <?cs if:ndk ?><a class="dac-header-console-btn" href="http://developer.android.com">
-          <span class="dac-visible-desktop-inline">Back to Android Developers</span>
+          Back to Android Developers
         </a><?cs else ?><a class="dac-header-console-btn" href="https://play.google.com/apps/publish/">
           <span class="dac-sprite dac-google-play"></span>
           <span class="dac-visible-desktop-inline">Developer</span>
           Console
         </a><?cs /if ?>
 
+        <?cs # ADD SEARCH AND MENU ?>
+        <?cs if:!ndk ?>
+        <?cs call:header_search_widget() ?>
+        <?cs /if ?>
       </div><!-- end header-wrap.wrap -->
     </div><!-- end header -->
-
-    <div id="searchResults" class="wrap" style="display:none;">
-      <h2 id="searchTitle">Results</h2>
-      <div id="leftSearchControl" class="search-control">Loading...</div>
-    </div>
   </div> <!--end header-wrapper -->
 
   <?cs if:ndk ?>
   <nav class="dac-nav">
     <div class="dac-nav-dimmer" data-dac-toggle-nav></div>
 
-    <ul class="dac-nav-list" data-dac-nav>
-      <li class="dac-nav-item dac-nav-head">
-        <a class="dac-nav-link dac-nav-logo" data-dac-toggle-nav href="javascript:;" title="Close navigation">
-          <img class="dac-logo-image" src="<?cs var:toroot ?>assets/images/android_logo_ndk.png"
-               srcset="<?cs var:toroot ?>assets/images/android_logo_ndk@2x.png 2x"
-               width="32" height="36" alt="Android" /> NDK
-        </a>
-      </li>
+    <div class="dac-nav-sidebar" data-swap data-dynamic="false" data-transition-speed="300" data-dac-nav>
+                   <div data-swap-container>
+        <?cs call:custom_left_nav() ?>
+      <ul id="dac-main-navigation" class="dac-nav-list dac-swap-section dac-left dac-no-anim">
       <li class="dac-nav-item guides">
         <a class="dac-nav-link" href="<?cs var:toroot ?>ndk/guides/index.html"
            zh-tw-lang="API 指南"
         <a class="dac-nav-link" href="<?cs var:toroot ?>ndk/downloads/index.html"
            >Downloads</a>
       </li>
-    </ul>
+      </ul>
+    </div>
+                       </div>
   </nav>
   <!-- end NDK navigation-->
+
+
+
   <?cs else ?>
   <!-- Navigation-->
   <nav class="dac-nav">
     <div class="dac-nav-dimmer" data-dac-toggle-nav></div>
 
-    <ul class="dac-nav-list" data-dac-nav>
-      <li class="dac-nav-item dac-nav-head">
-        <a class="dac-nav-link dac-nav-logo" data-dac-toggle-nav href="javascript:;" title="Close navigation">
-          <img class="dac-logo-image" src="<?cs var:toroot ?>assets/images/android_logo.png"
-               srcset="<?cs var:toroot ?>assets/images/android_logo@2x.png 2x"
-               width="32" height="36" alt="Android" /> Developers
-        </a>
-      </li>
-      <li class="dac-nav-item home">
-        <a class="dac-nav-link dac-visible-mobile-block" href="<?cs var:toroot ?>index.html">Home</a>
-        <ul class="dac-nav-secondary about">
-          <li class="dac-nav-item about">
-            <a class="dac-nav-link" href="<?cs var:toroot ?>about/index.html">Android</a>
-          </li>
-          <li class="dac-nav-item wear">
-            <a class="dac-nav-link" href="<?cs var:toroot ?>wear/index.html">Wear</a>
-          </li>
-          <li class="dac-nav-item tv">
-            <a class="dac-nav-link" href="<?cs var:toroot ?>tv/index.html">TV</a>
-          </li>
-          <li class="dac-nav-item auto">
-            <a class="dac-nav-link" href="<?cs var:toroot ?>auto/index.html">Auto</a>
-          </li>
+    <div class="dac-nav-sidebar" data-swap data-dynamic="false" data-transition-speed="300" data-dac-nav>
+      <div data-swap-container>
+        <?cs call:custom_left_nav() ?>
+        <ul id="dac-main-navigation" class="dac-nav-list dac-swap-section dac-left dac-no-anim">
+        <li class="dac-nav-item home">
+          <a class="dac-nav-link" href="<?cs var:toroot ?>index.html">Home</a>
+          <i class="dac-sprite dac-expand-more-black dac-nav-sub-slider"></i>
+          <ul class="dac-nav-secondary about">
+            <li class="dac-nav-item versions">
+              <a class="dac-nav-link" href="<?cs var:toroot ?>about/versions/marshmallow/index.html">Android</a>
+            </li>
+            <li class="dac-nav-item wear">
+              <a class="dac-nav-link" href="<?cs var:toroot ?>wear/index.html">Wear</a>
+            </li>
+            <li class="dac-nav-item tv">
+              <a class="dac-nav-link" href="<?cs var:toroot ?>tv/index.html">TV</a>
+            </li>
+            <li class="dac-nav-item auto">
+              <a class="dac-nav-link" href="<?cs var:toroot ?>auto/index.html">Auto</a>
+            </li>
+          </ul>
+        </li>
+        <li class="dac-nav-item design">
+          <a class="dac-nav-link" href="<?cs var:toroot ?>design/index.html"
+             zh-tw-lang="設計"
+             zh-cn-lang="设计"
+             ru-lang="Проектирование"
+             ko-lang="디자인"
+             ja-lang="設計"
+             es-lang="Diseñar">Design</a>
+        </li>
+        <li class="dac-nav-item develop">
+          <a class="dac-nav-link" href="<?cs var:toroot ?>develop/index.html"
+             zh-tw-lang="開發"
+             zh-cn-lang="开发"
+             ru-lang="Разработка"
+             ko-lang="개발"
+             ja-lang="開発"
+             es-lang="Desarrollar">Develop</a>
+          <i class="dac-sprite dac-expand-more-black dac-nav-sub-slider"></i>
+          <ul class="dac-nav-secondary develop">
+            <li class="dac-nav-item training">
+              <a class="dac-nav-link" href="<?cs var:toroot ?>training/index.html"
+                 zh-tw-lang="訓練課程"
+                 zh-cn-lang="培训"
+                 ru-lang="Курсы"
+                 ko-lang="교육"
+                 ja-lang="トレーニング"
+                 es-lang="Capacitación">Training</a>
+            </li>
+            <li class="dac-nav-item guide">
+              <a class="dac-nav-link" href="<?cs var:toroot ?>guide/index.html"
+                 zh-tw-lang="API 指南"
+                 zh-cn-lang="API 指南"
+                 ru-lang="Руководства по API"
+                 ko-lang="API 가이드"
+                 ja-lang="API ガイド"
+                 es-lang="Guías de la API">API Guides</a>
+            </li>
+            <li class="dac-nav-item reference">
+              <a class="dac-nav-link" href="<?cs var:toroot ?>reference/packages.html"
+                 zh-tw-lang="參考資源"
+                 zh-cn-lang="参考"
+                 ru-lang="Справочник"
+                 ko-lang="참조문서"
+                 ja-lang="リファレンス"
+                 es-lang="Referencia">Reference</a>
+            </li>
+            <li class="dac-nav-item tools">
+              <a class="dac-nav-link" href="<?cs var:toroot ?>sdk/index.html"
+                 zh-tw-lang="相關工具"
+                 zh-cn-lang="工具"
+                 ru-lang="Инструменты"
+                 ko-lang="도구"
+                 ja-lang="ツール"
+                 es-lang="Herramientas">Tools</a></li>
+            <li class="dac-nav-item google">
+              <a class="dac-nav-link" href="<?cs var:toroot ?>google/index.html">Google Services</a>
+            </li>
+            <?cs if:android.hasSamples ?>
+            <li class="dac-nav-item samples">
+              <a class="dac-nav-link" href="<?cs var:toroot ?>samples/index.html">Samples</a>
+            </li>
+            <?cs /if ?>
+          </ul>
+        </li>
+        <li class="dac-nav-item distribute">
+          <a class="dac-nav-link" href="<?cs var:toroot ?>distribute/<?cs if:android.whichdoc == 'offline' ?>googleplay/<?cs /if ?>index.html"
+             zh-tw-lang="發佈"
+             zh-cn-lang="分发"
+             ru-lang="Распространение"
+             ko-lang="배포"
+             ja-lang="配布"
+             es-lang="Distribuir">Distribute</a>
+          <i class="dac-sprite dac-expand-more-black dac-nav-sub-slider"></i>
+          <ul class="dac-nav-secondary distribute">
+            <li class="dac-nav-item googleplay">
+              <a class="dac-nav-link" href="<?cs var:toroot ?>distribute/googleplay/index.html">Google Play</a></li>
+            <li class="dac-nav-item essentials">
+              <a class="dac-nav-link" href="<?cs var:toroot ?>distribute/essentials/index.html">Essentials</a></li>
+            <li class="dac-nav-item users">
+              <a class="dac-nav-link" href="<?cs var:toroot ?>distribute/users/index.html">Get Users</a></li>
+            <li class="dac-nav-item engage">
+              <a class="dac-nav-link" href="<?cs var:toroot ?>distribute/engage/index.html">Engage &amp; Retain</a></li>
+            <li class="dac-nav-item monetize">
+              <a class="dac-nav-link" href="<?cs var:toroot ?>distribute/monetize/index.html">Earn</a>
+            </li>
+            <li class="dac-nav-item analyze">
+              <a class="dac-nav-link" href="<?cs var:toroot ?>distribute/analyze/index.html">Analyze</a>
+            </li>
+            <li class="dac-nav-item stories">
+              <a class="dac-nav-link" href="<?cs var:toroot ?>distribute/stories/index.html">Stories</a>
+            </li>
+          </ul>
+        </li>
         </ul>
-      </li>
-      <li class="dac-nav-item design">
-        <a class="dac-nav-link" href="<?cs var:toroot ?>design/index.html"
-           zh-tw-lang="設計"
-           zh-cn-lang="设计"
-           ru-lang="Проектирование"
-           ko-lang="디자인"
-           ja-lang="設計"
-           es-lang="Diseñar">Design</a>
-      </li>
-      <li class="dac-nav-item develop">
-        <a class="dac-nav-link" href="<?cs var:toroot ?>develop/index.html"
-           zh-tw-lang="開發"
-           zh-cn-lang="开发"
-           ru-lang="Разработка"
-           ko-lang="개발"
-           ja-lang="開発"
-           es-lang="Desarrollar">Develop</a>
-        <ul class="dac-nav-secondary develop">
-          <li class="dac-nav-item training">
-            <a class="dac-nav-link" href="<?cs var:toroot ?>training/index.html"
-               zh-tw-lang="訓練課程"
-               zh-cn-lang="培训"
-               ru-lang="Курсы"
-               ko-lang="교육"
-               ja-lang="トレーニング"
-               es-lang="Capacitación">Training</a>
-          </li>
-          <li class="dac-nav-item guide">
-            <a class="dac-nav-link" href="<?cs var:toroot ?>guide/index.html"
-               zh-tw-lang="API 指南"
-               zh-cn-lang="API 指南"
-               ru-lang="Руководства по API"
-               ko-lang="API 가이드"
-               ja-lang="API ガイド"
-               es-lang="Guías de la API">API Guides</a>
-          </li>
-          <li class="dac-nav-item reference">
-            <a class="dac-nav-link" href="<?cs var:toroot ?>reference/packages.html"
-               zh-tw-lang="參考資源"
-               zh-cn-lang="参考"
-               ru-lang="Справочник"
-               ko-lang="참조문서"
-               ja-lang="リファレンス"
-               es-lang="Referencia">Reference</a>
-          </li>
-          <li class="dac-nav-item tools">
-            <a class="dac-nav-link" href="<?cs var:toroot ?>sdk/index.html"
-               zh-tw-lang="相關工具"
-               zh-cn-lang="工具"
-               ru-lang="Инструменты"
-               ko-lang="도구"
-               ja-lang="ツール"
-               es-lang="Herramientas">Tools</a></li>
-          <li class="dac-nav-item google">
-            <a class="dac-nav-link" href="<?cs var:toroot ?>google/index.html">Google Services</a>
-          </li>
-          <?cs if:android.hasSamples ?>
-          <li class="dac-nav-item samples">
-            <a class="dac-nav-link" href="<?cs var:toroot ?>samples/index.html">Samples</a>
-          </li>
-          <?cs /if ?>
-        </ul>
-      </li>
-      <li class="dac-nav-item distribute">
-        <a class="dac-nav-link" href="<?cs var:toroot ?>distribute/<?cs if:android.whichdoc == 'offline' ?>googleplay/<?cs /if ?>index.html"
-           zh-tw-lang="發佈"
-           zh-cn-lang="分发"
-           ru-lang="Распространение"
-           ko-lang="배포"
-           ja-lang="配布"
-           es-lang="Distribuir">Distribute</a>
-        <ul class="dac-nav-secondary distribute">
-          <li class="dac-nav-item googleplay">
-            <a class="dac-nav-link" href="<?cs var:toroot ?>distribute/googleplay/index.html">Google Play</a></li>
-          <li class="dac-nav-item essentials">
-            <a class="dac-nav-link" href="<?cs var:toroot ?>distribute/essentials/index.html">Essentials</a></li>
-          <li class="dac-nav-item users">
-            <a class="dac-nav-link" href="<?cs var:toroot ?>distribute/users/index.html">Get Users</a></li>
-          <li class="dac-nav-item engage">
-            <a class="dac-nav-link" href="<?cs var:toroot ?>distribute/engage/index.html">Engage &amp; Retain</a></li>
-          <li class="dac-nav-item monetize">
-            <a class="dac-nav-link" href="<?cs var:toroot ?>distribute/monetize/index.html">Earn</a>
-          </li>
-          <li class="dac-nav-item analyze">
-            <a class="dac-nav-link" href="<?cs var:toroot ?>distribute/analyze/index.html">Analyze</a>
-          </li>
-          <li class="dac-nav-item stories">
-            <a class="dac-nav-link" href="<?cs var:toroot ?>distribute/stories/index.html">Stories</a>
-          </li>
-        </ul>
-      </li>
-    </ul>
+      </div>
+    </div>
   </nav>
   <!-- end navigation-->
   <?cs /if ?>
-<?cs /if ?><?cs # end if/else !devsite ?>
+
+<!-- Nav Setup -->
+<script>$('[data-dac-nav]').dacNav();</script>
 
 <?cs
 /def ?><?cs # end custom_masthead() ?>
 
 
-<?cs # (UN)COMMENT THE INSIDE OF THIS METHOD TO TOGGLE VISIBILITY ?>
-<?cs def:butter_bar() ?>
+<?cs def:toast() ?>
 
-<?cs # HIDE THE BUTTER BAR
+  <?cs # (UN)COMMENT TO TOGGLE VISIBILITY
 
-    <div style="height:20px"><!-- spacer to bump header down --></div>
-    <div id="butterbar-wrapper">
-      <div id="butterbar">
-        <a href="http://googleblog.blogspot.com/" id="butterbar-message">
-          The Android 5.0 SDK will be available on October 17th!
-        </a>
+  <div class="dac-toast-group">
+    <div class="dac-toast" data-toast>
+      <div class="dac-toast-wrap">
+        This is a demo notification <a href="#">Learn more</a>.
       </div>
     </div>
+  </div>
 
 ?>
 
index cf9534e..d36e79f 100644 (file)
-<?cs
-def:mobile_nav_toggle() ?>
-  <div class="dac-visible-mobile-block" data-toggle="section">
-    <span class="dac-toggle-expand dac-devdoc-toggle"><i class="dac-sprite dac-expand-more-black"></i> Show navigation</span>
-    <span class="dac-toggle-collapse dac-devdoc-toggle" data-toggle-section><i class="dac-sprite dac-expand-less-black"></i> Hide navigation</span>
-  </div>
-<?cs /def ?><?cs
-
-def:fullpage() ?>
-  <div id="body-content">
-    <div>
-<?cs /def ?>
-<?cs
-def:sdk_nav() ?>
-  <div class="wrap clearfix" id="body-content"><div class="cols">
-    <div class="col-4 dac-toggle dac-mobile" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
-      <?cs call:mobile_nav_toggle() ?>
-      <div class="dac-toggle-content" id="devdoc-nav">
-        <div class="scroll-pane">
-<?cs include:"../../../../frameworks/base/docs/html/sdk/sdk_toc.cs" ?>
-        </div>
-      </div>
-    </div> <!-- end side-nav -->
-<?cs /def ?><?cs
-
-def:no_nav() ?>
+<?cs def:body_content_wrap_start() ?>
   <div class="wrap clearfix" id="body-content">
-    <div>
-<?cs /def ?><?cs
-
-def:tools_nav() ?>
-  <div class="wrap clearfix" id="body-content"><div class="cols">
-    <div class="col-3 dac-toggle dac-mobile" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
-      <?cs call:mobile_nav_toggle() ?>
-      <div class="dac-toggle-content" id="devdoc-nav">
-        <div class="scroll-pane">
-<?cs include:"../../../../frameworks/base/docs/html/tools/tools_toc.cs" ?>
-        </div>
-      </div>
-    </div> <!-- end side-nav -->
-    <script>
-      $(document).ready(function() {
-        scrollIntoView("devdoc-nav");
-        });
-    </script>
-<?cs /def ?>
-<?cs
-def:training_nav() ?>
-  <div class="wrap clearfix" id="body-content"><div class="cols">
-    <div class="col-4 dac-toggle dac-mobile" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
-      <?cs call:mobile_nav_toggle() ?>
-      <div class="dac-toggle-content" id="devdoc-nav">
-        <div class="scroll-pane">
-<?cs include:"../../../../frameworks/base/docs/html/training/training_toc.cs" ?>
-        </div>
-      </div>
-    </div> <!-- end side-nav -->
-    <script>
-      $(document).ready(function() {
-        scrollIntoView("devdoc-nav");
-        });
-    </script>
-<?cs /def ?><?cs
-
-def:googleplay_nav() ?>
-  <div class="wrap clearfix" id="body-content"><div class="cols">
-    <div class="col-3 dac-toggle dac-mobile" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
-      <?cs call:mobile_nav_toggle() ?>
-      <div class="dac-toggle-content" id="devdoc-nav">
-        <div class="scroll-pane">
-<?cs include:"../../../../frameworks/base/docs/html/distribute/googleplay/googleplay_toc.cs" ?>
-        </div>
-      </div>
-    </div> <!-- end side-nav -->
-    <script>
-      $(document).ready(function() {
-        scrollIntoView("devdoc-nav");
-        });
-    </script>
-<?cs /def ?><?cs
-
-def:essentials_nav() ?>
-  <div class="wrap clearfix" id="body-content"><div class="cols">
-    <div class="col-3 dac-toggle dac-mobile" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
-      <?cs call:mobile_nav_toggle() ?>
-      <div class="dac-toggle-content" id="devdoc-nav">
-        <div class="scroll-pane">
-<?cs include:"../../../../frameworks/base/docs/html/distribute/essentials/essentials_toc.cs" ?>
-        </div>
-      </div>
-    </div> <!-- end side-nav -->
-    <script>
-      $(document).ready(function() {
-        scrollIntoView("devdoc-nav");
-        });
-    </script>
-<?cs /def ?><?cs
-
-def:users_nav() ?>
-  <div class="wrap clearfix" id="body-content"><div class="cols">
-    <div class="col-3 dac-toggle dac-mobile" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
-      <?cs call:mobile_nav_toggle() ?>
-      <div class="dac-toggle-content" id="devdoc-nav">
-        <div class="scroll-pane">
-<?cs include:"../../../../frameworks/base/docs/html/distribute/users/users_toc.cs" ?>
-        </div>
-      </div>
-    </div> <!-- end side-nav -->
-    <script>
-      $(document).ready(function() {
-        scrollIntoView("devdoc-nav");
-        });
-    </script>
-<?cs /def ?><?cs
-
-def:engage_nav() ?>
-  <div class="wrap clearfix" id="body-content"><div class="cols">
-    <div class="col-3 dac-toggle dac-mobile" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
-      <?cs call:mobile_nav_toggle() ?>
-      <div class="dac-toggle-content" id="devdoc-nav">
-        <div class="scroll-pane">
-<?cs include:"../../../../frameworks/base/docs/html/distribute/engage/engage_toc.cs" ?>
-        </div>
-      </div>
-    </div> <!-- end side-nav -->
-    <script>
-      $(document).ready(function() {
-        scrollIntoView("devdoc-nav");
-        });
-    </script>
-<?cs /def ?><?cs
-
-def:analyze_nav() ?>
-  <div class="wrap clearfix" id="body-content"><div class="cols">
-    <div class="col-3 dac-toggle dac-mobile" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
-      <?cs call:mobile_nav_toggle() ?>
-      <div class="dac-toggle-content" id="devdoc-nav">
-        <div class="scroll-pane">
-<?cs include:"../../../../frameworks/base/docs/html/distribute/analyze/analyze_toc.cs" ?>
-        </div>
-      </div>
-    </div> <!-- end side-nav -->
-    <script>
-      $(document).ready(function() {
-        scrollIntoView("devdoc-nav");
-        });
-    </script>
-<?cs /def ?><?cs
-
-def:monetize_nav() ?>
-  <div class="wrap clearfix" id="body-content"><div class="cols">
-    <div class="col-3 dac-toggle dac-mobile" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
-      <?cs call:mobile_nav_toggle() ?>
-      <div class="dac-toggle-content" id="devdoc-nav">
-        <div class="scroll-pane">
-<?cs include:"../../../../frameworks/base/docs/html/distribute/monetize/monetize_toc.cs" ?>
-        </div>
-      </div>
-    </div> <!-- end side-nav -->
-    <script>
-      $(document).ready(function() {
-        scrollIntoView("devdoc-nav");
-        });
-    </script>
-<?cs /def ?><?cs
-
-def:disttools_nav() ?>
-  <div class="wrap clearfix" id="body-content"><div class="cols">
-    <div class="col-3 dac-toggle dac-mobile" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
-      <?cs call:mobile_nav_toggle() ?>
-      <div class="dac-toggle-content" id="devdoc-nav">
-        <div class="scroll-pane">
-<?cs include:"../../../../frameworks/base/docs/html/distribute/tools/disttools_toc.cs" ?>
-        </div>
-      </div>
-    </div> <!-- end side-nav -->
-    <script>
-      $(document).ready(function() {
-        scrollIntoView("devdoc-nav");
-        });
-    </script>
-<?cs /def ?><?cs
-
-def:stories_nav() ?>
-  <div class="wrap clearfix" id="body-content"><div class="cols">
-    <div class="col-3 dac-toggle dac-mobile" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
-      <?cs call:mobile_nav_toggle() ?>
-      <div class="dac-toggle-content" id="devdoc-nav">
-        <div class="scroll-pane">
-<?cs include:"../../../../frameworks/base/docs/html/distribute/stories/stories_toc.cs" ?>
-        </div>
-      </div>
-    </div> <!-- end side-nav -->
-    <script>
-      $(document).ready(function() {
-        scrollIntoView("devdoc-nav");
-        });
-    </script>
-<?cs /def ?><?cs
-
-def:guide_nav() ?>
-  <div class="wrap clearfix" id="body-content"><div class="cols">
-    <div class="col-4 dac-toggle dac-mobile" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
-      <?cs call:mobile_nav_toggle() ?>
-      <div class="dac-toggle-content" id="devdoc-nav">
-        <div class="scroll-pane">
-<?cs include:"../../../../frameworks/base/docs/html/guide/guide_toc.cs" ?>
-        </div>
-      </div>
-    </div> <!-- end side-nav -->
-    <script>
-      $(document).ready(function() {
-        scrollIntoView("devdoc-nav");
-        });
-    </script>
-<?cs /def ?>
-<?cs
-def:design_nav() ?>
-  <div class="wrap clearfix" id="body-content"><div class="cols">
-    <div class="col-3 dac-toggle dac-mobile" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
-      <?cs call:mobile_nav_toggle() ?>
-      <div class="dac-toggle-content" id="devdoc-nav">
-        <div class="scroll-pane">
-<?cs include:"../../../../frameworks/base/docs/html/design/design_toc.cs" ?>
-        </div>
-      </div>
-    </div> <!-- end side-nav -->
-    <script>
-      $(document).ready(function() {
-        scrollIntoView("devdoc-nav");
-        });
-    </script>
-<?cs /def ?>
-<?cs
-def:distribute_nav() ?>
-  <div class="wrap clearfix" id="body-content"><div class="cols">
-    <div class="col-3 dac-toggle dac-mobile" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
-      <?cs call:mobile_nav_toggle() ?>
-      <div class="dac-toggle-content" id="devdoc-nav">
-        <div class="scroll-pane">
-<?cs include:"../../../../frameworks/base/docs/html/distribute/distribute_toc.cs" ?>
-        </div>
-      </div>
-    </div> <!-- end side-nav -->
-    <script>
-      $(document).ready(function() {
-        scrollIntoView("devdoc-nav");
-        });
-    </script>
 <?cs /def ?>
 
-<?cs
-def:samples_nav() ?>
-  <div class="wrap clearfix" id="body-content"><div class="cols">
-    <div class="col-4 dac-toggle dac-mobile" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
-      <?cs call:mobile_nav_toggle() ?>
-      <div class="dac-toggle-content" id="devdoc-nav">
-        <div class="scroll-pane">
-<?cs include:"../../../../frameworks/base/docs/html/samples/samples_toc.cs" ?>
-        </div>
-      </div>
-
-    </div> <!-- end side-nav -->
-    <script>
-      $(document).ready(function() {
-        scrollIntoView("devdoc-nav");
-        });
-    </script>
+<?cs def:fullpage() ?>
+  <div id="body-content">
+    <div>
 <?cs /def ?>
 
-<?cs
-def:google_nav() ?>
-  <div class="wrap clearfix" id="body-content"><div class="cols">
-    <div class="col-4 dac-toggle dac-mobile" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
-      <?cs call:mobile_nav_toggle() ?>
-      <div class="dac-toggle-content" id="devdoc-nav">
-        <div class="scroll-pane">
-<?cs include:"../../../../frameworks/base/docs/html/google/google_toc.cs" ?>
-        </div>
-      </div>
-      <script type="text/javascript">
-       showGoogleRefTree();
-
-      </script>
-    </div> <!-- end side-nav -->
-    <script>
-      $(document).ready(function() {
-        scrollIntoView("devdoc-nav");
-        });
-    </script>
-<?cs /def ?>
+<?cs # The default side navigation for the reference docs ?>
+<?cs def:reference_default_nav() ?>
+  <!-- Fullscreen toggler -->
+  <button data-fullscreen class="dac-nav-fullscreen">
+    <i class="dac-sprite dac-fullscreen"></i>
+  </button>
 
-<?cs
-def:about_nav() ?>
-  <div class="wrap clearfix" id="body-content"><div class="cols">
-    <div class="col-3 dac-toggle dac-mobile" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
-      <?cs call:mobile_nav_toggle() ?>
-      <div class="dac-toggle-content" id="devdoc-nav">
-        <div class="scroll-pane">
-<?cs include:"../../../../frameworks/base/docs/html/about/about_toc.cs" ?>
-        </div>
-      </div>
-    </div> <!-- end side-nav -->
-    <script>
-      $(document).ready(function() {
-        scrollIntoView("devdoc-nav");
-        });
-    </script>
-<?cs /def ?>
+  <script>$('[data-fullscreen]').dacFullscreen();</script>
+  <!-- End: Fullscreen toggler -->
 
-
-<?cs
-def:wear_nav() ?>
-  <div class="wrap clearfix" id="body-content"><div class="cols">
-    <div class="col-4 dac-toggle dac-mobile" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
-      <?cs call:mobile_nav_toggle() ?>
-      <div class="dac-toggle-content" id="devdoc-nav">
-        <div class="scroll-pane">
-<?cs include:"../../../../frameworks/base/docs/html/wear/wear_toc.cs" ?>
-        </div>
-      </div>
-    </div> <!-- end side-nav -->
-    <script>
-      $(document).ready(function() {
-        scrollIntoView("devdoc-nav");
-        });
+  <?cs if:reference.gcm || reference.gms ?>
+    <?cs include:"../../../../frameworks/base/docs/html/google/google_toc.cs" ?>
+    <script type="text/javascript">
+      showGoogleRefTree();
     </script>
-<?cs /def ?>
-
-
-<?cs # The default side navigation for the reference docs ?><?cs
-def:default_left_nav() ?>
-<?cs if:reference.gcm || reference.gms ?>
-  <?cs call:google_nav() ?>
-<?cs else ?>
-  <div class="wrap clearfix" id="body-content"><div class="cols">
-    <div class="col-4 dac-hidden-mobile" id="side-nav" itemscope itemtype="http://schema.org/SiteNavigationElement">
-      <div id="devdoc-nav">
+  <?cs else ?>
+    <div id="devdoc-nav">
       <div id="api-nav-header">
         <div id="api-level-toggle">
           <label for="apiLevelCheckbox" class="disabled"
-            title="Select your target API level to dim unavailable APIs">API level: </label>
+                 title="Select your target API level to dim unavailable APIs">API level: </label>
           <div class="select-wrapper">
             <select id="apiLevelSelector">
               <!-- option elements added by buildApiLevelSelector() -->
@@ -347,96 +35,45 @@ def:default_left_nav() ?>
           </div>
         </div><!-- end toggle -->
         <div id="api-nav-title">Android APIs</div>
-        </div><!-- end nav header -->
+      </div><!-- end nav header -->
       <script>
         var SINCE_DATA = [ <?cs
           each:since = since ?>'<?cs
             var:since.name ?>'<?cs
             if:!last(since) ?>, <?cs /if ?><?cs
-          /each
-        ?> ];
+            /each
+          ?> ];
         buildApiLevelSelector();
       </script>
 
-      <div id="swapper">
-        <div id="nav-panels">
-          <div id="resize-packages-nav">
-            <div id="packages-nav" class="scroll-pane">
-
-              <ul>
-                <?cs call:package_link_list(docs.packages) ?>
-              </ul><br/>
-
-            </div> <!-- end packages-nav -->
-          </div> <!-- end resize-packages -->
-          <div id="classes-nav" class="scroll-pane">
-
-
-<?cs
-            if:subcount(class.package) ?>
-            <ul>
-              <?cs call:list("Annotations", class.package.annotations) ?>
-              <?cs call:list("Interfaces", class.package.interfaces) ?>
-              <?cs call:list("Classes", class.package.classes) ?>
-              <?cs call:list("Enums", class.package.enums) ?>
-              <?cs call:list("Exceptions", class.package.exceptions) ?>
-              <?cs call:list("Errors", class.package.errors) ?>
-            </ul><?cs
-            elif:subcount(package) ?>
-            <ul>
-              <?cs call:class_link_list("Annotations", package.annotations) ?>
-              <?cs call:class_link_list("Interfaces", package.interfaces) ?>
-              <?cs call:class_link_list("Classes", package.classes) ?>
-              <?cs call:class_link_list("Enums", package.enums) ?>
-              <?cs call:class_link_list("Exceptions", package.exceptions) ?>
-              <?cs call:class_link_list("Errors", package.errors) ?>
-            </ul><?cs
-            else ?>
-              <p style="padding:10px">Select a package to view its members</p><?cs
-            /if ?><br/>
-
-
-          </div><!-- end classes -->
-        </div><!-- end nav-panels -->
-        <div id="nav-tree" style="display:none" class="scroll-pane">
-          <div id="tree-list"></div>
-        </div><!-- end nav-tree -->
-      </div><!-- end swapper -->
-      <div id="nav-swap">
-      <a class="fullscreen">fullscreen</a>
-      <a href='#' onclick='swapNav();return false;'><span id='tree-link'>Use Tree Navigation</span><span id='panel-link' style='display:none'>Use Panel Navigation</span></a>
+      <div class="dac-reference-nav" data-reference-tree>
+        <ul class="dac-reference-nav-list" data-reference-namespaces>
+          <?cs call:package_link_list(docs.packages) ?>
+        </ul>
+
+        <?cs if:subcount(class.package) ?>
+        <ul data-reference-resources>
+          <?cs call:list("Annotations", class.package.annotations) ?>
+          <?cs call:list("Interfaces", class.package.interfaces) ?>
+          <?cs call:list("Classes", class.package.classes) ?>
+          <?cs call:list("Enums", class.package.enums) ?>
+          <?cs call:list("Exceptions", class.package.exceptions) ?>
+          <?cs call:list("Errors", class.package.errors) ?>
+        </ul>
+        <?cs elif:subcount(package) ?>
+        <ul data-reference-resources>
+          <?cs call:class_link_list("Annotations", package.annotations) ?>
+          <?cs call:class_link_list("Interfaces", package.interfaces) ?>
+          <?cs call:class_link_list("Classes", package.classes) ?>
+          <?cs call:class_link_list("Enums", package.enums) ?>
+          <?cs call:class_link_list("Exceptions", package.exceptions) ?>
+          <?cs call:class_link_list("Errors", package.errors) ?>
+        </ul>
+        <?cs /if ?>
       </div>
-    </div> <!-- end devdoc-nav -->
-    </div> <!-- end side-nav -->
-    <script type="text/javascript">
-      // init fullscreen based on user pref
-      var fullscreen = readCookie("fullscreen");
-      if (fullscreen != 0) {
-        if (fullscreen == "false") {
-          toggleFullscreen(false);
-        } else {
-          toggleFullscreen(true);
-        }
-      }
-      // init nav version for mobile
-      if (isMobile) {
-        swapNav(); // tree view should be used on mobile
-        $('#nav-swap').hide();
-      } else {
-        chooseDefaultNav();
-        if ($("#nav-tree").is(':visible')) {
-          init_default_navtree("<?cs var:toroot ?>");
-        }
-      }
-      // scroll the selected page into view
-      $(document).ready(function() {
-        scrollIntoView("packages-nav");
-        scrollIntoView("classes-nav");
-        });
-    </script>
-<?cs /if ?>
-    <?cs
-/def ?>
+    </div>
+  <?cs /if ?>
+<?cs /def ?>
 
 <?cs
 def:ndk_nav() ?>
@@ -454,148 +91,167 @@ elif:samples ?><?cs include:"../../../../frameworks/base/docs/html/ndk/samples/s
         </div>
       </div>
     </div> <!-- end side-nav -->
-    <script>
-      $(document).ready(function() {
-        scrollIntoView("devdoc-nav");
-        });
-    </script>
 <?cs /def ?>
 
-<?cs
-def:header_search_widget() ?>
-  <div class="dac-header-search" id="search-container">
-    <div class="dac-header-search-inner">
-      <div class="dac-sprite dac-search dac-header-search-btn" id="search-btn"></div>
-      <form class="dac-header-search-form" onsubmit="return submit_search()">
-        <input id="search_autocomplete" type="text" value="" autocomplete="off" name="q"
-          onfocus="search_focus_changed(this, true)" onblur="search_focus_changed(this, false)"
-          onkeydown="return search_changed(event, true, '<?cs var:toroot ?>')"
-          onkeyup="return search_changed(event, false, '<?cs var:toroot ?>')"
-          class="dac-header-search-input" placeholder="Search" />
-          <a class="dac-header-search-close hide" id="search-close">close</a>
-      </form>
-    </div><!-- end dac-header-search-inner -->
-  </div><!-- end dac-header-search -->
+<?cs def:header_search_widget() ?>
+  <form data-search class="dac-header-search">
+    <button class="dac-header-search-close" data-search-close>
+      <i class="dac-sprite dac-back-arrow"></i>
+    </button>
 
-  <div class="search_filtered_wrapper">
-    <div class="suggest-card reference no-display">
-      <ul class="search_filtered">
-      </ul>
+    <div class="dac-header-search-inner">
+      <i class="dac-sprite dac-search-white dac-header-search-icon"></i>
+      <input id="search_autocomplete" type="text" value="" autocomplete="off" name="q" class="dac-header-search-input" placeholder="Search" />
+      <button class="dac-header-search-clear dac-hidden" data-search-clear>
+        <i class="dac-sprite dac-close-black"></i>
+      </button>
     </div>
-    <div class="suggest-card develop no-display">
-      <ul class="search_filtered">
-      </ul>
-      <div class="child-card guides no-display">
+  </form>
+<?cs /def ?>
+
+<?cs def:search_results() ?>
+  <div id="search-results" class="dac-search-results">
+    <div id="dac-search-results-history" class="dac-search-results-history">
+      <div class="wrap dac-search-results-history-wrap">
+        <div class="cols">
+          <div class="col-1of2 col-tablet-1of2 col-mobile-1of1">
+            <h2>Most visited</h2>
+            <div class="resource-flow-layout" data-history-query="history:most/visited" data-maxresults="3" data-cardsizes="18x2"></div>
+          </div>
+
+          <div class="col-1of2 col-tablet-1of2 col-mobile-1of1">
+            <h2>Recently visited</h2>
+            <div class="resource-flow-layout cols" data-history-query="history:recent" data-allow-duplicates="true" data-maxresults="3" data-cardsizes="18x2"></div>
+          </div>
+        </div>
       </div>
-      <div class="child-card training no-display">
+    </div>
+
+    <div id="dac-search-results-content" class="dac-search-results-content">
+      <div class="dac-search-results-metadata wrap">
+        <div class="dac-search-results-for">
+          <h2>Results for <span id="search-results-for"></span></h2>
+        </div>
+
+        <div id="dac-search-results-hero"></div>
+
+        <div class="dac-search-results-hero cols">
+          <div id="dac-search-results-reference" class="col-2of6 col-tablet-1of2 col-mobile-1of1">
+            <div class="suggest-card reference no-display">
+              <ul class="dac-search-results-reference">
+              </ul>
+            </div>
+          </div>
+          <div id="search-resources"
+            class="dac-search-results-resources resource-flow-layout"
+            data-maxresults="10"
+            data-cardsizes="6x2">
+          </div>
+        </div>
       </div>
-      <div class="child-card samples no-display">
+
+      <div id="dac-custom-search" class="dac-custom-search">
+        <div class="wrap dac-offset-parent">
+          <a class="dac-fab dac-scroll-button" data-scroll-button="" data-scroll-container="#search-results" href="#dac-custom-search">
+            <i class="dac-sprite dac-arrow-down-gray"></i>
+          </a>
+        </div>
+
+        <div class="wrap">
+          <h2 class="dac-custom-search-section-title">More results</h2>
+          <div id="dac-custom-search-results"></div>
+        </div>
       </div>
     </div>
-    <div class="suggest-card design no-display">
-      <ul class="search_filtered">
-      </ul>
-    </div>
-    <div class="suggest-card distribute no-display">
-      <ul class="search_filtered">
-      </ul>
-    </div>
   </div>
 <?cs /def ?>
 
+<?cs def:custom_left_nav() ?>
+  <?cs if:(!fullpage && !nonavpage) || forcelocalnav ?>
+    <a class="dac-nav-back-button dac-swap-section dac-up dac-no-anim" data-swap-button href="javascript:;">
+      <i class="dac-sprite dac-nav-back"></i> <span class="dac-nav-back-title">Back</span>
+    </a>
+    <div class="dac-nav-sub dac-swap-section dac-right dac-active" itemscope itemtype="http://schema.org/SiteNavigationElement">
+      <?cs if:ndk ?>
+        <?cs if:guide ?>
+          <?cs include:"../../../../frameworks/base/docs/html/ndk/guides/guides_toc.cs" ?>
+        <?cs elif:reference ?>
+          <?cs include:"../../../../frameworks/base/docs/html/ndk/reference/reference_toc.cs" ?>
+        <?cs elif:downloads ?>
+          <?cs include:"../../../../frameworks/base/docs/html/ndk/downloads/downloads_toc.cs" ?>
+        <?cs elif:samples ?>
+          <?cs include:"../../../../frameworks/base/docs/html/ndk/samples/samples_toc.cs" ?>
+        <?cs else ?>
+          <?cs call:reference_default_nav() ?>
+        <?cs /if ?>
+      <?cs elif:guide ?>
+        <?cs include:"../../../../frameworks/base/docs/html/guide/guide_toc.cs" ?>
+      <?cs elif:design ?>
+        <?cs include:"../../../../frameworks/base/docs/html/design/design_toc.cs" ?>
+      <?cs elif:training ?>
+        <?cs include:"../../../../frameworks/base/docs/html/training/training_toc.cs" ?>
+      <?cs elif:tools ?>
+        <?cs include:"../../../../frameworks/base/docs/html/tools/tools_toc.cs" ?>
+      <?cs elif:google ?>
+        <?cs include:"../../../../frameworks/base/docs/html/google/google_toc.cs" ?>
+      <?cs elif:samples ?>
+        <?cs include:"../../../../frameworks/base/docs/html/samples/samples_toc.cs" ?>
+      <?cs elif:distribute ?>
+        <?cs if:googleplay ?>
+          <?cs include:"../../../../frameworks/base/docs/html/distribute/googleplay/googleplay_toc.cs" ?>
+        <?cs elif:essentials ?>
+          <?cs include:"../../../../frameworks/base/docs/html/distribute/essentials/essentials_toc.cs" ?>
+        <?cs elif:users ?>
+          <?cs include:"../../../../frameworks/base/docs/html/distribute/users/users_toc.cs" ?>
+        <?cs elif:engage ?>
+          <?cs include:"../../../../frameworks/base/docs/html/distribute/engage/engage_toc.cs" ?>
+        <?cs elif:monetize ?>
+          <?cs include:"../../../../frameworks/base/docs/html/distribute/monetize/monetize_toc.cs" ?>
+        <?cs elif:analyze ?>
+          <?cs include:"../../../../frameworks/base/docs/html/distribute/analyze/analyze_toc.cs" ?>
+        <?cs elif:disttools ?>
+          <?cs include:"../../../../frameworks/base/docs/html/distribute/tools/disttools_toc.cs" ?>
+        <?cs elif:stories ?>
+          <?cs include:"../../../../frameworks/base/docs/html/distribute/stories/stories_toc.cs" ?>
+        <?cs /if ?>
+      <?cs elif:about ?>
+        <?cs include:"../../../../frameworks/base/docs/html/about/about_toc.cs" ?>
+      <?cs else ?>
+        <?cs call:reference_default_nav() ?>
+      <?cs /if ?>
+    </div>
+  <?cs /if ?>
+<?cs /def ?>
 
-<?cs
-def:custom_left_nav() ?><?cs
-  if:ndk ?><?cs
-    if:fullpage ?><?cs
-      call:fullpage() ?><?cs
-    elif:nonavpage ?><?cs
-      call:no_nav() ?><?cs
-    elif:guide || reference || samples || downloads ?><?cs
-      call:ndk_nav() ?><?cs
-    else ?><?cs
-      call:default_left_nav() ?> <?cs
-    /if ?><?cs
-  else ?><?cs
-    if:fullpage ?><?cs
-      call:fullpage() ?><?cs
-    elif:nonavpage ?><?cs
-      call:no_nav() ?><?cs
-    elif:guide ?><?cs
-      call:guide_nav() ?><?cs
-    elif:design ?><?cs
-      call:design_nav() ?><?cs
-    elif:training ?><?cs
-      call:training_nav() ?><?cs
-    elif:tools ?><?cs
-      call:tools_nav() ?><?cs
-    elif:google ?><?cs
-      call:google_nav() ?><?cs
-    elif:samples ?><?cs
-      call:samples_nav() ?><?cs
-    elif:distribute ?><?cs
-      if:googleplay ?><?cs
-        call:googleplay_nav() ?><?cs
-      elif:essentials ?><?cs
-        call:essentials_nav() ?><?cs
-      elif:users ?><?cs
-        call:users_nav() ?><?cs
-      elif:engage ?><?cs
-        call:engage_nav() ?><?cs
-      elif:monetize ?><?cs
-        call:monetize_nav() ?><?cs
-      elif:analyze ?><?cs
-        call:analyze_nav() ?><?cs
-      elif:disttools ?><?cs
-        call:disttools_nav() ?><?cs
-      elif:stories ?><?cs
-        call:stories_nav() ?><?cs
-      /if ?><?cs
-    elif:about ?><?cs
-      call:about_nav() ?><?cs
-    elif:distribute ?><?cs
-      call:distribute_nav() ?><?cs
-    elif:wear ?><?cs
-      call:wear_nav() ?><?cs
-    else ?><?cs
-      call:default_left_nav() ?> <?cs
-    /if ?><?cs
-  /if ?><?cs
-/def ?>
-
-<?cs # appears at the bottom of every page ?><?cs
-def:custom_cc_copyright() ?>
+<?cs # appears at the bottom of every page ?>
+<?cs def:custom_cc_copyright() ?>
   Except as noted, this content is
   licensed under <a href="http://creativecommons.org/licenses/by/2.5/">
   Creative Commons Attribution 2.5</a>. For details and
   restrictions, see the <a href="<?cs var:toroot ?>license.html">Content
-  License</a>.<?cs
-/def ?>
+  License</a>.
+<?cs /def ?>
 
-<?cs
-def:custom_copyright() ?>
+<?cs def:custom_copyright() ?>
   Except as noted, this content is licensed under <a
   href="http://www.apache.org/licenses/LICENSE-2.0">Apache 2.0</a>.
   For details and restrictions, see the <a href="<?cs var:toroot ?>license.html">
-  Content License</a>.<?cs
-/def ?>
+  Content License</a>.
+<?cs /def ?>
 
-<?cs
-def:custom_footerlinks() ?>
-  <a href="<?cs var:toroot ?>about/index.html">About Android</a>
+<?cs def:custom_footerlinks() ?>
+  <a href="<?cs var:toroot ?>about/android.html">About Android</a>
   <a href="<?cs var:toroot ?>auto/index.html">Auto</a>
   <a href="<?cs var:toroot ?>tv/index.html">TV</a>
   <a href="<?cs var:toroot ?>wear/index.html">Wear</a>
   <a href="<?cs var:toroot ?>legal.html">Legal</a>
-  <?cs
-/def ?>
-
-<?cs # appears on the right side of the blue bar at the bottom off every page ?><?cs
-def:custom_buildinfo() ?><?cs
-  if:!google && !reference.gcm && !reference.gms ?>
-    Android <?cs var:sdk.version ?>&nbsp;r<?cs var:sdk.rel.id ?> &mdash; <?cs
-  /if ?>
-<script src="<?cs var:toroot ?>timestamp.js" type="text/javascript"></script>
-<script>document.write(BUILD_TIMESTAMP)</script>
 <?cs /def ?>
 
+<?cs # appears on the right side of the blue bar at the bottom off every page ?>
+<?cs def:custom_buildinfo() ?>
+  <?cs if:!google && !reference.gcm && !reference.gms ?>
+    Android <?cs var:sdk.version ?>&nbsp;r<?cs var:sdk.rel.id ?> &mdash;
+  <?cs /if ?>
+  <script src="<?cs var:toroot ?>timestamp.js" type="text/javascript"></script>
+  <script>document.write(BUILD_TIMESTAMP)</script>
+<?cs /def ?>
index b945a1c..d75ce0a 100644 (file)
       <?cs elif:header.title ?><h2><?cs var:header.title ?></h2>
                    <?cs else ?><h2><?cs var:page.title ?></h2>
     <?cs /if ?>
-  <div class="paging-links" itemscope itemtype="http://schema.org/SiteNavigationElement">
-    <a href="#" class="prev-page-link">Previous</a>
-    <a href="#" class="next-page-link">Next</a>
-  </div>
 </div>
 <?cs /if ?>
 
index b966977..7f53e6f 100644 (file)
       if:disttools ?> disttools<?cs /if ?><?cs
       if:stories ?> stories<?cs /if ?><?cs
       if:analyze ?> analyze<?cs /if ?><?cs
-    elif:(about||wear||tv||auto) ?>about<?cs
-    elif:design ?>design<?cs
+    elif:(design||vision||material||patterns||devices||designdownloads) ?> design<?cs
+      if:vision ?> vision<?cs /if ?><?cs
+      if:material ?> material<?cs /if ?><?cs
+      if:patterns ?> patterns<?cs /if ?><?cs
+      if:devices ?> devices<?cs /if ?><?cs
+      if:designdownloads ?> designdownloads<?cs /if ?><?cs
+    elif:(about||versions||wear||tv||auto) ?> about<?cs
+      if:versions ?> versions<?cs /if ?><?cs
+      if:wear ?> wear<?cs /if ?><?cs
+      if:tv ?> tv<?cs /if ?><?cs
+      if:auto ?> auto<?cs /if ?><?cs
     /if ?><?cs
     if:page.trainingcourse ?> trainingcourse<?cs /if ?><?cs
 /if ?>" itemscope itemtype="http://schema.org/Article"><?cs
 include:"header.cs" ?>
 
-<div <?cs
-  if:fullpage
-    ?>class="fullpage"<?cs
-  elif:(design||tools||about||sdk||googleplay||essentials||users||engage||monetize||disttools||stories) && !nonavpage
-    ?>class="col-13" id="doc-col"<?cs
-  elif:!nonavpage
-    ?>class="col-12" id="doc-col"<?cs /if ?> >
-
-<?cs if:(design||training||walkthru) && !page.trainingcourse && !page.article ?><?cs # header logic for docs that provide previous/next buttons ?>
-  <?cs if:header.hide ?>
+<?cs if:(design||training||walkthru) && !page.trainingcourse && !page.article ?><?cs
+# header logic for docs that provide previous/next buttons ?>
+  <?cs if:(header.hide||devsite) ?>
   <?cs else ?>
   <div class="content-header <?cs if:header.justLinks ?>just-links<?cs /if ?>">
       <?cs if:header.justLinks ?>&nbsp;
-      <?cs else ?><h1 itemprop="name"><?cs var:page.title ?></h1>
+      <?cs else ?>
+        <ul class="dac-header-crumbs">
+          <?cs # More <li> elements added here with javascript ?>
+        </ul>
+
+        <!-- Breadcrumb Setup -->
+        <script>$('.dac-nav-list').dacCurrentPage().dacCrumbs();</script>
+
+        <h1 itemprop="name"><?cs var:page.title ?>
+      </h1>
       <?cs /if ?>
     <?cs if:training ?>
       <div class="training-nav-top" itemscope itemtype="http://schema.org/SiteNavigationElement">
@@ -75,7 +86,7 @@ include:"header.cs" ?>
             >Get started</a>
       </div>
     <?cs elif:!page.trainingcourse ?>
-      <div class="paging-links" itemscope itemtype="http://schema.org/SiteNavigationElement">
+      <?cs # <div class="paging-linkss" itemscope itemtype="http://schema.org/SiteNavigationElement">
         <a href="#" class="prev-page-link hide"
             zh-tw-lang="上一堂課"
             zh-cn-lang="上一课"
@@ -92,7 +103,7 @@ include:"header.cs" ?>
             ja-lang="次へ"
             es-lang="Siguiente"
             >Next</a>
-      </div>
+      </div> ?>
     <?cs /if ?><?cs # end if training ?>
   </div>
   <?cs /if ?><?cs # end if header.hide ?>
@@ -117,7 +128,7 @@ include:"header.cs" ?>
 </style>
   <?cs /if ?>
 
-  <?cs if:(!fullpage && !header.hide) ?>
+  <?cs if:(!fullpage && !header.hide && !devsite) ?>
     <?cs if:page.landing ?><?cs # header logic for docs that are landing pages ?>
       <div class="landing-banner">
         <?cs if:page.landing.image ?><?cs # use two-column layout only if there is an image ?>
@@ -138,6 +149,13 @@ include:"header.cs" ?>
       </div>
     <?cs else ?>
       <?cs if:tab1 ?><div id="title-tabs-wrapper"><?cs /if ?>
+        <ul class="dac-header-crumbs">
+          <?cs # More <li> elements added here with javascript ?>
+        </ul>
+
+        <!-- Breadcrumb Setup -->
+        <p><script>$('.dac-nav-list').dacCurrentPage().dacCrumbs();</script></p>
+
         <h1 itemprop="name" <?cs if:tab1 ?>class="with-title-tabs"<?cs /if ?>><?cs var:page.title ?></h1><?cs
           if:tab1 ?><ul id="title-tabs">
               <li class="selected"><a href="<?cs var:tab1.link ?>"><?cs var:tab1 ?></a></li>
@@ -154,17 +172,47 @@ include:"header.cs" ?>
 
   <?cs # THIS IS THE MAIN DOC CONTENT ?>
   <div id="jd-content">
+    <div class="jd-descr" itemprop="articleBody">
+    <?cs if:(!fullpage && !header.hide && devsite) ?>
+      <?cs if:page.landing ?><?cs # header logic for docs that are landing pages ?>
+        <div class="landing-banner">
+          <?cs if:page.landing.image ?><?cs # use two-column layout only if there is an image ?>
+          <div class="cols">
+            <div class="col-6">
+              <img src="<?cs var:toroot ?><?cs var:page.landing.image ?>" alt="" />
+            </div>
+            <div class="col-6">
+          <?cs /if ?>
+            <h1 itemprop="name" style="margin-bottom:0;"><?cs var:page.title ?></h1>
+            <p itemprop="description"><?cs var:page.landing.intro ?></p>
 
+            <p><a class="next-page-link topic-start-link"></a></p>
+          <?cs if:page.landing.image ?>
+            </div>
+          </div>
+          <?cs /if ?>
+        </div>
+      <?cs /if ?>
+    <?cs /if ?>
 
-    <div class="jd-descr" itemprop="articleBody">
     <?cs call:tag_list(root.descr) ?>
     </div>
 
-    <?cs if:!fullscreen && (design||training||walkthru) && !page.landing && !page.trainingcourse && !footer.hide ?>
+    <?cs if:!fullscreen && (design||training||walkthru) && !page.landing && !page.trainingcourse
+      && !footer.hide && !devsite?>
       <div class="content-footer <?cs
                     if:fullpage ?>wrap<?cs /if ?>"
                     itemscope itemtype="http://schema.org/SiteNavigationElement">
           <div class="paging-links">
+            <a href="#" class="prev-page-link hide"
+              zh-tw-lang="上一堂課"
+              zh-cn-lang="上一课"
+              ru-lang="Предыдущий"
+              ko-lang="이전"
+              ja-lang="前へ"
+              es-lang="Anterior"
+              ><span class="page-link-caption">Previous</span>
+            </a>
             <a href="#" class="next-page-link hide"
                 zh-tw-lang="下一堂課"
                 zh-cn-lang="下一课"
@@ -172,7 +220,8 @@ include:"header.cs" ?>
                 ko-lang="다음"
                 ja-lang="次へ"
                 es-lang="Siguiente"
-                >Next</a>
+                ><span class="page-link-caption">Next</span>
+            </a>
             <a href="#" class="start-class-link hide"
                 zh-tw-lang="開始上課"
                 zh-cn-lang="开始"
@@ -181,22 +230,18 @@ include:"header.cs" ?>
                 ja-lang="開始する"
                 es-lang="Empezar"
                 >Get started</a>
-            <a href="#" class="next-class-link hide">Next class</a>
+            <a href="#" class="next-class-link hide">
+              <span class="page-link-caption">Next class</span>
+            </a>
           </div>
       </div>
     <?cs /if ?>
 
   </div> <!-- end jd-content -->
 
+<?cs if:!devsite ?>
 <?cs include:"footer.cs" ?>
-</div><!-- end doc-content -->
-
 <?cs include:"trailer.cs" ?>
-  <script src="https://developer.android.com/ytblogger_lists_unified.js?v=17" type="text/javascript"></script>
-  <script src="<?cs var:toroot ?>jd_lists_unified.js?v=17" type="text/javascript"></script>
-  <script src="<?cs var:toroot ?>jd_extras.js?v=17" type="text/javascript"></script>
-  <script src="<?cs var:toroot ?>jd_collections.js?v=17" type="text/javascript"></script>
-  <script src="<?cs var:toroot ?>jd_tag_helpers.js?v=17" type="text/javascript"></script>
-
+<?cs /if ?>
 </body>
 </html>
index 666f594..7818301 100644 (file)
@@ -2,7 +2,7 @@
   <div class="dac-footer<?cs if:fullpage ?> dac-landing<?cs /if ?>">
     <div class="cols dac-footer-main">
       <div class="col-1of2">
-        <a class="dac-footer-getnews" data-modal-toggle="newsletter" href="javascript:;">Get news &amp; tips <span
+        <a class="dac-footer-getnews" id="newsletter" data-modal-toggle="newsletter" href="javascript:;">Get news &amp; tips <span
           class="dac-fab dac-primary"><i class="dac-sprite dac-mail"></i></span></a>
       </div>
       <div class="col-1of2 dac-footer-reachout">
@@ -11,9 +11,9 @@
           <a class="dac-footer-contact-link" href="/support.html">Support</a>
         </div>
         <div class="dac-footer-social">
-          <a class="dac-fab dac-footer-social-link" href="https://www.youtube.com/user/androiddevelopers"><i class="dac-sprite dac-youtube"></i></a>
-          <a class="dac-fab dac-footer-social-link" href="https://plus.google.com/+AndroidDevelopers"><i class="dac-sprite dac-gplus"></i></a>
-          <a class="dac-fab dac-footer-social-link" href="https://twitter.com/AndroidDev"><i class="dac-sprite dac-twitter"></i></a>
+          <a class="dac-button-social dac-youtube dac-footer-social-link" href="https://www.youtube.com/user/androiddevelopers"><i class="dac-sprite dac-youtube"></i></a>
+          <a class="dac-button-social dac-gplus dac-footer-social-link" href="https://plus.google.com/+AndroidDevelopers"><i class="dac-sprite dac-gplus"></i></a>
+          <a class="dac-button-social dac-twitter dac-footer-social-link" href="https://twitter.com/AndroidDev"><i class="dac-sprite dac-twitter"></i></a>
         </div>
       </div>
     </div>
@@ -34,7 +34,7 @@
     <?cs /if ?>
 
     <p class="dac-footer-links">
-      <a href="/about/index.html">About Android</a>
+      <a href="/about/android.html">About Android</a>
       <a href="/auto/index.html">Auto</a>
       <a href="/tv/index.html">TV</a>
       <a href="/wear/index.html">Wear</a>
       </span>
     </p>
   </div>
-</div> <!-- end footer -->
+</div>
+<!-- end footer -->
+
+<?cs call:toast() ?>
 
 <div data-modal="newsletter" data-newsletter data-swap class="dac-modal newsletter">
   <div class="dac-modal-container">
     <div class="dac-modal-window">
       <header class="dac-modal-header">
-        <button class="dac-modal-header-close" data-modal-toggle><i class="dac-sprite dac-close"></i></button>
+        <div class="dac-modal-header-actions">
+          <button class="dac-modal-header-close" data-modal-toggle></button>
+        </div>
         <div class="dac-swap" data-swap-container>
           <section class="dac-swap-section dac-active dac-down">
-            <h2 class="norule dac-modal-header-title">Get the latest Android developer news and tips that will help you find success on Google Play.</h2>
-            <p class="dac-modal-header-subtitle">&#42; Required Fields</p>
+            <h2 class="norule dac-modal-header-title" data-t="newsletter.title"></h2>
+            <p class="dac-modal-header-subtitle" data-t="newsletter.requiredHint"></p>
           </section>
           <section class="dac-swap-section dac-up">
-            <h2 class="norule dac-modal-header-title">Hooray!</h2>
+            <h2 class="norule dac-modal-header-title" data-t="newsletter.successTitle">Hooray!</h2>
           </section>
         </div>
       </header>
       <div class="dac-swap" data-swap-container>
         <section class="dac-swap-section dac-active dac-left">
           <form action="https://docs.google.com/forms/d/1QgnkzbEJIDu9lMEea0mxqWrXUJu0oBCLD7ar23V0Yys/formResponse" class="dac-form" method="post" target="dac-newsletter-iframe">
+            <input type="hidden" name="entry.935454734" data-newsletter-language>
             <section class="dac-modal-content">
               <fieldset class="dac-form-fieldset">
                 <div class="cols">
                   <div class="col-1of2 newsletter-leftCol">
                     <div class="dac-form-input-group">
-                      <label for="newsletter-full-name" class="dac-form-floatlabel">Full name</label>
+                      <label for="newsletter-full-name" class="dac-form-floatlabel" data-t="newsletter.name">Full name</label>
                       <input type="text" class="dac-form-input" name="entry.1357890476" id="newsletter-full-name" required>
                       <span class="dac-form-required">*</span>
                     </div>
                     <div class="dac-form-input-group">
-                      <label for="newsletter-email" class="dac-form-floatlabel">Email address</label>
+                      <label for="newsletter-email" class="dac-form-floatlabel" data-t="newsletter.email">Email address</label>
                       <input type="email" class="dac-form-input" name="entry.472100832" id="newsletter-email" required>
                       <span class="dac-form-required">*</span>
                     </div>
                   </div>
                   <div class="col-1of2 newsletter-rightCol">
                     <div class="dac-form-input-group">
-                      <label for="newsletter-company" class="dac-form-floatlabel">Company / developer name</label>
+                      <label for="newsletter-company" class="dac-form-floatlabel" data-t="newsletter.company">Company / developer name</label>
                       <input type="text" class="dac-form-input" name="entry.1664780309" id="newsletter-company">
                     </div>
                     <div class="dac-form-input-group">
-                      <label for="newsletter-play-store" class="dac-form-floatlabel">One of your Play Store app URLs</label>
+                      <label for="newsletter-play-store" class="dac-form-floatlabel" data-t="newsletter.appUrl">One of your Play Store app URLs</label>
                       <input type="url" class="dac-form-input" name="entry.47013838" id="newsletter-play-store" required>
                       <span class="dac-form-required">*</span>
                     </div>
               <fieldset class="dac-form-fieldset">
                 <div class="cols">
                   <div class="col-1of2 newsletter-leftCol">
-                    <legend class="dac-form-legend">Which best describes your business:<span class="dac-form-required">*</span>
+                    <legend class="dac-form-legend"><span data-t="newsletter.business.label">Which best describes your business:</span><span class="dac-form-required">*</span>
                     </legend>
                     <div class="dac-form-radio-group">
                       <input type="radio" value="Apps" class="dac-form-radio" name="entry.1796324055" id="newsletter-business-type-app" required>
                       <label for="newsletter-business-type-app" class="dac-form-radio-button"></label>
-                      <label for="newsletter-business-type-app" class="dac-form-label">Apps</label>
+                      <label for="newsletter-business-type-app" class="dac-form-label" data-t="newsletter.business.apps">Apps</label>
                     </div>
                     <div class="dac-form-radio-group">
                       <input type="radio" value="Games" class="dac-form-radio" name="entry.1796324055" id="newsletter-business-type-games" required>
                       <label for="newsletter-business-type-games" class="dac-form-radio-button"></label>
-                      <label for="newsletter-business-type-games" class="dac-form-label">Games</label>
+                      <label for="newsletter-business-type-games" class="dac-form-label" data-t="newsletter.business.games">Games</label>
                     </div>
                     <div class="dac-form-radio-group">
                       <input type="radio" value="Apps and Games" class="dac-form-radio" name="entry.1796324055" id="newsletter-business-type-appsgames" required>
                       <label for="newsletter-business-type-appsgames" class="dac-form-radio-button"></label>
-                      <label for="newsletter-business-type-appsgames" class="dac-form-label">Apps &amp; Games</label>
+                      <label for="newsletter-business-type-appsgames" class="dac-form-label" data-t="newsletter.business.both">Apps &amp; Games</label>
                     </div>
                   </div>
                   <div class="col-1of2 newsletter-rightCol newsletter-checkboxes">
                           <label for="newsletter-add" class="dac-form-checkbox-button"></label>
                         </div>
                         <div class="dac-media-body">
-                          <label for="newsletter-add" class="dac-form-label dac-form-aside">Add me to the mailing list for the monthly newsletter and occasional emails about development and Google Play opportunities.<span class="dac-form-required">*</span></label>
+                          <label for="newsletter-add" class="dac-form-label dac-form-aside"><span data-t="newsletter.confirmMailingList"></span><span class="dac-form-required">*</span></label>
                         </div>
                       </div>
                     </div>
                           <label for="newsletter-terms" class="dac-form-checkbox-button"></label>
                         </div>
                         <div class="dac-media-body">
-                          <label for="newsletter-terms" class="dac-form-label dac-form-aside">I acknowledge that the information provided in this form will be subject to <a href="https://www.google.com/policies/privacy/">Google's privacy policy</a>.<span class="dac-form-required">*</span></label>
+                          <label for="newsletter-terms" class="dac-form-label dac-form-aside"><span data-t="newsletter.privacyPolicy" data-t-html></span><span class="dac-form-required">*</span></label>
                         </div>
                       </div>
                     </div>
         </section>
         <section class="dac-swap-section dac-right">
           <div class="dac-modal-content">
-            <p class="newsletter-success-message">
-              You have successfully signed up for the latest Android developer news and tips.
-            </p>
+            <p class="newsletter-success-message" data-t="newsletter.successDetails"></p>
           </div>
         </section>
       </div>
     </div>
   </div>
-</div> <!-- end footer -->
+</div>
+<!-- end newsletter modal -->
+
+<!-- start reset language header modal -->
+<div data-modal="langform" class="dac-modal" id="langform">
+  <div class="dac-modal-container">
+    <div class="dac-modal-window">
+      <header class="dac-modal-header">
+        <div class="dac-modal-header-actions">
+          <button class="dac-modal-header-close" data-modal-toggle></button>
+        </div>
+        <section class="dac-swap-section dac-active dac-down">
+          <h2 class="norule dac-modal-header-title"></h2>
+        </section>
+      </header>
+      <section class="dac-swap-section dac-active dac-left">
+          <section class="dac-modal-content">
+            <fieldset class="dac-form-fieldset">
+              <div class="cols">
+                <div class="col-2of2 langform-leftCol">
+                  <p id="resetLangText"></p>
+                  <p id="resetLangCta"></p>
+                </div>
+              </div>
+            </fieldset>
+          </section>
+          <footer class="dac-modal-footer" id="langfooter">
+            <div class="cols">
+              <div class="col-2of5">
+              </div>
+            </div>
+              <button class="button dac-primary dac-modal-action lang yes" data-t="newsletter.resetLangButtonYes" data-modal-toggle></button>
+              <button class="button dac-primary dac-modal-action lang no" data-t="newsletter.resetLangButtonNo" data-modal-toggle></button>
+            </a>
+          </footer>
+        </form>
+      </section>
+    </div>
+  </div>
+</div>
+<!-- end langreset modal -->
index 33682f2..e2f98b2 100644 (file)
@@ -1,26 +1,92 @@
 <head>
 <?cs
   ####### If building devsite, add some meta data needed for when generating the top nav ######### ?>
-<?cs
-  if:devsite ?><?cs
-    if:guide||develop||training||reference||tools||sdk||google||samples
-      ?><meta name="top_category" value="develop" /><?cs
-    elif:google
-      ?><meta name="top_category" value="google" /><?cs
-    elif:reference && !(reference.gms || reference.gcm)
-      ?><meta name="top_category" value="css-fullscreen" /><?cs
-    /if ?>
   <?cs
-  /if
-?><?cs
-  # END if/else devsite ?>
+    if:devsite ?>
+    <meta name="top_category" value="<?cs
+      if:ndk ?>ndk<?cs
+      elif:(google || referensce.gms || reference.gcm) ?>google<?cs
+      elif:(guide||develop||training||reference||tools||sdk||google||samples) ?>develop<?cs
+      elif:(distribute||googleplay||essentials||users||engage||monetize||disttools||stories||analyze) ?>distribute<?cs
+      elif:(design||vision||material||patterns||devices||designdownloads) ?>design<?cs
+      elif:(about||versions||wear||tv||auto) ?>about<?cs
+      else ?>none<?cs
+      /if ?>" />
+    <meta name="subcategory" value="<?cs
+      if:ndk ?><?cs
+        if:guide ?>guide<?cs
+        elif:samples ?>samples<?cs
+        elif:reference ?>reference<?cs
+        elif:downloads ?>downloads<?cs
+        else ?>none<?cs /if ?><?cs
+      else ?><?cs
+        if:(guide||develop||training||reference||tools||sdk||google||samples) ?><?cs
+          if:guide ?>guide<?cs
+          elif:training ?><?cs
+            if:page.trainingcourse ?>trainingcourse<?cs
+            else ?>training<?cs /if ?><?cs
+          elif:reference ?>reference<?cs
+          elif:tools ?>tools<?cs
+          elif:sdk ?>sdk<?cs
+          elif:samples ?>samples<?cs
+          else ?>none<?cs /if ?><?cs
+        elif:(distribute||googleplay||essentials||users||engage||monetize||disttools||stories||analyze) ?><?cs
+          if:googleplay ?>googleplay<?cs
+          elif:essentials ?>essentials<?cs
+          elif:users ?>users<?cs
+          elif:engage ?>engage<?cs
+          elif:monetize ?>monetize<?cs
+          elif:disttools ?>disttools<?cs
+          elif:stories ?>stories<?cs
+          elif:analyze ?>analyze<?cs
+          else ?>none<?cs /if ?><?cs
+        elif:(about||versions||wear||tv||auto) ?><?cs
+          if:versions ?>about<?cs
+          elif:wear ?>wear<?cs
+          elif:tv ?>tv<?cs
+          elif:auto ?>auto<?cs
+          else ?>none<?cs /if ?><?cs
+        elif:design ?><?cs
+          if:vision ?>vision<?cs
+          elif:material ?>material<?cs
+          elif:patterns ?>patterns<?cs
+          elif:devices ?>devices<?cs
+          elif:designdownloads ?>designdownloads<?cs
+          else ?>none<?cs /if ?><?cs
+        elif:training ?><?cs
+          if:page.trainingcourse ?>trainingcourse<?cs
+          else ?>training<?cs /if ?><?cs
+        elif:walkthru ?>walkthru<?cs
+        else ?>none<?cs /if ?><?cs
+      /if ?>" />
+
+    <?cs if:page.tags && page.tags != "" ?>
+      <meta name="keywords" value='<?cs var:page.tags ?>' />
+    <?cs /if ?>
+
+    <?cs if:meta.tags && meta.tags != "" ?>
+      <meta name="meta_tags" value='<?cs var:meta.tags ?>' />
+    <?cs /if ?>
+
+    <?cs if:fullpage ?>
+      <meta name="full_width" value="True" />
+    <?cs /if ?>
+
+    <?cs if:page.landing ?>
+      <meta name="page_type" value="landing" />
+    <?cs /if ?>
+
+    <?cs if:page.article ?>
+      <meta name="page_type" value="article" />
+    <?cs /if ?>
+
+    <?cs /if ?><?cs
+    # END if/else devsite ?>
+<?cs
+  if:!devsite ?>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
 <meta content="IE=edge" http-equiv="X-UA-Compatible">
-<?cs
-  if:page.metaDescription ?>
-<meta name="Description" content="<?cs var:page.metaDescription ?>"><?cs
-  /if ?>
 <link rel="shortcut icon" type="image/x-icon" href="<?cs var:toroot ?>favicon.ico" />
 <link rel="alternate" href="http://developer.android.com/<?cs var:path.canonical ?>" hreflang="en" />
 <link rel="alternate" href="http://developer.android.com/intl/es/<?cs var:path.canonical ?>" hreflang="es" />
 <link rel="alternate" href="http://developer.android.com/intl/vi/<?cs var:path.canonical ?>" hreflang="vi" />
 <link rel="alternate" href="http://developer.android.com/intl/zh-cn/<?cs var:path.canonical ?>" hreflang="zh-cn" />
 <link rel="alternate" href="http://developer.android.com/intl/zh-tw/<?cs var:path.canonical ?>" hreflang="zh-tw" />
+<?cs /if ?><?cs
+# END if/else !devsite ?>
 
 <title><?cs
+if:devsite ?><?cs
+  if:page.title ?><?cs
+    var:page.title ?><?cs
+  else ?>Android Developers<?cs
+  /if ?><?cs
+else ?><?cs
   if:page.title ?><?cs
     var:page.title ?> | <?cs
-  /if ?>Android Developers</title>
-
+  /if ?>Android Developers
+<?cs /if ?><?cs
+# END if/else devsite ?></title>
+<?cs
+  if:page.metaDescription ?>
+<meta name="description" content="<?cs var:page.metaDescription ?>"><?cs
+  /if ?>
+<?cs
+  if:!devsite ?>
 <!-- STYLESHEETS -->
 <link rel="stylesheet"
 href="<?cs
@@ -47,27 +128,16 @@ if:android.whichdoc != 'online' ?>http:<?cs
 if:android.whichdoc != 'online' ?>http:<?cs
 /if ?>//fonts.googleapis.com/css?family=Roboto:light,regular,medium,thin,italic,mediumitalic,bold"
   title="roboto">
-<?cs 
+<?cs
   if:ndk ?><link rel="stylesheet" href="<?cs
   if:android.whichdoc != 'online' ?>http:<?cs
   /if ?>//fonts.googleapis.com/css?family=Roboto+Mono:400,500,700" title="roboto-mono" type="text/css"><?cs
 /if ?>
-<link href="<?cs var:toroot ?>assets/css/default.css?v=17" rel="stylesheet" type="text/css">
-
-<?cs if:reference && !(reference.gms || reference.gcm || preview) ?>
-<!-- FULLSCREEN STYLESHEET -->
-<link href="<?cs var:toroot ?>assets/css/fullscreen.css" rel="stylesheet" class="fullscreen"
-type="text/css">
-<?cs /if ?>
+<link href="<?cs var:toroot ?>assets/css/default.css?v=16" rel="stylesheet" type="text/css">
 
 <!-- JAVASCRIPT -->
 <script src="<?cs if:android.whichdoc != 'online' ?>http:<?cs /if ?>//www.google.com/jsapi" type="text/javascript"></script>
-<?cs
-if:devsite
-  ?><script src="<?cs var:toroot ?>_static/js/android_3p-bundle.js" type="text/javascript"></script><?cs
-else
-  ?><script src="<?cs var:toroot ?>assets/js/android_3p-bundle.js" type="text/javascript"></script><?cs
-/if ?><?cs
+<script src="<?cs var:toroot ?>assets/js/android_3p-bundle.js" type="text/javascript"></script><?cs
   if:page.customHeadTag ?>
 <?cs var:page.customHeadTag ?><?cs
   /if ?>
@@ -75,16 +145,10 @@ else
   var toRoot = "<?cs var:toroot ?>";
   var metaTags = [<?cs var:meta.tags ?>];
   var devsite = <?cs if:devsite ?>true<?cs else ?>false<?cs /if ?>;
+  var useUpdatedTemplates = <?cs if:useUpdatedTemplates ?>true<?cs else ?>false<?cs /if ?>;
 </script>
 <script src="<?cs var:toroot ?>assets/js/docs.js?v=17" type="text/javascript"></script>
 
-<?cs if:helpoutsWidget ?>
-<script type="text/javascript" src="https://helpouts.google.com/ps/res/embed.js" defer async
-    data-helpouts-embed data-helpouts-vertical="programming"
-    data-helpouts-tags="<?cs var:page.tags ?>" data-helpouts-prefix="android"
-    data-helpouts-standalone="true"></script>
-<?cs /if ?>
-
 <script>
   (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
   (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
@@ -96,5 +160,6 @@ else
   ga('send', 'pageview');
   ga('universal.send', 'pageview'); // Send page view for new tracker.
 </script>
-
+<?cs /if ?><?cs
+# END if/else !devsite ?>
 </head>
index e8301be..8c67138 100644 (file)
@@ -1,3 +1,11 @@
-<?cs call:custom_masthead() ?>
-<?cs call:custom_left_nav() ?>
+<?cs if:!devsite ?><?cs # leave out the global header for devsite; it is in devsite template ?>
+  <?cs call:custom_masthead() ?>
 
+  <?cs if:(fullpage) ?>
+    <?cs call:fullpage() ?>
+  <?cs else ?>
+    <?cs call:body_content_wrap_start() ?>
+  <?cs /if ?>
+
+  <?cs call:search_results() ?>
+<?cs /if ?><?cs # end if/else !devsite ?>
index 417a5c1..4a6f4f7 100644 (file)
@@ -1 +1,10 @@
+window.METADATA = window.METADATA || {};
+METADATA['<?cs var:metadata.lang ?>'] = {};
+
+METADATA['<?cs var:metadata.lang ?>'].about = [];
+METADATA['<?cs var:metadata.lang ?>'].design = [];
+METADATA['<?cs var:metadata.lang ?>'].develop = [];
+METADATA['<?cs var:metadata.lang ?>'].distribute = [];
+METADATA['<?cs var:metadata.lang ?>'].extras = [];
+
 <?cs var:reference_tree ?>
index 72d5538..7a834d8 100644 (file)
@@ -15,8 +15,6 @@
   <a name="top"></a>
 <?cs include:"header.cs" ?>
 
-<div class="col-12" id="doc-col">
-
 <div id="api-info-block">
 <div class="api-level">
   <?cs call:since_tags(package) ?>
@@ -58,7 +56,6 @@
 </div><!-- end jd-content -->
 
 <?cs include:"footer.cs" ?>
-</div><!-- doc-content -->
 
 <?cs include:"trailer.cs" ?>
 
index fe6a5aa..af565dc 100644 (file)
@@ -12,8 +12,6 @@
   <a name="top"></a>
 <?cs include:"header.cs" ?>
 
-<div class="col-12" id="doc-col">
-
 <div id="jd-header">
 <h1><?cs var:page.title ?></h1>
 </div>
@@ -38,7 +36,6 @@
 </div><!-- end jd-content -->
 
 <?cs include:"footer.cs" ?>
-</div> <!-- end doc-content -->
 
 <?cs include:"trailer.cs" ?>
 
index 7b4bf0f..3c713b6 100644 (file)
@@ -5,11 +5,6 @@
 <body class="gc-documentation develop samples" itemscope itemtype="http://schema.org/Article">
 <?cs include:"header.cs" ?>
 
-<div <?cs if:fullpage
-?>class="fullpage"<?cs elif:design||tools||about||sdk||distribute
-?>class="col-13" id="doc-col"<?cs else
-?>class="col-12" id="doc-col"<?cs /if ?> >
-
 <!-- start breadcrumb block -->
 <div id="api-info-block">
   <div class="sum-details-links">
   </div> <!-- end jd-content -->
 
 <?cs include:"footer.cs" ?>
-</div><!-- end doc-content -->
 
 <?cs include:"trailer.cs" ?>
 
index e62d3fe..db648ff 100644 (file)
@@ -5,11 +5,6 @@
 <body class="gc-documentation develop samples" itemscope itemtype="http://schema.org/Article">
 <?cs include:"header.cs" ?>
 
-<div <?cs if:fullpage
-?>class="fullpage"<?cs elif:design||tools||about||sdk||distribute
-?>class="col-13" id="doc-col"<?cs else 
-?>class="col-12" id="doc-col"<?cs /if ?> >
-
 <!-- start breadcrumb block -->
 <div id="api-info-block">
 <div class="sum-details-links">
   </div> <!-- end jd-content -->
 
 <?cs include:"footer.cs" ?>
-</div><!-- end doc-content -->
 
 <?cs include:"trailer.cs" ?>
 
index 47c2992..a336521 100644 (file)
 <?cs else ?>
   <?cs include:"head_tag.cs" ?>
 <?cs /if ?>
-<body class="gc-documentation
-  <?cs if:(guide||develop||training||reference||tools||sdk) ?>develop<?cs
-  elif:design ?>design<?cs
-  elif:distribute ?>distribute<?cs
+<body class="gc-documentation <?cs
+  if:(guide||develop||training||reference||tools||sdk) ?> develop<?cs
+  elif:design ?> design<?cs
+  elif:distribute ?> distribute<?cs
+  elif:ndk ?> ndk<?cs
+    if:downloads ?> downloads<?cs /if ?><?cs
   /if ?>" itemscope itemtype="http://schema.org/CreativeWork">
   <a name="top"></a>
 <?cs include:"header.cs" ?>
 
-
-<div <?cs if:fullpage
-?><?cs else
-?>class="col-13" id="doc-col"<?cs /if ?> >
-
 <?cs if:sdk.redirect ?>
 
 <div class="g-unit">
 # The following is for SDK/NDK pages
 #
 #
-?>
+?><?cs
+if:ndk ?>
+  <ul class="dac-header-crumbs">
+    <?cs # More <li> elements added here with javascript ?>
+  </ul>
+
+  <!-- Breadcrumb Setup -->
+  <p><script>$('.dac-nav-list').dacCurrentPage().dacCrumbs();</script></p><?cs
+/if ?>
 
 <?cs if:header.hide ?><?cs else ?>
 <h1 itemprop="name"><?cs var:page.title ?></h1>
@@ -567,9 +572,9 @@ var:sdk.linux_download
 <?cs /if ?>
 
 </div><!-- end g-unit -->
-
+<?cs if:!devsite ?>
 <?cs include:"trailer.cs" ?>
-
+<?cs /if ?>
 <!-- Start of Tag -->
 <script type="text/javascript">
 var axel = Math.random() + "";
index 225b2c1..d66ff4b 100644 (file)
@@ -1,4 +1,3 @@
-</div> <!-- end .cols --> <?cs # normally opened by header.cs ?>
 </div> <!-- end body-content --> <?cs # normally opened by header.cs ?>
 
 <?cs if:carousel ?>
@@ -19,3 +18,17 @@ $(".feed").dacTabbedList({
 </script>
 <?cs /if ?>
 
+<script src="https://developer.android.com/ytblogger_lists_unified.js" defer></script>
+<script src="/jd_lists_unified_en.js?v=17" defer></script>
+<script src="/reference/lists.js?v=17" defer></script>
+<script src="/reference/gcm_lists.js?v=17" defer></script>
+<script src="/reference/gms_lists.js?v=17" defer></script>
+<script>
+  // Load localized metadata.
+  (function(lang) {
+    if (lang === 'en') { return; }
+
+    // Write it to the document so it gets evaluated before DOMContentReady.
+    document.write('<script src="/jd_lists_unified_' + lang + '.js?v=14" defer></' + 'script>');
+  })(getLangPref())
+</script>
index 9219917..f53845a 100644 (file)
@@ -6362,9 +6362,13 @@ div.jd-descr > .resource-widget[data-section=distribute\/tools] .section-card-me
 .dac-button.dac-raised.dac-primary, .landing-secondary, .button {
   background-color: #039bef; }
   .dac-button.dac-raised.dac-primary:hover, .landing-secondary:hover, .button:hover {
-    background-color: #0288d1; color:#fff; }
+    background-color: #0288d1; 
+    color:#fff; }
   .dac-button.dac-raised.dac-primary:active, .landing-secondary:active, .button:active {
-    background-color: #0277bd; }
+    background-color: #0277bd;
+    color:#fff; }
+  .dac-button.dac-raised.dac-primary.disabled, .button.disabled {
+    background-color: #bbb; }
 
 .dac-button.dac-raised.dac-red, .landing-primary {
   background-color: #bf3722; }
@@ -8801,11 +8805,6 @@ $spritesheet: width height image $spritesheet-sprites;
   min-height: 550px;
   padding-top: 88px;
 }
-
-.dac-hero.summit {
-  background-image: url(../../images/ads_hero_17@2x.jpg);
-}
-
 .dac-hero.dac-darken.mprev::before {
   background: rgba(0, 0, 0, 0.3);
   bottom: 0;
index c30284b..7a4f715 100644 (file)
@@ -983,7 +983,7 @@ function scrollIntoView(nav) {
     }
     // get the selected item's offset from its container nav by measuring the item's offset
     // relative to the document then subtract the container nav's offset relative to the document
-    var selectedOffset = $selected.offset().top - $nav.offset().top;
+    var selectedOffset = $selected.offset().top - $nav.offset().top + 60;
     if (selectedOffset > $nav.height() * .8) { // multiply nav height by .8 so we move up the item
                                                // if it's more than 80% down the nav
       // scroll the item up by an amount equal to 80% the container nav's height
index 33682f2..100b0bc 100644 (file)
@@ -75,6 +75,7 @@ else
   var toRoot = "<?cs var:toroot ?>";
   var metaTags = [<?cs var:meta.tags ?>];
   var devsite = <?cs if:devsite ?>true<?cs else ?>false<?cs /if ?>;
+  var useUpdatedTemplates = <?cs if:useUpdatedTemplates ?>true<?cs else ?>false<?cs /if ?>;
 </script>
 <script src="<?cs var:toroot ?>assets/js/docs.js?v=17" type="text/javascript"></script>