<?php

	/* ---- Necessary Files ---- */
	$core = array("jquery.js", "modernizr.js", "hoverIntent.js", "superfish.js", "supersubs.js", "jquery.simplemodal.js");
	$tmpl = array("2.global.all.tmpl");

	/* ---- Add Via readfile() ---- */
	foreach($core as $filename) {
		readfile( SA_DIR_COREPATH . "/js/$filename" );
		print "\n\n";
	}

	/* ---- Add Via include() ---- */
	foreach($tmpl as $filename) {
		include $filename;
		print "\n\n";
	}

	/* ---- Add Custom JS ---- */
	$custom_js = $this->getTypedValue("design", "developer", "custom_js");
	print $custom_js["value"];
	print "\n\n";

?>

$(document).ready(function() {
	
	if (typeof fbq == 'function') { 
		fbq('track', 'PageView');
	}
	if (typeof ga == 'function') { 
		ga('set', 'page', document.location);
		ga('send', 'pageview');
	}
	
});