+<html>\r
+<head>\r
+ <title>The source code</title>\r
+ <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />\r
+ <script type="text/javascript" src="../resources/prettify/prettify.js"></script>\r
+</head>\r
+<body onload="prettyPrint();">\r
+ <pre class="prettyprint lang-js">// Copyright 2007 Google Inc. All Rights Reserved.\r
+//\r
+// Sets up google.gears.*, which is *the only* supported way to access Gears.\r
+//\r
+// Circumvent this file at your own risk!\r
+//\r
+// In the future, Gears may automatically define google.gears.* without this\r
+// file. Gears may use these objects to transparently fix bugs and compatibility\r
+// issues. Applications that use the code below will continue to work seamlessly\r
+// when that happens.\r
+\r
+(function() {\r
+ // We are already defined. Hooray!\r
+ if (window.google && google.gears) {\r
+ return;\r
+ }\r
+\r
+ var factory = null;\r
+\r
+ // Firefox\r
+ if (typeof GearsFactory != 'undefined') {\r
+ factory = new GearsFactory();\r
+ } else {\r
+ // IE\r
+ try {\r
+ factory = new ActiveXObject('Gears.Factory');\r
+ } catch (e) {\r
+ // Safari\r
+ if (navigator.mimeTypes["application/x-googlegears"]) {\r
+ factory = document.createElement("object");\r
+ factory.style.display = "none";\r
+ factory.width = 0;\r
+ factory.height = 0;\r
+ factory.type = "application/x-googlegears";\r
+ document.documentElement.appendChild(factory);\r
+ }\r
+ }\r
+ }\r
+\r
+ // *Do not* define any objects if Gears is not installed. This mimics the\r
+ // behavior of Gears defining the objects in the future.\r
+ if (!factory) {\r
+ return;\r
+ }\r
+\r
+ // Now set up the objects, being careful not to overwrite anything.\r
+ if (!window.google) {\r
+ window.google = {};\r
+ }\r
+\r
+ if (!google.gears) {\r
+ google.gears = {factory: factory};\r
+ }\r
+})();\r
+\r
+if (!window.google || !google.gears) {\r
+ location.href = "http://gears.google.com/?action=install&message=Google%20Gears%20is%20required%20for%20this%20application" +\r
+ "&return="+window.location.href;\r
+}</pre> \r
+</body>\r
+</html>
\ No newline at end of file