var tc_palettes = new Array();
tc_palettes[0] = {"name": "pal_00001", "channel": "5171778723", "border": "FFFFFF", "link": "366BB0", "bg": "FFFFFF", "text": "333333", "url": "333333", "at": "text/image", "ui": "rc:0" };
//tc_palettes[1] = {"name": "pal_00004", "channel": "2590356855", "border": "FFFFFF", "link": "0000FF", "bg": "FFFFFF", "text": "000000", "url": "000000", "at": "text/image", "ui": "rc:0" };
//tc_palettes[2] = {"name": "pal_00003", "channel": "8975362203", "border": "FFFFFF", "link": "0000FF", "bg": "FFFFFF", "text": "333333", "url": "333333", "at": "text/image", "ui": "rc:0" };
//tc_palettes[3] = {"name": "pal_00002", "channel": "0679867274", "border": "d1d9ef", "link": "0000FF", "bg": "d1d9ef", "text": "333333", "url": "333333", "at": "text/image", "ui": "rc:0" };
//tc_palettes[4] = {"name": "pal_00005", "channel": "5786211219", "border": "FFDDDD", "link": "0000FF", "bg": "FFDDDD", "text": "000000", "url": "000000", "at": "text/image", "ui": "rc:0" };

var tc_main_palette = tc_palettes[0];

var tc_fonts = new Array();
tc_fonts[0] = {"name": "fnt_am", "channel": "3125739734", "size": "medium", "face": "arial"};
tc_fonts[1] = {"name": "fnt_tl", "channel": "3702491146", "size": "large", "face": "times"};
//tc_fonts[2] = {"name": "fnt_al", "channel": "4730854796", "size": "large", "face": "arial"};
//tc_fonts[3] = {"name": "fnt_tm", "channel": "0181769018", "size": "medium", "face": "times"};
//tc_fonts[4] = {"name": "fnt_vm", "channel": "1496958053", "size": "medium", "face": "verdana"};
//tc_fonts[5] = {"name": "fnt_vl", "channel": "1740688978", "size": "large", "face": "verdana"};

var tc_main_font = tc_fonts[1];

var tc_randomize = Math.random();

if(tc_randomize > 0.5)
{
  tc_main_font = tc_fonts[0];
}

var tc_layouts = new Array();
tc_layouts["layout_001"] = {"channel": "5252701071"};
tc_layouts["layout_002"] = {"channel": "3727577134"};

var tc_page_types = new Array();
tc_page_types["typ_browse"] = {"channel": "1143332424"};
tc_page_types["typ_company"] = {"channel": "7410444496"};
tc_page_types["typ_course"] = {"channel": "7248247642"};
tc_page_types["typ_facility"] = {"channel": "3217276450"};
tc_page_types["typ_image_only"] = {"channel": "8422050447"};
tc_page_types["typ_index"] = {"channel": "4358139225"};
tc_page_types["typ_keyword"] = {"channel": "7813251964"};
tc_page_types["typ_learn"] = {"channel": "4012911696"};
tc_page_types["typ_other"] = {"channel": "3868081630"};
tc_page_types["typ_publication"] = {"channel": "4960221806"};
tc_page_types["typ_topic"] = {"channel": "2466459426"};
tc_page_types["typ_geo"] = {"channel": "9084888211"};
tc_page_types["typ_unknown"] = {"channel": "8250829965"};

var tc_times = new Array("6301076893","2349052263", "4447440232", "8710153509", "6957276298", "5054826455", "8425926999", "4136093569",
  "2026388406", "4791306656", "1938171265", "0977409294", "0285286422", "9980356969", "2729921305", "1664980398", "5344571150", "8688418557",
  "2127467583", "9983755864", "4682070488", "0115913055", "4653767361", "8300800769", "8993019724");

try{
  var tc_now = new Date();
  var tc_tzo=Math.floor(tc_now.getTimezoneOffset()/60)+12;
  var tc_tm_channel = typeof(tc_times[tc_tzo]) == 'string' ? tc_times[tc_tzo] : "8993019724";
}catch(err){};

