Merge branch 'master' of https://github.com/maxious/ACTBus-ui
Merge branch 'master' of https://github.com/maxious/ACTBus-ui

Conflicts:
include/common.inc.php

--- a/include/common-template.inc.php
+++ b/include/common-template.inc.php
@@ -32,7 +32,7 @@
 	<head>
         <meta charset="UTF-8">
 <meta name="viewport" content="width=device-width, initial-scale=1"> 	
-<title>' . $pageTitle . '</title>
+<title>' . $pageTitle . ' - Canberra Bus Timetable</title>
         <meta name="google-site-verification" content="-53T5Qn4TB_de1NyfR_ZZkEVdUNcNFSaYKSFkWKx-sY" />
 <link rel="dns-prefetch" href="//code.jquery.com">
 <link rel="dns-prefetch" href="//ajax.googleapis.com">
@@ -98,8 +98,11 @@
 function success(position) {
 $('#error').val('Location now detected. Please wait for data to load.');
 $('#geolocate').val(position.coords.latitude+','+position.coords.longitude);
-$.ajax({ url: \"include/common.inc.php?geolocate=yes&lat=\"+position.coords.latitude+\"&lon=\"+position.coords.longitude });
-location.reload(true);
+$.ajax({ async: false, 
+success: function(){
+	location.reload(true);
+  },
+url: \"include/common.inc.php?geolocate=yes&lat=\"+position.coords.latitude+\"&lon=\"+position.coords.longitude });
 }
 function error(msg) {
 $('#error').val('Error: '+msg);

--- a/include/common.inc.php
+++ b/include/common.inc.php
@@ -32,8 +32,8 @@
 
 function isDebugServer()
 {
-	return php_sapi_name() == "cli" || isset($_SERVER['SERVER_NAME']) && ( $_SERVER['SERVER_NAME'] == "azusa" || $_SERVER['SERVER_NAME'] == "vanille" || $_SERVER['SERVER_NAME'] == 
-"localhost" || $_SERVER['SERVER_NAME'] == "127.0.0.1") ;
+	return php_sapi_name() == "cli" || isset($_SERVER['SERVER_NAME']) && ( $_SERVER['SERVER_NAME'] == "azusa" || $_SERVER['SERVER_NAME'] == "vanille" 
+|| $_SERVER['SERVER_NAME'] == "localhost" || $_SERVER['SERVER_NAME'] == "127.0.0.1") ;
 }
 
 include_once ("common-geo.inc.php");
@@ -49,7 +49,9 @@
 
 function isAnalyticsOn()
 {
-	return !isDebugServer();
+ $user_agent = $_SERVER['HTTP_USER_AGENT'];
+	return !isDebugServer() && !preg_match('/cloudkick/i', $user_agent) && !preg_match('/googlebot/i', $user_agent) && 
+!preg_match('/baidu/i', $user_agent);
 }
 function isDebug($debugReason = "other")
 {