+<? if ( !preg_match("/mobile/i", $_SERVER['HTTP_USER_AGENT']) ) { ?>
+ <script type="text/javascript" src="/bookreader/soundmanager/soundmanager2-ia.js?v=<? echo($version); ?>"></script>
+ <script>
+ soundManager.debugMode = false;
+ soundManager.url = '/bookreader/soundmanager/swf/';
+ soundManager.useHTML5Audio = true;
+ soundManager.flashVersion = 9; //flash 8 version of swf is buggy when calling play() on a sound that is still loading
+ </script>
+<? } /* mobile user agent */ ?>
+</head>
+<body style="background-color: ##939598;">
+
+<div id="BookReader">
+ Internet Archive BookReader - <? echo $title; ?>
+ <br/>
+
+ <noscript>
+ <p>
+ The BookReader requires JavaScript to be enabled. Please check that your browser supports JavaScript and that it is enabled in the browser settings. You can also try one of the <a href="http://www.archive.org/details/<? echo $identifier; ?>"> other formats of the book</a>.
+ </p>
+ </noscript>
+</div>
+
+<script type="text/javascript">
+ // Set some config variables -- $$$ NB: Config object format has not been finalized
+ var brConfig = {};
+<? if ($uiMode == 'embed') { ?>
+ brConfig["mode"] = 1;
+ brConfig["ui"] = "embed";
+<? } else { ?>
+ brConfig["mode"] = 2;
+<? } ?>
+<? if ($isAdmin == true) {
+ echo ' brConfig["isAdmin"] = true;';
+ } ?>
+</script>
+<script type="text/javascript">
+// The URL in the script tag below is dynamically generated JavaScript that includes the book metadata and page image access functions.
+// The ia{number}.us.archive.org server for the book can and does change, so this URL should NOT be used for permanent access.
+// Use the JSLocate URL below instead for stable access - it will find the item and redirect to the correct server
+// <? echo($locateURL); ?>
+
+</script>
+<script type="text/javascript" src="<? echo($metaURL); ?>"></script>
+
+<script type="text/javascript">
+ // Usage stats
+ if(window.archive_analytics) { window.archive_analytics.values['bookreader'] = 'open'};
+</script>
+<!--<![endif]-->
+
+<!--[if IE 7]>
+<? BookReader::emitForIE7($server, $mainDir, $identifier, $subPrefix, $title, $coverLeaf, $titleStart, $uiMode); ?>
+<![endif]-->
+
+
+</body>
+</html>
+ <?
+ exit;
+ }
+
+
+
+
+ // Emit the HTML for the version of the BookReader for IE7
+ public static function emitForIE7($server, $mainDir, $identifier, $subPrefix, $title,
+ $coverLeaf=null, $titleStart='Internet Archive', $uiMode='full')
+ {
+ // Set title to default if not set
+ if (!$title) {
+ $title = 'BookReader';
+ }
+
+ $id = $identifier;
+
+ // manually update with Launchpad version number at each checkin so that browsers
+ // do not use old cached version
+ // see https://bugs.launchpad.net/gnubook/+bug/330748
+ $version = "ie7";
+
+ if (BookReader::getDevHost($server)) {
+ // on dev host - add time to force reload
+ $version .= '_' . time();
+ }
+
+ if ("" == $id) {
+ echo "No identifier specified!";
+ die(-1);
+ }
+
+ $metaURL = BookReader::jsMetadataURLForIE7($server, $identifier, $mainDir, $subPrefix);
+
+
+?>
+ <link rel="stylesheet" type="text/css" href="/bookreader/ie7/BookReader.css?v=<? echo($version); ?>">
+<? if ($uiMode == "embed") { ?>
+ <link rel="stylesheet" type="text/css" href="/bookreader/ie7/BookReaderEmbed.css?v=<? echo($version); ?>">
+<? } elseif ($uiMode == "touch") { ?>
+ <link rel="stylesheet" type="text/css" href="/bookreader/ie7/touch/BookReaderTouch.css?v=<? echo($version); ?>">
+<? } /* uiMode */ ?>
+ <script src="/includes/jquery-1.4.2.min.js" type="text/javascript"></script>
+ <script type="text/javascript" src="http://www.archive.org/includes/analytics.js?v=2"></script>
+ <script type="text/javascript" src="/bookreader/ie7/jquery-ui-1.8.1.custom.min.js?v=<? echo($version); ?>"></script>
+ <script type="text/javascript" src="/bookreader/ie7/dragscrollable.js?v=<? echo($version); ?>"></script>
+ <script type="text/javascript" src="/bookreader/ie7/BookReader.js?v=<? echo($version); ?>"></script>