var tc_locations = new Array();
tc_locations["loc_top"]    = {"channel": "8743092773+7523678912", "slot": "TC_SiteWide_Top_728x90", "enabled": false, "adsense_priority": 0, "initcount": 0, "pubcount": 0, "maxcount": 1, "width": 728, "height":90, "adsense": true};
tc_locations["loc_left"]   = {"channel": "8652272102+3275122100", "slot": "TC_SiteWide_Left_160x600", "enabled": false, "adsense_priority": 0, "initcount": 0, "pubcount": 0, "maxcount": 1, "width": 160, "height":600, "adsense": true};
tc_locations["loc_right"]  = {"channel": "6066375491+3275122100", "slot": "TC_SiteWide_Right_160x600", "enabled": false, "adsense_priority": 0, "initcount": 0, "pubcount": 0, "maxcount": 1, "width": 160, "height":600, "adsense": true};
tc_locations["loc_inter"]  = {"channel": "3288624940+0530900220", "slot": "TC_SiteWide_Inter_300x250", "enabled": false, "adsense_priority": 0, "initcount": 0, "pubcount": 0, "maxcount": 4, "width": 300, "height":250, "adsense": true, "sub_channels": new Array("0604384623","4180872685","0490406216","5580118153")};
tc_locations["loc_bottom"] = {"channel": "3595656747+7523678912", "slot": "TC_SiteWide_Bottom_728x90", "enabled": false, "adsense_priority": -1, "initcount": 0, "pubcount": 0, "maxcount": 1, "width": 728, "height":90, "adsense": true};
tc_locations["loc_section"] = {"channel": "7039091107+7523678912", "slot": "TC_SiteWide_Section_728x90", "enabled": false, "adsense_priority": 0, "initcount": 0, "pubcount": 0, "maxcount": 1, "width": 728, "height":90, "adsense": true};
tc_locations["loc_header_right"] = {"channel": "6456544010+9928404047", "slot": "TC_SiteWide_TopRight_234x60", "enabled": false, "adsense_priority": 0, "initcount": 0, "pubcount": 0, "maxcount": 1, "width": 234, "height":60, "adsense": false};


var tc_ads_inter_count = 0;

var tc_ads_published_max = 8;
var tc_ads_adsense_published_max = 3;

var tc_ads_initialized_count = 0;
var tc_ads_adsense_initialized_count = 0;
var tc_ads_slotted_count = 0;
var tc_ads_published_count = 0;
var tc_ads_adsense_published_count = 0;

var tc_ads_pub_id = "ca-pub-7517860768691636";

var tc_ads_interest_area = "training";

if(typeof(tc_search_term) == "string")
{
  tc_ads_interest_area =  tc_search_term;
}


tc_locations["loc_top"]["enabled"] = true;
tc_locations["loc_bottom"]["enabled"] = true;
tc_locations["loc_section"]["enabled"] = true;
tc_locations["loc_inter"]["enabled"] = false;
tc_locations["loc_left"]["enabled"] = false;
tc_locations["loc_right"]["enabled"] = true;
tc_locations["loc_header_right"]["enabled"] = true;


function tc_gam_ad_init_impl(locName, slotName)
{
  if(!tc_locations[locName]["adsense"] || tc_ads_adsense_initialized_count < tc_ads_adsense_published_max)
  {
    GA_googleAddSlot(tc_ads_pub_id, slotName);
    tc_locations[locName]["initcount"]++;
    tc_ads_initialized_count++;
    if(tc_locations[locName]["adsense"])
    {
      tc_ads_adsense_initialized_count++;
    }
  }
}

function tc_gam_ad_init(locName)
{
  tc_locations[locName]["name"] = locName;
  if(tc_locations[locName]["enabled"] && tc_ads_initialized_count < tc_ads_published_max)
  {
    if(typeof(tc_locations[locName]["sub_channels"]) == 'object')
    {
      if(typeof(tc_locations[locName]["maxcount"]) == 'undefined')
      {
        tc_locations[locName]["maxcount"] = tc_locations[locName]["sub_channels"].length;
      }
      tc_locations[locName]["slotnames"] = new Array();
      for(var i = 0; i < tc_locations[locName]["maxcount"]; i++)
      {
        tc_locations[locName]["slotnames"][i] = tc_locations[locName]["slot"] + "_" + i;
        tc_gam_ad_init_impl(locName,tc_locations[locName]["slotnames"][i]);
      }
    }
    else
    {
      tc_gam_ad_init_impl(locName,tc_locations[locName]["slot"]);
    }
  }
}

function tc_gam_ad_slot_add(locName)
{
  if(tc_locations[locName]["enabled"])
  {
    if(typeof(tc_locations[locName]["sub_channels"]) == 'object')
    {
      for(var i = 0; i < tc_locations[locName]["initcount"]; i++)
      {
        GA_googleAddAdSenseSlotAttr(tc_locations[locName]["slotnames"][i], "google_ad_channel", tc_channel_base + "+" + tc_locations[locName]["channel"] + "+" + tc_locations[locName]["sub_channels"][i]);
        tc_ads_slotted_count++;
      }
    }
    else
    {
      if(tc_locations[locName]["initcount"] > 0)
      {
        GA_googleAddAdSenseSlotAttr(tc_locations[locName]["slot"], "google_ad_channel", tc_channel_base + "+" + tc_locations[locName]["channel"]);
        tc_ads_slotted_count++;
      }
    }
  }
}

