function importJS(jsFile)
{
  var scriptElt = document.createElement('script');
  scriptElt.type = 'text/javascript';
  scriptElt.src = jsFile;
  document.getElementsByTagName('head')[0].appendChild(scriptElt);
}

function importCSS(cssFile)
{
  var cssElt = document.createElement('link');
  cssElt.rel = 'stylesheet';
  cssElt.type = 'text/css';
  cssElt.href = cssFile;
  document.getElementsByTagName('head')[0].appendChild(cssElt);
}

function init(imports)
{
  if (imports) {var arr = imports.split(','); for (x in arr) importJS(arr[x]);}

  var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  importJS(gaJsHost + 'google-analytics.com/ga.js');

  trackPage(); //ensure file above is loaded before running

}

_gat = false;
function trackPage()
{
  if(!_gat){setTimeout('trackPage()', 100);} else {_gat._getTracker("UA-78946-5")._trackPageview();}
}

/*
 *  Which javascripts to load for which pages:
 */
with (window)
{
  switch(location.pathname.replace('/', ''))
  {
    case '':
    case 'default.asp': /* onload = function() {init('j/dialog.js')}; break; */
    default: onload = function() {init('')}; break;
  }
}