<?php 

// Analytics Footer

if($analytics != 'off') {

	if(isset($analyticsid)) {

		// Google Mobile Analytics
		
		function googleAnalyticsGetImageUrl() {
			global $GA_ACCOUNT, $GA_PIXEL;
			$url = "";
			$url .= $GA_PIXEL . "?";
			$url .= "utmac=" . $GA_ACCOUNT;
			$url .= "&utmn=" . rand(0, 0x7fffffff);
			$referer = $_SERVER["HTTP_REFERER"];
			$query = $_SERVER["QUERY_STRING"];
			$path = $_SERVER["REQUEST_URI"];
			if (empty($referer)) {
				$referer = "-";
			}
			$url .= "&utmr=" . urlencode($referer);
			if (!empty($path)) {
				$url .= "&utmp=" . urlencode($path);
			}
			$url .= "&guid=ON";
			return str_replace("&", "&amp;", $url);
		}

		// Convert UA- (UrchinAnalytics) to MO- (Mobile)
		$analyticsid = str_replace("UA-","MO-",$analyticsid);

		$GA_PIXEL = "ga.php";
		$GA_ACCOUNT = $analyticsid;

		$googleAnalyticsImageUrl = googleAnalyticsGetImageUrl();
		echo '<img src="' . $googleAnalyticsImageUrl . '" style="border:none;margin:0px;" />';


	} elseif($analyticstype==1) {

		// Custom Footer Analytics Code
		// Add your custom footer code below
?>
<!-- Custom Footer Code Below This Line -->



<!-- Custom Footer Code Above This Line -->
<?php

	}

}

?>