// Copyright 2014 Google Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

var startup = function() {
  console.log("Startup.");
  __axiomRequire__('shell/launch');
}

if (document.readyState === 'complete') {
  startup();
} else {
  var onReadyStateChange = function() {
    if (document.readyState === 'complete') {
      document.removeEventListener('readystatechange', onReadyStateChange);
      startup();
    }
  };
  document.addEventListener('readystatechange', onReadyStateChange);
}

@@ -603,16 +603,32 @@
 cense.%0A%0A
+(function() %7B%0A  
 var star
@@ -646,16 +646,18 @@
 ion() %7B%0A
+  
   consol
@@ -677,16 +677,18 @@
 p.%22);%0A  
+ 
+ 
 __axiomR
@@ -717,11 +717,15 @@
 ');%0A
+  
 %7D%0A%0A
+  
 if (
@@ -764,16 +764,18 @@
 e') %7B%0A  
+ 
+ 
 startup(
@@ -777,16 +777,18 @@
 rtup();%0A
+  
 %7D else %7B
@@ -788,16 +788,18 @@
  else %7B%0A
+  
   var on
@@ -826,24 +826,26 @@
 unction() %7B%0A
+  
     if (docu
@@ -884,16 +884,18 @@
 %7B%0A      
+  
 document
@@ -958,24 +958,26 @@
 nge);%0A      
+  
 startup();%0A 
@@ -979,19 +979,25 @@
 ();%0A
+  
     %7D%0A
+  
   %7D;%0A
+  
   do
@@ -1061,10 +1061,18 @@
 hange);%0A
-%7D
+  %7D%0A%7D)();
 %0A

Address code review feedback.