function tc_gam_ad_slot_render(locName)
{
  var tc_gam_ad_slot_rendered = false;
  if(typeof(tc_locations[locName]) == 'object')
  {
    if(tc_locations[locName]["initcount"] > 0)
    {
      var tc_ads_this_slot_space = tc_locations[locName];
      if(tc_ads_this_slot_space['enabled'])
      {
        if(tc_ads_published_count < tc_ads_published_max)
        {
          if(tc_ads_this_slot_space["pubcount"] <= tc_ads_this_slot_space["initcount"])
          {
            var tc_gam_ad_slot_allowed = true;

            if(tc_ads_this_slot_space['adsense'])
            {
              if(tc_ads_adsense_published_count >= (tc_ads_adsense_published_max + tc_ads_this_slot_space["adsense_priority"]))
              {
                tc_gam_ad_slot_allowed = false;
              }
            }

            if(tc_gam_ad_slot_allowed)
            {
              if(typeof(tc_ads_this_slot_space["sub_channels"]) == 'object')
              {
                GA_googleFillSlot(tc_ads_this_slot_space["slotnames"][tc_ads_this_slot_space["pubcount"]]);
              }
              else
              {
                GA_googleFillSlot(tc_ads_this_slot_space['slot']);
              }

              if(tc_ads_this_slot_space['adsense'])
              {
                tc_ads_adsense_published_count++;
              }
              tc_ads_published_count++;
              tc_ads_this_slot_space["pubcount"]++;
              tc_gam_ad_slot_rendered = true;
            }
          }
        }
      }
    }
  }
  return  tc_gam_ad_slot_rendered;
}

function tc_gam_ad_slot_collapse(divId)
{
  try
  {
    var thisslot =  document.getElementById(divId);
    if(null != thisslot && typeof( thisslot ) == 'object')
    {
      thisslot.innerHTML = '';
      thisslot.style.width = '0px';
      thisslot.style.height = '0px';
      thisslot.style.visibility = 'hidden';
    }
  }catch(err){}
}

function tc_gam_ad_init_page_palette( )
{
  GA_googleAddAdSensePageAttr("google_color_border", tc_main_palette["border"]);
  GA_googleAddAdSensePageAttr("google_color_link", tc_main_palette["link"]);
  GA_googleAddAdSensePageAttr("google_color_bg", tc_main_palette["bg"]);
  GA_googleAddAdSensePageAttr("google_color_text", tc_main_palette["text"]);
  GA_googleAddAdSensePageAttr("google_color_url", tc_main_palette["url"]);
  GA_googleAddAdSensePageAttr("google_ad_type", tc_main_palette["at"]);
  GA_googleAddAdSensePageAttr("google_ui_features", tc_main_palette["ui"]);
  GA_googleAddAdSensePageAttr("google_font_face", tc_main_font["face"]);
  GA_googleAddAdSensePageAttr("google_font_size", tc_main_font["size"]);
  if( tc_ads_adsense_published_max > 3 )
  {
    GA_googleAddAdSensePageAttr("google_region",  "test");
  }
  tc_channel_base = tc_channel_base += "+" +  tc_main_palette["channel"] + "+" +  tc_main_font["channel"];
}

function tc_gam_ad_init_all_locations(  )
{
  tc_gam_ad_init("loc_top");
  tc_gam_ad_init("loc_left");
  tc_gam_ad_init("loc_inter");
  tc_gam_ad_init("loc_right");
  tc_gam_ad_init("loc_section");
  tc_gam_ad_init("loc_bottom");
  tc_gam_ad_init("loc_header_right");
}

function  tc_gam_ad_slot_all_locations( )
{
  tc_gam_ad_slot_add("loc_top");
  tc_gam_ad_slot_add("loc_left");
  tc_gam_ad_slot_add("loc_inter");
  tc_gam_ad_slot_add("loc_right");
  tc_gam_ad_slot_add("loc_section");
  tc_gam_ad_slot_add("loc_bottom");
  tc_gam_ad_slot_add("loc_header_right");
}

function tc_gfc()
{
  google.friendconnect.container.setParentUrl('/gfc/' /* location of rpc_relay.html and canvas.html */);
  try
  {
    var gfc = document.getElementById('div-1151362496758756657');
    gfc.style.visibility = 'hidden';
    gfc.style.height = '0px';
  }catch(err){}

  /*
skin = {};
skin['BORDER_COLOR'] = '#cccccc';
skin['ENDCAP_BG_COLOR'] = '#e0ecff';
skin['ENDCAP_TEXT_COLOR'] = '#333333';
skin['ENDCAP_LINK_COLOR'] = '#0000cc';
skin['ALTERNATE_BG_COLOR'] = '#ffffff';
skin['CONTENT_BG_COLOR'] = '#ffffff';
skin['CONTENT_LINK_COLOR'] = '#0000cc';
skin['CONTENT_TEXT_COLOR'] = '#333333';
skin['CONTENT_SECONDARY_LINK_COLOR'] = '#7777cc';
skin['CONTENT_SECONDARY_TEXT_COLOR'] = '#666666';
skin['CONTENT_HEADLINE_COLOR'] = '#333333';
skin['POSITION'] = 'top';
skin['DEFAULT_COMMENT_TEXT'] = '- add your comment here -';
skin['HEADER_TEXT'] = 'Comments';
google.friendconnect.container.setParentUrl('/gfc/');
google.friendconnect.container.renderSocialBar(
 { id: 'div-1151362496758756657',
   site: '05985594107675781913',
   'view-params':{"scope":"SITE","features":"video,comment","showWall":"true"}
 }, skin);
  */
}

function tc_page_loaded_almost()
{
  if(tc_enable_gfc)
  {
    tc_gfc();
  }
}




