/* Controltag Loader for UT San Diego */
(function(){
  var debugging = /kxdebug/.test(location);
  var log = function() {
    // It's a flag, so if it's there, then it means debug.
    debugging && window.console && console.log([].slice.call(arguments).join(' '));
  };
  var load = function(url, callback) {
    log('Loading script from:', url);
    var node = document.createElement('script');
    node.async = true;  // This is just to be friendly.
    node.src = url;
    // Connect to both in case we're in older IE.
    node.onload = node.onreadystatechange = function() {
      var state = node.readyState;
      if (!callback.done && (!state || /loaded|complete/.test(state))) {
        log('Script loaded from:', url);
        callback.done = true;  // Mark the callback, so we don't load it twice on accident.
        callback();
      }
    };
    // Fetch the first script element, so we can insert the
    // controltag before it. There *must* be at least one
    // script element, or this code would never be called
    var sibling = document.getElementsByTagName('script')[0];
    sibling.parentNode.insertBefore(node, sibling);
  };
  // ControlTag simply crashes when opening a website from Twitter browser on
  // iOS, temporarily disable CT when Twitter for iPhone is detected until they
  // fix this (works fine with other twitter client though)
  if (/Twitter for iPhone/.test(window.navigator.userAgent || '')) return;
  var config = {"partner_segment_map": {}, "context_terms": [{"id": "Js86zJjs", "value": "cyber security 2014"}, {"id": "Js86zJ18", "value": "mobile health moves into the security spotlight"}, {"id": "Js86zKID", "value": "cyber tips for safe holiday shopping and travel"}, {"id": "Js86zKbV", "value": "just national cyber security"}, {"id": "Js86zKwn", "value": "simple steps for safer social media"}, {"id": "Js86zL2e", "value": "education security lessons for it pros"}, {"id": "Js86zMIz", "value": "when digital devices go wrong"}, {"id": "Js86zMjg", "value": "good or bad"}, {"id": "Js86zM14", "value": "the layered approach to defending your systems and data"}, {"id": "Js86zNIP", "value": "back to school with digital security"}, {"id": "Js86zNaX", "value": "safer computing for your small office or home office"}, {"id": "Js86zNsp", "value": "cyber safety tips for travelers"}, {"id": "Js86zN_C", "value": "shark summer"}, {"id": "JtCkEXNi", "value": "the internet of things"}, {"id": "JtCkEg6A", "value": "a tip a day for national cyber security awareness month"}], "tags": [{"content": "", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 1, "internal": 1, "content_type": "html", "timing": "asap", "method": "document", "type": "publisher", "id": 46405, "name": "Google User Matching"}, {"content": "", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 1, "internal": 1, "content_type": "html", "freq_cap": 3, "timing": "asap", "method": "document", "type": "publisher", "id": 50112, "name": "Site Scout user match"}, {"content": "", "target": null, "target_action": "append", "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 1, "internal": 6, "content_type": "html", "freq_cap": 3, "timing": "onload", "method": "document", "type": "data provider", "id": 41904, "name": "Technographic Data provider tag"}, {"content": "", "target": null, "target_action": "append", "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 1, "internal": 14, "content_type": "html", "freq_cap": 3, "timing": "onload", "method": "document", "id": 41905, "name": "Krux Geographic Data provider tag"}, {"content": "", "target": null, "target_action": "append", "require": "", "docwrite": null, "internal": 1, "template_replacement": 1, "execution_results": null, "tier": 1, "library_tag_config": {}, "content_type": "html", "timing": "onload", "method": "document", "type": "library", "id": 41906, "name": "Krux Track Social"}, {"content": "", "target": null, "target_action": "append", "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 1, "internal": 21, "content_type": "html", "freq_cap": 3, "timing": "onload", "method": "document", "type": "data provider", "id": 41929, "name": "Acxiom S2S provider tag"}, {"content": "", "target": null, "target_action": "append", "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 1, "internal": 8, "content_type": "html", "freq_cap": 3, "timing": "onload", "method": "document", "type": "data provider", "id": 41930, "name": "DataLogix provider tag"}, {"content": "", "target": null, "target_action": "append", "require": "", "docwrite": null, "template_replacement": 1, "execution_results": null, "tier": 1, "internal": 11, "content_type": "html", "freq_cap": 3, "timing": "onload", "method": "document", "type": "data provider", "id": 41931, "name": "eXelate Media provider tag"}, {"content": "", "target": "", "target_action": null, "require": "", "docwrite": null, "template_replacement": 1, "execution_results": {"onloadSafe": true, "docwrite": false, "listeners": []}, "tier": 1, "internal": 1, "content_type": "html", "timing": "onload", "method": "document", "type": "publisher", "id": 41923, "name": "DTC"}], "segments": [], "publisher": {"uuid": "3e2f2793-77bd-4f27-a770-be571256d69c", "id": 12357, "name": "UT San Diego"}, "controltag_options": {"async": "true", "render": true}, "site": {"id": 19392, "name": "utsandiego.com"}, "dnt": null, "params": {"connector_host": "connector.krxd.net", "control_tag_load_sync": "false", "fingerprint": false, "disable_http_compression": false, "remove_kxhead": true, "supertag_requires_approval": false, "config_source": 1, "control_tag_stats_prefix": null, "beacon_host": "beacon.krxd.net", "control_tag_pixel_throttle": "100", "user_id_cookie": null, "max_segments": null, "no_pii": 0, "recommend": "false", "revenue_optimization": false, "context_terms": "true", "jslog_host": "jslog.krxd.net", "site_level_supertag_config": "site", "max_slot_time": 1000, "services_host": "apiservices.krxd.net", "capture_leakage": true, "client_side_storage": "localStorage,cookie", "userData_host": "cdn.krxd.net", "control_tag_namespace": null, "control_tag_version": "steady", "capture_js_errors": "true", "datatag_version": "3", "dfp_premium": "true", "userdata_host": "cdn.krxd.net", "target_fingerprint": false}, "services": {"impression": "//beacon.krxd.net/ad_impression.gif", "stats": "//apiservices.krxd.net/stats", "userdata": "//cdn.krxd.net/userdata/get", "userData": "//cdn.krxd.net/user_data/segments/3", "um": "//apiservices.krxd.net/um", "optout": "//beacon.krxd.net/optout_check", "pixel": "//beacon.krxd.net/pixel.gif", "contentConnector": "//connector.krxd.net/content_connector/", "is_optout": "//beacon.krxd.net/optout_check", "set_optin": "//apiservices.krxd.net/consumer/optin", "social": "//beacon.krxd.net/social.gif", "set_optout": "//apiservices.krxd.net/consumer/optout", "data": "//beacon.krxd.net/data.gif", "event": "//beacon.krxd.net/event.gif", "log": "//jslog.krxd.net/jslog.gif"}, "geo": {}, "realtime_segments": [], "confid": "JfgSKv33"};
  // Wrap in a function and comment, then toString the func and replace
  // everything that's not the beginning or end of a JSON object, so we get a
  // string that's either empty or JSON.
  var esiGeo = String(function(){/*
    
  */}).replace(/^.*\/\*[^{]+|[^}]+\*\/.*$/g, '');
  if (esiGeo) {
    log('Got a request for:', esiGeo, 'adding geo to config.');
    try {
      config.geo = window.JSON.parse(esiGeo);
    } catch (__) {
      // Couldn't parse, so setting to {}
      log('Unable to parse geo from:', config.geo);
      config.geo = {};
    }
  }
  
  
  
  load('//cdn.krxd.net/ctjs/controltag.js.55610d92c803c550ecd09580cb6ee156', function() {
    
    
    log('Loading krux configuration.');
    Krux('config', config);
    
  });
})();