//... Following code is placed inline at the bottom of the site master template

//var siteInfo; // serialized in master template

//if (siteInfo.includeGoogleAnalytics) {
//  var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
//  document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

//  try {
//    var pageTracker = _gat._getTracker("UA-4697010-10");
//    pageTracker._trackPageview();
//  } catch (err) { }
//}


var UComWebApp = {
  getServerPath: function() {
    return siteInfo.serverPath;
  },
  getImagePath: function(filename) {
    return siteInfo.imagePath + filename;
  },
  getRefreshCaptchaPath: function() {
    return siteInfo.captchaPath;
  }
};

var currentAdIndex = 0;

function ucomAdClick(elementId) {
  var $target = $("a#" + elementId);
  if ($target.length == 1) {
    window.open($target.attr("href"), $target.attr("target"));
  }  
}

function ucomFlashAdClick(elementId) {
  ucomAdClick(elementId);
}


// Required for MainMenu.ascx
var imageDir = UComWebApp.getImagePath("");
$(function() {
  var hover_over = function() {
    var src_hover = $(this).children("a").children("img").attr("rel");
    $(this).children("a").children("img").attr("src", imageDir + src_hover + "_2.gif");
    $(this).children("a").children(".arrow").css({ "display": "block" });
    $(this).children("ul").addClass("selected");
  };
  var hover_out = function() {
    var src_normal = $(this).children("a").children("img").attr("rel");
    $(this).children("a").children("img").attr("src", imageDir + src_normal + ".gif");
    $(this).children("a").children(".arrow").css({ "display": "none" });
    $(this).children("ul").removeClass("selected");
  }
  $("#nav_main > li").hoverIntent({
    sensitivity: 7, // number = sensitivity threshold (must be 1 or higher)    
    interval: 150, // number = milliseconds for onMouseOver polling interval    
    timeout: 150, // number = milliseconds delay before onMouseOut
    over: hover_over,
    out: hover_out
  });
});



