
Function.NoOp = function(a) { return (a); }
if (!window.BtvOverlay) window.BtvOverlay = {};
(function(){
if (!BtvOverlay.Util) BtvOverlay.Util = {};
BtvOverlay.Util.ArrayToHash = function(a, fnc)
{
fnc = fnc || Function.NoOp;
var ht = {};
for (var i = 0; a && (i < a.length); i++) ht[fnc(a[i])] = true;
return (ht);
}
BtvOverlay.Util.ToLowerCase = function(s)
{
return(s.toLowerCase());
}
BtvOverlay.Util.ToUpperCase = function(s)
{
return(s.toUpperCase());
}
var re = new RegExp("[\\[\\]{}\\\\|().*+?\^\$]", "g");
BtvOverlay.Util.RegExpEscape = function(s)
{
return s.replace(re, "\\$&");
}
})();
BtvOverlay.Dom = new function()
{
var oThis = this;
oThis.Traverse = function(oNode, fnc, fncStop)
{
function Loop()
{
while (aNodesToSearch.length > 0)
{
if (iDelayIterations++ == 100)
{
iDelayIterations = 0;
window.setTimeout(Loop, 10);
fncStop(true);
return;
}
else
{
oNode = aNodesToSearch[aNodesToSearch.length-1];
if (oNode == aParentNodes[aParentNodes.length-1])
{
aParentNodes.pop();
aNodesToSearch.pop();
fnc(oNode, false);
}
else
{
if (!fnc(oNode, true) && oNode.childNodes.length)
{
aParentNodes.push(oNode);
for (var i = oNode.childNodes.length - 1; i >= 0; i--)
{
aNodesToSearch.push(oNode.childNodes[i]);
}
}
else
{
aNodesToSearch.pop();
fnc(oNode, false)
}
}
}
}
fncStop(false);
}
var iDelayIterations = 0;
var aNodesToSearch = oNode ? [oNode] : [];
var aParentNodes = [];
Loop();
}
oThis.FindNodes = function(oNode, aNodeTypes, oRules, fncCallback)
{
function Nodify(oNode, bln)
{
if (bln)
{
var iType = oNode.nodeType;
if (iInclude && htNodeTypes[iType]) aTextNodes.push(oNode);
if (iType != 1) return(true);
var id = oNode.getAttribute("id");
if (lookup[0] && lookup[0].ids[id]) return(true);
var strTagName = oNode.tagName;
if (lookup[0] && lookup[0].tags[strTagName]) return(true);
var strClasses = oNode.className;
if (lookup[0] && lookup[0].classes[strClasses]) return(true);
if (lookup[1] && (lookup[1].tags[strTagName] || lookup[1].ids[id] || lookup[1].classes[strClasses]))
{
aIncludeNodes.push(oNode);
iInclude++;
}
return(false);
}
else
{
if (aIncludeNodes.length && (aIncludeNodes[aIncludeNodes.length-1] == oNode))
{
aIncludeNodes.pop();
iInclude--;
}
}
}
function Stop(bln)
{
fncCallback(aTextNodes, bln);
aTextNodes = [];
}
function CreateLookup()
{
var lookup = [];
if (oRules.oExclude) lookup[0] = {
tags: ath(oRules.oExclude.aTags, BtvOverlay.Util.ToUpperCase)
,ids: ath(oRules.oExclude.aIds)
,classes: ath(oRules.oExclude.aClasses)
};
if (oRules.oInclude) lookup[1] = {
tags: ath(oRules.oInclude.aTags, BtvOverlay.Util.ToUpperCase)
,ids: ath(oRules.oInclude.aIds)
,classes: ath(oRules.oInclude.aClasses)
};
return(lookup);
}
oRules.aNodeTypes = aNodeTypes;
var iInclude = oRules.oInclude ? 0 : 1;
var ath = BtvOverlay.Util.ArrayToHash;
var htNodeTypes = BtvOverlay.Util.ArrayToHash(oRules.aNodeTypes);
var lookup = CreateLookup();
var aIncludeNodes = [];
var aTextNodes = [];
BtvOverlay.Dom.Traverse(oNode, Nodify, Stop);
}
};
BtvOverlay.Dom.Tokenizer = new function()
{
var oThis = this;
oThis.Run = function(oNode, astrKeywords, htTermsData, oRules, strTermColor, fnc)
{
function RunSet(aNodes, astrKeywords, fnc)
{
function BuildReplacement(oNode, strText, aMatches)
{
function InAnchor()
{
var o = oNode;
while (o.parentNode)
{
if (o.parentNode.tagName && (o.parentNode.tagName.toLowerCase() == "a")) return(true);
o = o.parentNode
}
return(false);
}
function Adorn(str)
{
var span = document.createElement("foo");
if (!span.addEventListener) span.style.position = "relative";
span.style.display = "inline";
span.style.textDecoration = "underline";
span.style.borderBottom = "solid 1px " + strTermColor;
if (!span.addEventListener) span.style.top = "1px";
span.style.cursor = "pointer";
span.style.zoom = 1;
fnc(span, str);
span.innerHTML = str;
return (span);
}
function CheckSpan(span)
{
var str = span.innerHTML;
span.innerHTML = '&nbsp;';
var iOneLineHeight = span.offsetHeight;
span.innerHTML = str;
var iEntireHeight = span.offsetHeight;
span._blnWrap = (iEntireHeight > (1.5 * iOneLineHeight));
}
function CreateIcon(str)
{
var img = document.createElement('img');
img.src = '/images/overlay-action.png';
img.style.borderWidth = '0px';
img.style.display = 'inline';
//img.style.verticalAlign = 'text-bottom';
img.style.padding = '1px 0px 0px 4px';
img.style.margin = '0px';
img.style.cursor = "pointer";
img.style.zoom = 1;
img.__blnOverlay = true;
fnc(img, str);
return(img);
}
if (!oNode.parentNode) return;
for (var i=0; i < oNode.parentNode.childNodes.length; i++)
{
if (oNode.parentNode.childNodes[i].__blnOverlay) return;
}
var iStart = 0;
for (var i = 0; i < aMatches.length; i++)
{
var strMatch = aMatches[i][0];
var strTerm = aMatches[i][1];
if (true)
{
var iPlainTextLength = aMatches[i].index + strMatch.indexOf(strTerm);
var textNode = document.createTextNode(strText.substring(iStart, iPlainTextLength));
oNode.parentNode.insertBefore(textNode, oNode);
var span = Adorn(strTerm);
oNode.parentNode.insertBefore(span, oNode);
CheckSpan(span);
iStart = iPlainTextLength + strTerm.length;
}
else
{
var iPlainTextLength = aMatches[i].index + strMatch.indexOf(strTerm) + strTerm.length;
var textNode = document.createTextNode(strText.substring(iStart, iPlainTextLength));
oNode.parentNode.insertBefore(textNode, oNode);
oNode.parentNode.insertBefore(CreateIcon(strTerm), oNode);
iStart = iPlainTextLength;
}
}
var textNode = document.createTextNode(strText.substring(iStart));
oNode.parentNode.insertBefore(textNode, oNode);
oNode.parentNode.removeChild(oNode);
}
function SortKeywords(s1, s2)
{
var i1 = s1.length;
var i2 = s2.length;
return((i1 < i2) ? 1 : ((i1 > i2) ? -1 : 0));
}
astrKeywords.sort(SortKeywords);
var aReKeywords = [];
for (var i=0; i < astrKeywords.length; i++)
{
aReKeywords.push(BtvOverlay.Util.RegExpEscape(astrKeywords[i]));
}
var reSearch = new RegExp("(?:^|[^0-9A-Za-z])(" + aReKeywords.join('|') + ")([^0-9A-Za-z]|$)", "g");
var aMatch;
var aMatches;
var strTerm;
for (var i = 0; i < aNodes.length; i++)
{
aMatches = null;
var str = aNodes[i].nodeValue;
while ((aMatch = reSearch.exec(str)) != null)
{
aMatches = aMatches || [];
strTerm = aMatch[1];
if (!htTermMatches[strTerm]) htTermMatches[strTerm] = 0;
if (!htTermsData[strTerm] || (htTermsData[strTerm].MaxCount <= 0) || (htTermMatches[strTerm] < htTermsData[strTerm].MaxCount))
{
htTermMatches[strTerm]++;
aMatches.push(aMatch);
}
if (aMatch[2]) reSearch.lastIndex -= 1;
}
if (aMatches) BuildReplacement(aNodes[i], str, aMatches);
}
}
function HaveNodes(aTextNodes, bln)
{
RunSet(aTextNodes, astrKeywords, fnc);
if (!bln)
{
var dtEnd = (new Date()).valueOf();
//alert(dtEnd - dtStart);
}
}
var dtStart = (new Date()).valueOf();
if (!oRules.oExclude) oRules.oExclude = {};
if (!oRules.oExclude.aTags) oRules.oExclude.aTags = [];
if (!oRules.oExclude.aClasses) oRules.oExclude.aClasses = [];
oRules.oExclude.aTags.push("script");
oRules.oExclude.aTags.push("foo");
oRules.oExclude.aTags.push("textarea");
oRules.oExclude.aClasses.push("nooverlay", "btv_orange_button", "article_page_title");
var htTermMatches = {};
var aTextNodes = BtvOverlay.Dom.FindNodes(oNode, [3], oRules, HaveNodes);
}
};
(function()
{
var oOverlayData = {"data":[{"Url":"joe-lauzon.aspx","PhotoCount":3,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Joe-Lauzon.jpg","Term":"Joe Lauzon","ID":4851,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"cb-dollaway.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/CB-Dollaway.jpg","Term":"C.B. Dollaway","ID":18291,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"forrest-griffin.aspx","PhotoCount":10,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Forrest-Griffin.jpg","Term":"Forrest Griffin","ID":108,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"rich-franklin.aspx","PhotoCount":15,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Rich-Franklin.jpg","Term":"Rich Franklin","ID":107,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"michael-bisping.aspx","PhotoCount":30,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Michael-Bisping.jpg","Term":"Michael Bisping","ID":122,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"mirko-filipovich.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Mirko-Filipovich.jpg","Term":"Mirko Filipovich","ID":129,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"jesse-taylor.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Jesse-Taylor.jpg","Term":"Jesse Taylor","ID":18470,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"renato-sobral.aspx","PhotoCount":6,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Renato-Sobral.jpg","Term":"Renato Sobral","ID":115,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"rich-clementi.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Rich-Clementi.jpg","Term":"Rich Clementi","ID":179,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"andy-wang.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Andy-Wang.jpg","Term":"Andy Wang","ID":5273,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"matt-serra.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Matt-Serra.jpg","Term":"Matt Serra","ID":11382,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"tim-credeur.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Tim-Credeur.jpg","Term":"Tim Credeur","ID":18464,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"kendall-grove.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Kendall-Grove.jpg","Term":"Kendall Grove","ID":116,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"marlon-sims.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Marlon-Sims.jpg","Term":"Marlon Sims","ID":5279,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"gerald-harris.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Gerald-Harris.jpg","Term":"Gerald Harris","ID":18471,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"daniel-barrera.aspx","PhotoCount":1,"Rank":2905,"ImageSrc":"/articles/ufc/profile/Daniel-Barrera.jpg","Term":"Daniel Barrera","ID":11397,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"noah-thomas.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Noah-Thomas.jpg","Term":"Noah Thomas","ID":5281,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"wayne-weems.aspx","PhotoCount":2,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Wayne-Weems.jpg","Term":"Wayne Weems","ID":4852,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"patrick-cote.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Patrick-Cote.jpg","Term":"Patrick Cote","ID":172,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"jeremy-jackson.aspx","PhotoCount":197,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Jeremy-Jackson.jpg","Term":"Jeremy Jackson","ID":180,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"paul-georgieff.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Paul-Georgieff.jpg","Term":"Paul Georgieff","ID":11395,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"diego-sanchez.aspx","PhotoCount":4,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Diego-Sanchez.jpg","Term":"Diego Sanchez","ID":114,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"troy-mandaloniz.aspx","PhotoCount":29,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Troy-Mandaloniz.jpg","Term":"Troy Mandaloniz","ID":11391,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"cale-yarbrough.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Cale-Yarbrough.jpg","Term":"Cale Yarbrough","ID":18293,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"george-sotiropoulos.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/George-Sotiropoulos.jpg","Term":"George Sotiropoulos","ID":11384,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"georges-st-pierre.aspx","PhotoCount":4,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Georges-St-Pierre.jpg","Term":"Georges St. Pierre","ID":110,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"nick-klein.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Nick-Klein.jpg","Term":"Nick Klein","ID":18287,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"scott-smith.aspx","PhotoCount":121,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Scott-Smith.jpg","Term":"Scott Smith","ID":177,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"ben-saunders.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Ben-Saunders.jpg","Term":"Ben Saunders","ID":11386,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"mike-dolce.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Mike-Dolce.jpg","Term":"Mike Dolce","ID":18288,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"brandon-sene.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Brandon-Sene.jpg","Term":"Brandon Sene","ID":18473,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"luke-zachrich.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Luke-Zachrich.jpg","Term":"Luke Zachrich","ID":18468,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"charles-mccarthy.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Charles-McCarthy.jpg","Term":"Charles McCarthy","ID":175,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"gray-maynard.aspx","PhotoCount":2,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Gray-Maynard.jpg","Term":"Gray Maynard","ID":4846,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"pete-spratt.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Pete-Spratt.jpg","Term":"Pete Spratt","ID":183,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"matthew-riddle.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Matthew-Riddle.jpg","Term":"Matthew Riddle","ID":18465,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"takanori-gomi.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Takanori-Gomi.jpg","Term":"Takanori Gomi","ID":132,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"robert-emerson.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Robert-Emerson.jpg","Term":"Robert Emerson","ID":5280,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"matt-hughes.aspx","PhotoCount":7,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Matt-Hughes.jpg","Term":"Matt Hughes","ID":11381,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"amir-sadollah.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Amir-Sadollah.jpg","Term":"Amir Sadollah","ID":18294,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"gideon-ray.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Gideon-Ray.jpg","Term":"Gideon Ray","ID":176,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"cole-miller.aspx","PhotoCount":45,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Cole-Miller.jpg","Term":"Cole Miller","ID":4849,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"chuck-liddell.aspx","PhotoCount":157,"Rank":2288,"ImageSrc":"/articles/dancing-with-the-stars/profile/chuck-liddell.jpg","Term":"Chuck Liddell","ID":112,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"matthew-arroyo.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Matthew-Arroyo.jpg","Term":"Matthew Arroyo","ID":11399,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"john-kolosci.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/John-Kolosci.jpg","Term":"John Kolosci","ID":11392,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"rampage-jackson.aspx","PhotoCount":32,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Rampage-Jackson.jpg","Term":"Rampage Jackson","ID":18296,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"aleksander-emilianenko.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Aleksander-Emilianenko.jpg","Term":"Aleksander Emilianenko","ID":131,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"din-thomas.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Din-Thomas.jpg","Term":"Din Thomas","ID":182,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"josh-barnett.aspx","PhotoCount":3,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Josh-Barnett.jpg","Term":"Josh Barnett","ID":133,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"gabe-ruediger.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Gabe-Ruediger.jpg","Term":"Gabe Ruediger","ID":5277,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"ivan-salaverry.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Ivan-Salaverry.jpg","Term":"Ivan Salaverry","ID":255,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"luke-cummo.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Luke-Cummo.jpg","Term":"Luke Cummo","ID":123,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"allen-berube.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Allen-Berube.jpg","Term":"Allen Berube","ID":5272,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"dante-rivera.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Dante-Rivera.jpg","Term":"Dante Rivera","ID":18290,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"chris-leben.aspx","PhotoCount":24,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Chris-Leben.jpg","Term":"Chris Leben","ID":256,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"shonie-carter.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Shonie-Carter.jpg","Term":"Shonie Carter","ID":124,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"brian-geraghty.aspx","PhotoCount":41,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Brian-Geraghty.jpg","Term":"Brian Geraghty","ID":5275,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"blake-bowman.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Blake-Bowman.jpg","Term":"Blake Bowman","ID":11398,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"stephan-bonnar.aspx","PhotoCount":8,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Stephan-Bonnar.jpg","Term":"Stephan Bonnar","ID":120,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"paul-bradley.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Paul-Bradley.jpg","Term":"Paul Bradley","ID":18286,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"pete-sell.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Pete-Sell.jpg","Term":"Pete Sell","ID":127,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"joseph-scarola.aspx","PhotoCount":1,"Rank":2881,"ImageSrc":"/articles/ufc/profile/Joseph-Scarola.jpg","Term":"Joseph Scarola","ID":11385,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"wanderlei-silva.aspx","PhotoCount":23,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Wanderlei-Silva.jpg","Term":"Wanderlei Silva","ID":128,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"matt-brown.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Matt-Brown.jpg","Term":"Matt Brown","ID":18466,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"nate-quarry.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Nate-Quarry.jpg","Term":"Nate Quarry","ID":119,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"billy-miles.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Billy-Miles.jpg","Term":"Billy Miles","ID":11390,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"corey-hill.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Corey-Hill.jpg","Term":"Corey Hill","ID":5276,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"nathan-diaz.aspx","PhotoCount":3,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Nate-Diaz.jpg","Term":"Nate Diaz","ID":4853,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"mikey-burnett.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Mikey-Burnett.jpg","Term":"Mikey Burnett","ID":178,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"jeremy-may.aspx","PhotoCount":20,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Jeremy-May.jpg","Term":"Jeremy May","ID":18289,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"dorian-price.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Dorian-Price.jpg","Term":"Dorian Price","ID":11388,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"edwin-dewees.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Edwin-Dewees.jpg","Term":"Edwin Dewees","ID":173,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"tito-ortiz.aspx","PhotoCount":124,"Rank":3007,"ImageSrc":"/articles/the-apprentice/profile/Tito-Ortiz.jpg","Term":"Tito Ortiz","ID":13939,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"tommy-speer.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Tommy-Speer.jpg","Term":"Tommy Speer","ID":11383,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"kenny-florian.aspx","PhotoCount":28,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Kenny-Florian.jpg","Term":"Kenny Florian","ID":117,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"brandon-melendez.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Brandon-Melendez.jpg","Term":"Brandon Melendez","ID":5274,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"jorge-rivera.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Jorge-Rivera.jpg","Term":"Jorge Rivera","ID":126,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"joe-stevenson.aspx","PhotoCount":5,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Joe-Stevenson.jpg","Term":"Joe Stevenson","ID":121,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"tim-sylvia.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Tim-Sylvia.jpg","Term":"Tim Sylvia","ID":113,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"fedor-emilianenko.aspx","PhotoCount":2,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Fedor-Emelianenko.jpg","Term":"Fedor Emelianenko","ID":130,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"mac-danzig.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Mac-Danzig.jpg","Term":"Mac Danzig","ID":11396,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"travis-lutter.aspx","PhotoCount":10,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Travis-Lutter.jpg","Term":"Travis Lutter","ID":174,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"chris-lytle.aspx","PhotoCount":10,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Chris-Lytle.jpg","Term":"Chris Lytle","ID":181,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"manuel-gamburyan.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Manuel-Gamburyan.jpg","Term":"Manuel Gamburyan","ID":5278,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"dan-cramer.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Dan-Cramer.jpg","Term":"Dan Cramer","ID":18472,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"jared-rollins.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Jared-Rollins.jpg","Term":"Jared Rollins","ID":11387,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"matt-winman.aspx","PhotoCount":2,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Matt-Wiman.jpg","Term":"Matt Wiman","ID":4848,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"richie-hightower.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Richie-Hightower.jpg","Term":"Richie Hightower","ID":11393,"RelatedID":237,"Scope":0,"MaxCount":3},{"Url":"karo-parysian.aspx","PhotoCount":1,"Rank":3007,"ImageSrc":"/articles/ufc/profile/Karo-Parisyan.jpg","Term":"Karo Parisyan","ID":118,"RelatedID":237,"Scope":0,"MaxCount":3}]};
var oExcludeData = {"Ids":null,"Tags":["h2"],"Classes":["wiki-text"]};
var oIncludeData = {"Ids":null,"Tags":null,"Classes":["content-col"]};
var strTermColor = null || "#999999";
var strBaseUrl = '';
var oRules = {};
if (oExcludeData)
{
oRules.oExclude = {
aIds: oExcludeData.Ids || []
,aTags: oExcludeData.Tags || []
,aClasses: oExcludeData.Classes || []
};
}
if (oIncludeData)
{
oRules.oInclude = {
aIds: oIncludeData.Ids || []
,aTags: oIncludeData.Tags || []
,aClasses: oIncludeData.Classes || []
};
}
var afncCastOverlayBuilders = {};
afncCastOverlayBuilders[0] = function($data){var $text = [];var _write = function(text) {$text.push((typeof text == "number")?text:(text||""));};with($data){ _write('<div id=\"divHoverHandle');_write(Term);_write('\" style=\"width:285px;background:url(\'');_write(strBaseUrl);_write('/images/pop-shadow.png\');zoom:1;\">\n<div style=\"border:1px solid #666666; background:#eeeeee; font-size:11px;  padding:7px; position:relative;bottom:3px;right:3px;zoom:1;\">\n<a href=\"');_write(strBaseUrl);_write('/');_write(Url);_write('\"><img src=\"http://www.buddytv.com');_write(ImageSrc);_write('\" style=\"border:none;width:92px;float:left;margin-right:5px;\"/></a>\n<div style=\"float:right;width:165px;zoom:1;\">\n<div style=\"font-size:16px;font-weight:bold;margin:-2px 0px 5px 0px;zoom:1;\"><a href=\"');_write(strBaseUrl);_write('/');_write(Url);_write('\">');_write(Term);_write('</a></div>\n<div style=\"margin-bottom:2px;zoom:1;\">Today’s Ranking: ');_write(Rank);_write('</div>\n<div style=\"margin-bottom:3px;zoom:1;\"><a href=\"');_write(strBaseUrl);_write('/btvredir.aspx?ctxtypid=21&ctxid=');_write(ID);_write('&pid=21&pnum=-1\">View Photos</a></div>\n<div style=\"zoom:1;\"><a href=\"');_write(strBaseUrl);_write('/btvredir.aspx?ctxtypid=21&ctxid=');_write(ID);_write('&pid=28&pnum=-1\">Rate now &raquo;</a></div>\n</div>\n<div style=\"clear:both;\"></div>\n</div>\n</div>');}return $text.join("");};
afncCastOverlayBuilders[1] = function($data){var $text = [];var _write = function(text) {$text.push((typeof text == "number")?text:(text||""));};with($data){ _write('<div id=\"divHoverHandle');_write(Term);_write('\" style=\"width:285px;background:url(\'');_write(strBaseUrl);_write('/images/pop-shadow.png\'); zoom:1;\">\n<div style=\"border:1px solid #666666; background:#eeeeee; font-size:11px;  padding:7px; position:relative;bottom:3px;right:3px;zoom:1;\">\n<a href=\"');_write(strBaseUrl);_write('/');_write(Url);_write('\"><img src=\"http://www.buddytv.com');_write(ImageSrc);_write('\" style=\"border:none;width:92px;float:left;margin-right:5px;\"/></a>\n<div style=\"float:right;width:165px;zoom:1;\">\n<div style=\"font-size:16px;font-weight:bold;margin:-2px 0px 5px 0px;zoom:1;\"><a href=\"');_write(strBaseUrl);_write('/');_write(Url);_write('\">');_write(Term);_write('</a></div>\n<div style=\"margin-bottom:2px;zoom:1;\">Today’s Ranking: ');_write(Rank);_write('</div>\n<div style=\"margin-bottom:3px;zoom:1;\"><a href=\"');_write(strBaseUrl);_write('/btvredir.aspx?ctxtypid=-1000&ctxid=');_write(ID);_write('&pid=21&pnum=-1\">View Photos (');_write(PhotoCount);_write(')</a></div>\n<div style=\"margin-bottom:3px;zoom:1;\"><a href=\"');_write(strBaseUrl);_write('/btvredir.aspx?ctxtypid=-1000&ctxid=');_write(ID);_write('&pid=35&pnum=-1\">Play Trivia &raquo;</a></div>\n</div>\n<div style=\"clear:both;\"></div>\n</div>\n</div>');}return $text.join("");};
function Run()
{
function GiveElementLayout(el)
{
if (el && !el.hasLayout) el.style.zoom = 1;
}
function GetWindowPosition()
{
function f(p1, p2)
{
var iWin = window[p1] ? window[p1] : 0;
var iDocEl = document.documentElement ? document.documentElement[p2] : 0;
var iBody = document.body ? document.body[p2] : 0;
var i = iWin ? iWin : 0;
if (iDocEl && (!i || (i > iDocEl))) i = iDocEl;
return(iBody && (!i || (i > iBody)) ? iBody : i);
}
var iW = f('innerWidth', 'clientWidth');
var iH = f('innerHeight', 'clientHeight');
var iL = f('pageXOffset', 'scrollLeft');
var iT = f('pageYOffset', 'scrollTop');
return({t:iT, r:(iW + iL), b:(iH + iT), l:iL});
}
function GetElPosition(el)
{
var pt = GetAbsPos(el);
return({t:pt.y, r:(pt.x + el.offsetWidth), b:(pt.y + el.offsetHeight), l:pt.x});
}
function GetOverlayPlacementPoint(elContext, elOverlay)
{
var elPos = GetElPosition(elContext);
var wndPos = GetWindowPosition();
var iSpace = 10;
var posSpace = {t:(elPos.t - wndPos.t - iSpace), r:(wndPos.r - elPos.r - iSpace), b:(wndPos.b - elPos.b - iSpace), l:(elPos.l - wndPos.l - iSpace)};
var iW = elOverlay.offsetWidth;
var iH = elOverlay.offsetHeight;
var pt = {x:wndPos.l, y:wndPos.t};
if (posSpace.t >= iH)
{
pt.y = elPos.t - iH;
}
else if (posSpace.b >= iH)
{
pt.y = elPos.b;
}
if (posSpace.r >= iW)
{
pt.x = elPos.r;
}
else if (posSpace.l >= iW)
{
pt.x = elPos.l - iW;
}
//pt.y += 3;
return(pt);
}
function AdjustPlacementPoint(pt, elOverlay)
{
var iW = elOverlay.offsetWidth;
var iH = elOverlay.offsetHeight;
var posOverlay = {t:pt.y, r:(pt.x + iW), b:(pt.y + iH), l:pt.x};
var wndPos = GetWindowPosition();
var iSpace = 10;
var posSpace = {t:(posOverlay.t - wndPos.t - iSpace), r:(wndPos.r - posOverlay.r - iSpace), b:(wndPos.b - posOverlay.b - iSpace), l:(posOverlay.l - wndPos.l - iSpace)};
if (posSpace.r < 0)
{
pt.x += posSpace.r;
}
else if (posSpace.l < 0)
{
pt.x += (0 - posSpace.l);
}
if (posSpace.t < 0)
{
pt.y += (0 - posSpace.t);
}
else if (posSpace.b < 0)
{
pt.y += posSpace.b;
}
return(pt);
}
function GetAbsPos(element)
{
function F(el)
{ 
var pt = {x:0,y:0};
if (el)
{ 
GiveElementLayout(el); 
pt.x += el.offsetLeft;
pt.y += el.offsetTop; 
var elOffset = el.offsetParent;
var elParent = el.parentNode;
while (elOffset)
{
GiveElementLayout(elOffset);
pt.x += elOffset.offsetLeft; 
pt.y += elOffset.offsetTop; 
if ((document.body != elOffset) && (document.documentElement != elOffset))
{ 
pt.x -= elOffset.scrollLeft; 
pt.y -= elOffset.scrollTop; 
} 
if (false && blnFirefox)
{ 
while (elParent && (elOffset != elParent))
{ 
pt.x -= elParent.scrollLeft; 
pt.y -= elParent.scrollTop; 
elParent = elParent.parentNode; 
}
} 
elParent = elOffset.parentNode;
elOffset = elOffset.offsetParent; 
} 
} 
return pt; 
} 
var blnFirefox = !!element.addEventListener;
if (!blnFirefox)
{
F(element, blnFirefox);
}
return(F(element, blnFirefox));
}
function AddEvent(obj, type, fn)
{
if (obj.addEventListener)
{
obj.addEventListener(type, fn, false);
}
else if (obj.attachEvent)
{
obj["e" + type + fn] = fn;
obj[type + fn] = function() { obj["e" + type + fn](window.event); }
obj.attachEvent("on" + type, obj[type + fn]);
}
}
function GetOverlayNode(strTerm)
{
if (!htOverlays[strTerm])
{
var oData = htTermsData[strTerm];
var strOverlayHtml = afncCastOverlayBuilders[oData.Scope](oData);
var div = document.createElement("div");
div.innerHTML = strOverlayHtml;
htOverlays[strTerm] = div.childNodes[0];
}
return(htOverlays[strTerm]);
}
function ShowOverlay(oNode, strTerm, pt)
{
blnNeedEventHookup = !htOverlays[strTerm];
HideCurrentOverlay(true);
elCurrentOverlay = GetOverlayNode(strTerm);
divOverlay.appendChild(elCurrentOverlay);
document.body.appendChild(divOverlay);
if (blnNeedEventHookup)
{
var elHandler = document.getElementById("divHoverHandle" + strTerm);
AddEvent(elHandler, blnIsIE ? "mouseenter" : "mouseover", OverlayOver);
AddEvent(elHandler, blnIsIE ? "mouseleave" : "mouseout", CommonOut);
}
var oPoint = GetAbsPos(oNode);
var overlayPt = GetOverlayPlacementPoint(oNode, divOverlay);
if (oNode._blnWrap)
{
overlayPt.x = pt.x - divOverlay.offsetWidth;
AdjustPlacementPoint(overlayPt, divOverlay);
}
divOverlay.style.visibility = "hidden";
divOverlay.style.top = overlayPt.y + "px";
divOverlay.style.left = overlayPt.x + "px";
divOverlay.style.visibility = "visible";
}
function MouseCoordinates(evt)
{
if (blnIsIE)
{
var oPoint = GetAbsPos(evt.srcElement);
return({x:(evt.x + oPoint.x), y:(evt.y + oPoint.y)});
}
else
{
return({x:evt.pageX, y:evt.pageY});
}
}
function HideCurrentOverlay(bln)
{
function F()
{
if ((elCurrentOverlay) && (iCounter_local == iCounter) && (!iOverCount))
{
iOverCount = 0;
divOverlay.removeChild(elCurrentOverlay);
divOverlay.parentNode.removeChild(divOverlay);
elCurrentOverlay = null;
}
}
iCounter++;
var iCounter_local = iCounter;
if (bln)
{
iOverCount= 0;
F();
}
else
{
window.setTimeout(F, 400);
}
}
var iCounter = 0;
if (Btv && Btv.Ads)
{
//Btv.Ads.onChangeRequest.Attach(RunFromBody);
}
var elCurrentOverlay;
var htOverlays = {};
function HookupTerm(oNode, strTerm)
{
function Over(evt)
{
ShowOverlay(oNode, strTerm, MouseCoordinates(evt));
iOverCount++;
}
AddEvent(oNode, blnIsIE ? "mouseenter" : "mouseover", Over);
AddEvent(oNode, blnIsIE ? "mouseleave" : "mouseout", CommonOut);
AddEvent(oNode, "click", function(){HideCurrentOverlay(true);});
}
function OverlayOver()
{
iOverCount++;
}
function CommonOut()
{
iOverCount--;
HideCurrentOverlay();
}
var iOverCount = 0; 
var divOverlay = document.createElement('div');
divOverlay.style.position = "absolute";
divOverlay.style.zIndex = "9999";
var blnIsIE = !divOverlay.addEventListener;
var astrTerms = [];
var htTermsData = {};
function ProcessOverlayData()
{
for (var i=0; i < oOverlayData.data.length; i++)
{
if (!htTermsData[oOverlayData.data[i].Term])
{
astrTerms.push(oOverlayData.data[i].Term);
htTermsData[oOverlayData.data[i].Term] = oOverlayData.data[i];
oOverlayData.data[i].strBaseUrl = "";
}
}
}
ProcessOverlayData();
window["RunBtvTokenizer"] = function(el, oOverlayData_)
{
if (oOverlayData_)
{
oOverlayData.data = oOverlayData_;
ProcessOverlayData();
} 
if (el)
{
if (astrTerms.length > 0) BtvOverlay.Dom.Tokenizer.Run(el, astrTerms, htTermsData, oRules, strTermColor, HookupTerm);
blnPending = false;
}
else
{
Refresh();
}
}
function RunFromBody()
{
RunBtvTokenizer(document.body);
}
function TimedRun()
{
if (blnPending) RunFromBody();
}
function Refresh()
{
if (!blnPending)
{
blnPending = true;
window.setTimeout(TimedRun, 1000);
}
}
var blnPending = true;
if (true)
{
if (window["YAHOO"] && YAHOO.Btv && YAHOO.Btv.Runtime && YAHOO.Btv.Runtime.RegisterOnInit)
{
YAHOO.Btv.Runtime.RegisterOnInit(RunFromBody);
}
else
{
window.setTimeout(RunFromBody, 100);
}
} 
}
Run();
})();
