<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>iic.js</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -14,7 +14,7 @@ function isItChristmas($time = null) {
   $ip = getIp(); 
   
   // debug: 
-  // $ip = &quot;193.51.208.14&quot;; // French IP (should say &quot;OUI&quot;)
+  // $ip = &quot;193.51.208.14&quot;; // French IP
   // $christmas = &quot;12/24&quot;;
   
   $location = null;
@@ -41,6 +41,29 @@ function isItChristmas($time = null) {
   return $isit ? yes($location) : &quot;NO&quot;;
 }
 
+// used to produce a country code for the JS to work with
+function getCountryCode() {
+  
+  $ip = getIp(); 
+  // debug: 
+  // $ip = &quot;193.51.208.14&quot;; // French IP
+  // $ip = &quot;71.164.115.181&quot;; // US IP
+  
+  $location = null;
+  if ($ip) {
+    // db credentials, see db.php.example
+    require 'db.php';
+    DBconnect($server, $username, $password, $database);
+    
+    $location = ipRoughLocate($ip);
+  }
+  
+  if (!$location || !$location[&quot;countryCode&quot;] || $location[&quot;countryName&quot;] == &quot;(Unknown Country?)&quot;)
+    return &quot;US&quot;;
+  else
+    return $location[&quot;countryCode&quot;];
+}
+
 
 // Helper functions
 </diff>
      <filename>iic.php</filename>
    </modified>
    <modified>
      <diff>@@ -1,32 +1,37 @@
 &lt;?php header('Content-Type: text/html'); ?&gt;
 
 &lt;?php 
-// switch the commenting here for performance from 12/27 - 12/23
 require 'iic.php';
 $answer = isItChristmas();
-// $answer = &quot;NO&quot;;
-
+$countryCode = getCountryCode();
 ?&gt;
 
 &lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
 &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
 &lt;head&gt;
   &lt;title&gt;Is it Christmas?&lt;/title&gt;
-  &lt;link rel=&quot;alternate&quot; title=&quot;Is It Christmas?&quot; href=&quot;/rss.xml&quot; type=&quot;application/rss+xml&quot; /&gt;
+  &lt;link rel=&quot;alternate&quot; title=&quot;Is It Christmas?&quot; href=&quot;rss.xml&quot; type=&quot;application/rss+xml&quot; /&gt;
   &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
+  &lt;script type=&quot;text/javascript&quot; src=&quot;iic.js&quot;&gt;&lt;/script&gt;
 &lt;/head&gt;
 
 &lt;body style=&quot;text-align: center; padding-top: 200px;&quot;&gt;
 
   &lt;a href=&quot;http://github.com/isit/christmas&quot; 
-     style=&quot;font-weight: bold; 
-            font-size: 120pt; 
-            font-family: Arial, sans-serif; 
-            text-decoration: none; 
-            color: black;&quot; 
-     title=&quot;CODE&quot;&gt;
-    &lt;?= $answer ?&gt;
+    style=&quot;font-weight: bold; 
+          font-size: 120pt; 
+          font-family: Arial, sans-serif; 
+          text-decoration: none; 
+          color: black;&quot; 
+    title=&quot;CODE&quot;
+    id=&quot;answer&quot;&gt;
+    &lt;noscript&gt;&lt;?= $answer ?&gt;&lt;/noscript&gt;
   &lt;/a&gt;
+  
+  &lt;script type=&quot;text/javascript&quot;&gt;
+    document.getElementById('answer').innerHTML = isItChristmas(&quot;&lt;?= $countryCode ?&gt;&quot;);
+  &lt;/script&gt;
+  
 
   &lt;script type=&quot;text/javascript&quot;&gt;
 var gaJsHost = ((&quot;https:&quot; == document.location.protocol) ? &quot;https://ssl.&quot; : &quot;http://www.&quot;);</diff>
      <filename>index.php</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>d0a77bd5680803dc6760d266bb592788187076e1</id>
    </parent>
  </parents>
  <author>
    <name>Eric Mill</name>
    <email>webmaster@isitchristmas.com</email>
  </author>
  <url>http://github.com/isit/christmas/commit/0bc7ae86e8b5087191e29d19f9711312ea51ed38</url>
  <id>0bc7ae86e8b5087191e29d19f9711312ea51ed38</id>
  <committed-date>2008-12-24T01:55:38-08:00</committed-date>
  <authored-date>2008-12-24T01:55:38-08:00</authored-date>
  <message>Added client-side Christmas detection.</message>
  <tree>b389cce53f70160e3fe2dd72fb9049ce63859883</tree>
  <committer>
    <name>Eric Mill</name>
    <email>webmaster@isitchristmas.com</email>
  </committer>
</commit>
