<!DOCTYPE html>
<html id="ng-app" lang="en" ng-controller="ApplicationCtrl">
  <head>
    <meta http-equiv="x-ua-compatible" content="IE=edge" />

    <script>
      // Browser handling
      (function setBrowserGlobals() {
        var ua = window.navigator.userAgent,
            msie = ua.indexOf("MSIE "),
            version, ieVersion;

        if (msie > -1 || !!(version = ua.match(/Trident.*rv\:(\d+)\./))) {
          ieVersion = msie > -1 ? ua.substring(msie + 5, ua.indexOf(".", msie)) : version[1];
          window['isIE' + ieVersion] = window.isIE = true;
          document.documentElement.className = 'isIE ie' + ieVersion;
        } else
          window.notIE = true;
      })();

      if(window['isIE'] && location.href.indexOf('%27')>-1)
        location.href = location.href.replace(/%27/g,"'");
    </script>

    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, width=device-width">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-touch-fullscreen" content="yes">

    <title ng-bind="windowTitle">Summon 2.0</title>

    <!-- Standard favicon -->
    <link rel="shortcut icon" type="image/icon" href="//assets-cdn.summon.serialssolutions.com/4dde8da9a61f861e1100005b">
    <!-- Apple device icons -->
    <link rel="apple-touch-icon" sizes="32x32" href="/favicon-32x32.png">
    <link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png">
    <link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon-76x76.png">
    <link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-120x120.png">
    <link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144x144.png">
    <link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152.png">
    <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-180x180.png">
    <!-- Chrome for Android icon -->
    <link rel="icon" type="image/png" href="/android-chrome-196x196.png" sizes="196x196">
    <!-- IE 10 Metro tile icon -->
    <meta name="msapplication-TileImage" content="/apple-touch-icon-144x144.png">
    <!-- For Android home screens -->
    <link rel="manifest" href="/manifest.json">

    <link ng-href="{{rssLink()}}" ng-if="view == 'search' && enableRssLink() && viewState.currentView != 'detailsPage'" rel="alternate" type="application/rss+xml" title="RSS" />

    <link rel="stylesheet" href="//static-cdn.summon.serialssolutions.com/assets/application-6347ab7d3663cae9cce48848ad0fc54a.css">
    <style type="text/css">
      .browzine a{color: #2859ab !important}
    </style>

    <script src="//static-cdn.summon.serialssolutions.com/assets/labjs/2.0.3/LAB-1cb261e34f04623f5e9906a1485130e0.js"></script>
    <script>
      var __refererURL = "";

      (function runLoader(self){
        var
          labJS = '//static-cdn.summon.serialssolutions.com/assets/labjs/2.0.3/LAB-1cb261e34f04623f5e9906a1485130e0.js',
          angularPlugins = '//static-cdn.summon.serialssolutions.com/assets/angularPlugins-d01476cbc8d3013aa0f8055d195dbe46.js',
          plugins = '//static-cdn.summon.serialssolutions.com/assets/plugins-da57e6d722efaa5fe1b2e90368735b8a.js',
          auth = '//static-cdn.summon.serialssolutions.com/assets/auth-8e94cb649ca77630e18a80af017e215b.js',
          postLoadPlugins = '//static-cdn.summon.serialssolutions.com/assets/postLoadPlugins-939b4c53931ff8b997a30282b0a0a3a3.js',
          templates = '//static-cdn.summon.serialssolutions.com/assets/templates-7561319547bb2159313fd823ea98691d.js',
          applicationJS = '//static-cdn.summon.serialssolutions.com/assets/application-093f203e77c5b16366a0ba83e7fe6a9a.js',
          widgetBoxJS = '//static-cdn.summon.serialssolutions.com/assets/widgets/box-68deeb35224349f32c38613f5c328f49.js',
          widgetSearchJS = '//static-cdn.summon.serialssolutions.com/assets/widgets/search-1dc0e754a27d4272e41ecac05d47a326.js',
          regex = /.*(?=\/assets\/.*)/,
          appBooted = false
        ;

        function appBootstrap(){
          // Angular could be not arrived when bootstrapping it. So followed conditional waits until it exists in the window scope.
          if(window.isIE && !('angular' in window)){
            setTimeout(appBootstrap, 34);
            return;
          }
          var head = angular.element('head');
          if(!appBooted){
            angular.bootstrap(document, ['summonApp']);
            FastClick.attach(document.body);
            appBooted = true;

            // retrieve non-critical css
            head.append('<link rel="stylesheet" href="//static-cdn.summon.serialssolutions.com/assets/uxf-icons-16f99c5493f80bd66a9149a38f0f98c5.css">');
            head.append('<link rel="stylesheet" href="//static-cdn.summon.serialssolutions.com/assets/postload-styles-6dea9ba01fe50c24cd72776bd56e9c24.css">');

            // retrieve non-critical 3rd-party js
            $LAB
              .script(postLoadPlugins)
              // Altmetrics script
          }
        }

        function loadScripts(){
          var initialScripts = $LAB.script(angularPlugins);
          if (window.isIE){
            initialScripts = initialScripts.wait();
          }
          initialScripts
            .script([plugins, auth, "/config", {src: '/localization/en-AU', charset: 'UTF-8'}, templates, applicationJS])
            .wait(function() {
              angular.element(document).ready(appBootstrap);
            })
        }

        function loadCss() {
          var
            applicationCss = ['//static-cdn.summon.serialssolutions.com/assets/application-6347ab7d3663cae9cce48848ad0fc54a.css', '//static-cdn.summon.serialssolutions.com/assets/uxf-icons-16f99c5493f80bd66a9149a38f0f98c5.css', '//static-cdn.summon.serialssolutions.com/assets/postload-styles-6dea9ba01fe50c24cd72776bd56e9c24.css']
          ;

          // adds tags for all dependent css files
          applicationCss.forEach(function(cssPath) {
            var stylesheetTag = document.createElement('link');

            stylesheetTag.setAttribute('rel', 'stylesheet');
            stylesheetTag.setAttribute('href', cssPath.replace(regex, ''));
            document.getElementsByTagName('head')[0].appendChild(stylesheetTag);
          });
        }

        self.loadWidgetScripts = function(){
          $LAB.script([widgetBoxJS, widgetSearchJS])
        };

        // fall back to Summon servers on CDN failure
        if (!window.$LAB) {
          console.error("The following javascript dependency failed to load: " + labJS);
          loadCss();
          labJS = labJS.replace(regex, "");
          angularPlugins = angularPlugins.replace(regex, "");
          plugins = plugins.replace(regex, "");
          auth = auth.replace(regex, "");
          templates = templates.replace(regex, "");
          applicationJS = applicationJS.replace(regex, "");
          postLoadPlugins = postLoadPlugins.replace(regex, "");
          document.write(unescape('%3Cscript src="' + labJS + '"%3E%3C/script%3E'));
          setTimeout(loadScripts, 3000); // wait 3 seconds
        }
        else {
          loadScripts();
        }
      })(this);
    </script>
  </head>
  <body
    dir="{{ ::textDirection }}"
    when-scrolled
    idle-timer
    layout
    key-events
    class="vpnBannerAdjust">
      <div ng-cloak class="splash">
        <img src="/images/spinner.gif" alt="{{ ::i18n.translations.APP_IS_LOADING }}" />
      </div>
      <div ng-cloak role="alert" aria-live="assertive" class="offscreen">
        <span
          ng-if="loadingNewSearchIndicator || loadingSearchIndicator || feed.loading"
          ng-bind="::i18n.translations.LOADING_RESULTS">
        </span>
        <span
          ng-if="!loadingNewSearchIndicator && !loadingSearchIndicator && !feed.loading"
          ng-bind="::i18n.translations.DONE_LOADING_RESULTS">
        </span>

        <span ng-if="loadingFacetIndicator" ng-bind="::i18n.translations.LOADING_MORE_FACETS"></span>
        <span ng-if="!loadingFacetIndicator" ng-bind="::i18n.translations.DONE_LOADING_MORE_FACETS"></span>
      </div>

      <div
        id="skipnav"
        class="skipnav offscreen"
        ng-cloak
        tabindex="-1"
        focus-me="!layout.virgin">
          <ul class="list-unstyled" aria-label="{{ ::i18n.translations.ACCESSIBLE_MENU }}">
            <li class="offscreen" ng-if="view =='search'">
              <a
                role="button"
                go-to="#results"
                tabindex="0"
                ng-bind="::i18n.translations.SKIP_TO_CONTENT">
              </a>
            </li>
          </ul>
      </div>

      <h1 class="offscreen" ng-bind="windowTitle">Summon 2.0</h1>

      <div
        ng-cloak
        id="content"
        class="screen-media-wrapper">
          <div home-view ng-show="view == 'home'"></div>
          <div search-view ng-show="view == 'search'"></div>
          <div embedded-widgets-view ng-if="view == 'widgets'"></div>
          <div course-reserves ng-if="view == 'course_reserves'"></div>
          <div library-card ng-if="libraryCardHasRendered" ng-show="view == 'library_card'"></div>
          <div class="footer">
            <div chat-widget ng-if="chat.enabled"></div>
          </div>
          <div back-to-top ng-show="view == 'search'"></div>
      </div>

      <div class="print-media-wrapper" style="display:none"></div>
      <toast></toast>

      <div ng-view></div>

      <div click-track-link-form></div>

      <div ng-if="isPreview && showPreviewBanner" class="preview-env"></div>

        <script>var _gaq=[['_setAccount','UA-29599199-1'],['_trackPageview']];(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.src='//www.google-analytics.com/ga.js';s.parentNode.insertBefore(g,s)}(document,'script'))</script>
  </body>
</html>
