/* * If element doesn't have an omni tag we look for it in the closest 4 ancestors. The reason being that sometimes an anchor tag  * may have DIVs, SPANs (or other child elements) inside (For styling reasons) which do not get tracked as a click. The ancestor lookup * limitation is for performance concerns, since CS_onClickHandler() gets executed for all clicks for As, DIVs, INPUTs, BUTTONs,  * even if they don't have ice tags and it would continue looking for the tag all the way to the body tag. ouch */function lookupTag(elem, ascendTimes) {  var currParent  =  elem.parentNode;  var tag         =  '';  for(var i=0; i<=ascendTimes; i++) {    if(typeof currParent.name != "undefined") {      tag = currParent.name;      break;    }    currParent = currParent.parentNode;  }  return tag;}function CS_onClickHandler(e) {  var trackValue, tagname, divID, el = "";    el = (window.event) ? window.event.srcElement : e.target;    tagName  =  el.tagName;  divID    =  el.id;    if (tagName == "A" || tagName == "INPUT" || tagName == "DIV" || tagName == "SPAN" || tagName == "BUTTON") {     trackValue = (typeof el.name == "undefined") ? lookupTag(el, 4) : el.name;  } else if (tagName == "IMG") {		trackValue = (window.event) ? el.parentElement.name : el.parentNode.name;   }    if(divID == "omniture_click_tracking"){    $(document).ready(function(){      trackValue = $('#omniture_click_tracking').attr("name");    })		    }  if (trackValue != "" && trackValue != undefined) {    if (trackValue.split(":").length >= 3) {      iv_doTracking(trackValue,'','s_iv.eVar13',null,null,null,el);    }  }    if(window.location.hash == "#debug") {    alert('track val is '+trackValue);  //for testing in IE and stuff on the fly. Just add #debug hash at the end of URL  }}/* * Please Note: For some reason jquery tabbed component used in Health homepage interferes with the attachEvent in IE. No solution  * other than calling CS_onClickHandler() directly from the plugin. =(  */if (document.addEventListener){  document.addEventListener('click', CS_onClickHandler, true); } else if (document.attachEvent){  document.attachEvent('onclick', CS_onClickHandler); //IE is onclick}function hitFromTwilight(){	var twilightTrackValue = "iv:fafarazzi:twilightgame:click";	iv_doTracking(twilightTrackValue,'','s_iv.eVar13');		iv_setBusinessProps();}function hitFromFantasyGame(){	var fantasyTrackValue = "iv:fafarazzi:fantasygame:click";	iv_doTracking(fantasyTrackValue,'','s_iv.eVar13');	refresh_game_ads();	iv_setBusinessProps();}
