
if(typeof(zodEntityLoaded)=="undefined")
{var zodEntityLoaded=false;}
var zodWidgetsUriAuthority=getZodWidgetsUriAuthority()+'/';var zodBackgroundImage='infusion.png';var zodInfusionIE6=false;var zodInfusionIE7=false;if(document.all&&!window.opera&&window.XMLHttpRequest)
{zodInfusionIE7=true;}
if(navigator.appName=='Microsoft Internet Explorer'&&parseInt(navigator.appVersion)<=6&&!zodInfusionIE7)
{zodBackgroundImage='infusion.gif';zodInfusionIE6=true;}
var zodInfuser=getZodInfuser(zodContentEnhancementQuery,'zodInfuser');if(!isUndefinedOrNull(zodContentEnhancementQuery))
{zodContentEnhancementQuery.infuser=zodInfuser;}
var zodContentEnhancer=new ZodContentEnhancer(zodContentEnhancementQuery);function getZodInfuser(contentEnhancementQuery,instanceVariableName)
{if(isUndefinedOrNull(contentEnhancementQuery)||isUndefinedOrNull(contentEnhancementQuery.infuseRequest))
{return null;}
else
{var infuseRequest=contentEnhancementQuery.infuseRequest;var zodInfuser=new ZodInfuser(instanceVariableName);if(infuseRequest.excludeTags instanceof Array)
{for(var excludeTagIndex=0;excludeTagIndex<infuseRequest.excludeTags.length;excludeTagIndex++)
{zodInfuser.ExcludeTag(infuseRequest.excludeTags[excludeTagIndex]);}}
if(!isUndefinedOrNull(infuseRequest.rightHardline))
{zodInfuser.rightHardline=infuseRequest.rightHardline;}
if(!isUndefinedOrNull(infuseRequest.topHardline))
{zodInfuser.topHardline=infuseRequest.topHardline;}
if(!isUndefinedOrNull(infuseRequest.version))
{zodInfuser.version=infuseRequest.version;}
if(!isUndefinedOrNull(infuseRequest.urlGenerator))
{zodInfuser.SetUrlGenerator(infuseRequest.urlGenerator);}
if(zodInfuser.version==1)
{if(!isUndefinedOrNull(infuseRequest.disambiguationEnabled))
{if(infuseRequest.disambiguationEnabled)
{zodInfuser.popupBehaviour="Ambiguous";}
else
{ZodInfuser.popupBehaviour="Never";}}
if(!isUndefinedOrNull(infuseRequest.disambiguateDeeper))
{zodInfuser.additionalDisambiguationContent=infuseRequest.disambiguateDeeper;}}
else
{if(!isUndefinedOrNull(infuseRequest.popUp))
{if(infuseRequest.popUp.toLowerCase()=="always"||infuseRequest.popUp.toLowerCase()=="ambiguous"||infuseRequest.popUp.toLowerCase()=="never")
{zodInfuser.popUpBehaviour=infuseRequest.popUp;}}
if(!isUndefinedOrNull(infuseRequest.popUpDelay))
{if(infuseRequest.popUpDelay.toLowerCase()=="click-only")
{zodInfuser.popUpDelay=-1;}
else
{zodInfuser.popUpDelay=infuseRequest.popUpDelay;}}
if(!isUndefinedOrNull(infuseRequest.popUpTitle))
{zodInfuser.popUpTitle=infuseRequest.popUpTitle;}
if(!isUndefinedOrNull(infuseRequest.popUpMaxEntries))
{zodInfuser.popUpMaxEntries=infuseRequest.popUpMaxEntries;}
if(!isUndefinedOrNull(infuseRequest.infusionType))
{zodInfuser.infusionType=infuseRequest.infusionType;}
if(!isUndefinedOrNull(infuseRequest.infuseInstances))
{if(typeof(infuseRequest.infuseInstances)!="number"&&infuseRequest.infuseInstances.toLowerCase()=="all")
{zodInfuser.infuseInstances=-1;zodInfuser.infusionType="Keyword";}
else
{zodInfuser.infuseInstances=infuseRequest.infuseInstances;}}
if(!isUndefinedOrNull(infuseRequest.existingLinkBehaviour))
{if(infuseRequest.existingLinkBehaviour.toLowerCase()!="replace")
{zodInfuser.ExcludeTag("a");}
zodInfuser.existingLinkBehaviour=infuseRequest.existingLinkBehaviour;}
else
{zodInfuser.ExcludeTag("a");}
if(!isUndefinedOrNull(infuseRequest.caseInsensitive))
{zodInfuser.caseInsensitive=infuseRequest.caseInsensitive;}
if(!isUndefinedOrNull(infuseRequest.additionalDisambiguationContent))
{zodInfuser.additionalDisambiguationContent=infuseRequest.additionalDisambiguationContent;}}
return zodInfuser;}}
function getZodWidgetsUriAuthority()
{var scriptElementSource;var relatedSearchUrlBase;var urlBaseEndPosition=-1;var scriptElements=document.getElementsByTagName('script');for(var zodScriptIndex=0;zodScriptIndex<scriptElements.length;zodScriptIndex++)
{scriptElementSource=scriptElements[zodScriptIndex].getAttribute('src');if(scriptElementSource!=null)
{urlBaseEndPosition=scriptElementSource.indexOf('zibb.com/js/contentEnhancement.js');if(urlBaseEndPosition!=-1)
{relatedSearchUrlBase=scriptElementSource.substr(0,urlBaseEndPosition);break;}}}
if(urlBaseEndPosition==-1)
{return'';}
else
{return relatedSearchUrlBase+'zibb.com';}}
function isUndefinedOrNull(value)
{return(value==undefined||value==null);}
function getZodUrlEncoded(value)
{return encodeURIComponent(value).replace(/\'/g,'%39');}
function zodJump(url)
{var randomNumber=(new Date()).getTime()+'.'+Math.floor(Math.random()*1000);if(url.indexOf('?')==-1)
{url+='?';}
else if(url.length>0&&url.substr(url.length-1,1)!='&')
{url+='&';}
url+='ets='+randomNumber;var beacon=new Image();beacon.src=url;return true;}
function ZodContentEnhancer(contentEnhancementQuery)
{this.contentEnhancementQuery=contentEnhancementQuery;this.initialize=initialize;this.enhance=enhance;this.getZodContentEnhancementScriptUrl=getZodContentEnhancementScriptUrl;this.getZodMetaRbUniqueId1Value=getZodMetaRbUniqueId1Value;this.getZodMetaRbPubIdValue=getZodMetaRbPubIdValue;if(isUndefinedOrNull(this.contentEnhancementQuery.seo)||this.contentEnhancementQuery.seo==false)
{this.initialize();}
this.enhance();function initialize()
{if(this.contentEnhancementQuery!=null)
{var scriptUrl=this.getZodContentEnhancementScriptUrl();var metaRbUniqueId1Value=this.getZodMetaRbUniqueId1Value();var metaRbPubIdValue=this.getZodMetaRbPubIdValue();if(metaRbUniqueId1Value!=null)
{scriptUrl+='?dit=id&di='+encodeURIComponent(metaRbUniqueId1Value);}
else
{scriptUrl+='?dit=url&di='+encodeURIComponent(window.location);}
if(metaRbPubIdValue!=null)
{scriptUrl+='&p='+encodeURIComponent(metaRbPubIdValue);}
if(!isUndefinedOrNull(this.contentEnhancementQuery.relatedRequests)&&this.contentEnhancementQuery.relatedRequests instanceof Array)
{scriptUrl+='&rc='+this.contentEnhancementQuery.relatedRequests.length;for(var relatedRequestIndex=0;relatedRequestIndex<this.contentEnhancementQuery.relatedRequests.length;relatedRequestIndex++)
{var relatedRequest=this.contentEnhancementQuery.relatedRequests[relatedRequestIndex];if(!isUndefinedOrNull(relatedRequest.requestId))
{scriptUrl+='&ri'+relatedRequestIndex+'='+encodeURIComponent(relatedRequest.requestId);}
if('queryLanguage'in relatedRequest&&relatedRequest.queryLanguage.length==2)
{scriptUrl+='&ql'+relatedRequestIndex+'='+encodeURIComponent(relatedRequest.queryLanguage);}
switch(relatedRequest.mode)
{case'DocumentVectors':case'GlobalTopics':case'LocalTopics':scriptUrl+='&rm'+relatedRequestIndex+'='+relatedRequest.mode;break;case'Search':scriptUrl+='&rm'+relatedRequestIndex+'='+relatedRequest.mode;if(relatedRequest.searchText==undefined||relatedRequest.searchText==null)
{relatedRequest.searchText='';}
scriptUrl+='&q'+relatedRequestIndex+'='+encodeURIComponent(relatedRequest.searchText);break;}
if(!isUndefinedOrNull(relatedRequest.filters))
{if(!isUndefinedOrNull(relatedRequest.filters.industry)&&relatedRequest.filters.industry!='All')
{scriptUrl+='&i'+relatedRequestIndex+'='+encodeURIComponent(relatedRequest.filters.industry);}
if(!isUndefinedOrNull(relatedRequest.filters.bucketType)&&relatedRequest.filters.bucketType!='All')
{scriptUrl+='&b'+relatedRequestIndex+'='+encodeURIComponent(relatedRequest.filters.bucketType);}
switch(relatedRequest.filters.domainType)
{case'OnlyMyDomain':case'ExcludeMyDomain':scriptUrl+='&dt'+relatedRequestIndex+'='+relatedRequest.filters.domainType;break;}
if(!isUndefinedOrNull(relatedRequest.filters.customFilter)&&relatedRequest.filters.customFilter.length>0)
{scriptUrl+='&f'+relatedRequestIndex+'='+relatedRequest.filters.customFilter;}}
if(!isUndefinedOrNull(relatedRequest.hits)&&!isNaN(relatedRequest.hits))
{scriptUrl+='&h'+relatedRequestIndex+'='+relatedRequest.hits;}
if(!isUndefinedOrNull(relatedRequest.offset)&&!isNaN(relatedRequest.offset))
{scriptUrl+='&o'+relatedRequestIndex+'='+relatedRequest.offset;}
if(!isUndefinedOrNull(relatedRequest.minimumHits)&&!isNaN(relatedRequest.minimumHits))
{scriptUrl+='&mh'+relatedRequestIndex+'='+relatedRequest.minimumHits;}
if(!isUndefinedOrNull(relatedRequest.collapse))
{switch(relatedRequest.collapse.mode)
{case'Disabled':case'Domain':scriptUrl+='&scm'+relatedRequestIndex+'='+relatedRequest.collapse.mode;break;}}
if(relatedRequest.highlighted)
{scriptUrl+='&hi'+relatedRequestIndex+'=true';}
switch(relatedRequest.sortBy)
{case'Date':case'Relevance':case'Both':scriptUrl+='&s'+relatedRequestIndex+'='+relatedRequest.sortBy;break;}
if(!isUndefinedOrNull(relatedRequest.timeframe)&&!isNaN(relatedRequest.timeframe))
{scriptUrl+='&tf'+relatedRequestIndex+'='+relatedRequest.timeframe;}
if(relatedRequest.fieldCollapsed)
{scriptUrl+='&fc'+relatedRequestIndex+'=true';}
if(!isUndefinedOrNull(relatedRequest.fieldCollapseKeep)&&!isNaN(relatedRequest.fieldCollapseKeep))
{scriptUrl+='&fck'+relatedRequestIndex+'='+relatedRequest.fieldCollapseKeep;}
if(!isUndefinedOrNull(relatedRequest.resultView))
{scriptUrl+='&rv'+relatedRequestIndex+'='+relatedRequest.resultView;}}}
if(!isUndefinedOrNull(this.contentEnhancementQuery.key))
{scriptUrl+='&k='+encodeURIComponent(this.contentEnhancementQuery.key);}
if(!isUndefinedOrNull(this.contentEnhancementQuery.semanticsOutput))
{if(this.contentEnhancementQuery.semanticsOutput.globalTopics)
{scriptUrl+='&so=gt';}
if(this.contentEnhancementQuery.semanticsOutput.localTopics)
{scriptUrl+='&so=lt';}
if(this.contentEnhancementQuery.semanticsOutput.entityVariants)
{scriptUrl+='&so=ev';}
if(this.contentEnhancementQuery.semanticsOutput.documentVectors)
{scriptUrl+='&so=dv';}}
if(!isUndefinedOrNull(this.contentEnhancementQuery.infuseRequest))
{if(scriptUrl.indexOf('&so=ev')==-1)
{scriptUrl+='&so=ev';}}
if(this.contentEnhancementQuery.searchTarget)
{{scriptUrl+='&st='+encodeURIComponent(this.contentEnhancementQuery.searchTarget);}}
if(this.contentEnhancementQuery.trace)
{var spanElement=document.createElement('span');spanElement.innerHTML=scriptUrl;document.documentElement.appendChild(spanElement);scriptUrl+='&alert=true';}
scriptUrl+='&ets='+Math.floor((new Date()).getTime()/1000)+'.'+Math.floor(Math.random()*10000000);var scriptElement=document.createElement('script');scriptElement.setAttribute('language','JavaScript');scriptElement.setAttribute('type','text/javascript');scriptElement.setAttribute('src',scriptUrl);var headElements=document.getElementsByTagName('head');if(headElements.length>0)
{headElements[0].appendChild(scriptElement);}}}
function getZodContentEnhancementScriptUrl()
{return getZodWidgetsUriAuthority()+'/ContentEnhancement.aspx';}
function getZodMetaRbUniqueId1Value()
{var metaElementName=null;var metaElements=document.getElementsByTagName('meta');for(var metaIndex=0;metaIndex<metaElements.length;metaIndex++)
{metaElementName=metaElements[metaIndex].getAttribute('name');if(metaElementName!=null&&metaElementName.toLowerCase()=="rbuniqueid1")
{if(metaElements[metaIndex]!=null)
{return metaElements[metaIndex].getAttribute('content');}}}
return null;}
function getZodMetaRbPubIdValue()
{var metaElementName=null;var metaElements=document.getElementsByTagName('meta');for(var metaIndex=0;metaIndex<metaElements.length;metaIndex++)
{metaElementName=metaElements[metaIndex].getAttribute('name');if(metaElementName!=null&&metaElementName.toLowerCase()=="rbpubid")
{if(metaElements[metaIndex]!=null)
{return metaElements[metaIndex].getAttribute('content');}}}
return null;}
function enhance()
{if(!isUndefinedOrNull(this.contentEnhancementQuery)&&!isUndefinedOrNull(this.contentEnhancementQuery.infuser))
{var scriptElementYahoo=document.createElement('script');scriptElementYahoo.setAttribute('language','JavaScript');scriptElementYahoo.setAttribute('type','text/javascript');scriptElementYahoo.setAttribute('src',"http://yui.yahooapis.com/2.5.1/build/yahoo-dom-event/yahoo-dom-event.js");var headElements=document.getElementsByTagName('head');if(headElements.length>0)
{headElements[0].appendChild(scriptElementYahoo);}
this.contentEnhancementQuery.infuser.Infuse();}}}
function ZodInfuser(myname)
{this.Infuse=Infuse;this.Disambiguate=Disambiguate;this.SetUrlGenerator=SetUrlGenerator;this.ExcludeTag=ExcludeTag;this.MouseOver=MouseOver;this.MouseOut=MouseOut;this.DelayedDisambiguate=DelayedDisambiguate;this.FillDescriptions=FillDescriptions;this.IterateDOM=IterateDOM;this.InfuseTextNode=InfuseTextNode;this.GeneratePopup=GeneratePopup;this.RemoveOccurancesOfEntityId=RemoveOccurancesOfEntityId;this.Name=myname;this.URLGenerator=DefaultGenerator;this.ExcludedTags=new Array("script","iframe","input","textarea","select");this.getJavaScriptBeaconCall=getJavaScriptBeaconCall;this.popUpBehaviour="Ambiguous";this.infuseInstances=1;this.existingLinkBehaviour="Ignore";this.additionalDisambiguationContent=true;this.caseInsensitive=true;this.infusionType="Entity";this.rightHardline=600;this.topHardline=0;this.popUpDelay=-1;this.popUpTitle="";this.popUpMaxEntries=10;this.waitingElementId;this.waitingTimeoutId;this.timeSinceLastUiUpdate;function ExcludeTag(tagName)
{this.ExcludedTags.push(tagName);}
function MouseOver(elementId)
{if(this.popupDelay>=0)
{this.waitingElementId=elementId
this.waitingTimeoutId=setTimeout(this.Name+'.DelayedDisambiguate();',this.popupDelay);}
return true;}
function MouseOut(elementId)
{if(this.popupDelay>=0)
{if(this.waitingElementId==elementId)
{clearTimeout(this.waitingTimeoutId);this.waitingElementId=null;}
else
{alert('mouseout for wrong element, expecting '+this.waitingElementId+' got '+elementId);}}
return true;}
function DefaultGenerator(entityTypeID,sourceId,displayName,landingPageId)
{var retVal="http://";switch(landingPageId)
{case"1":retVal=retVal+"www.variety.com/profiles/Company/main/"+encodeURIComponent(sourceId)+"/"+encodeURIComponent(displayName)+".html?dataSet=1";break;case"4":retVal=retVal+"www.variety.com/profiles/TVSeries/main/"+encodeURIComponent(sourceId)+"/"+encodeURIComponent(displayName)+".html?dataSet=1";break;case"3":retVal=retVal+"www.variety.com/profiles/Film/main/"+encodeURIComponent(sourceId)+"/"+encodeURIComponent(displayName)+".html?dataSet=1";break;case"2":retVal=retVal+"www.variety.com/profiles/people/main/"+encodeURIComponent(sourceId)+"/"+encodeURIComponent(displayName)+".html?dataSet=1";break;case"5":retVal=retVal+"www.zibb.com/all/theme/cq/"+encodeURIComponent(displayName);break;default:}
return retVal;}
function SetUrlGenerator(func)
{this.URLGenerator=func;}
function ArrayContains(array,value)
{for(var i=0;i<array.length;i++)
{if(value.toLowerCase()==array[i].toLowerCase())
{return true;}}
return false;}
function DelayedDisambiguate()
{if(this.waitingElementId!=null)
{Disambiguate(document.getElementById(this.waitingElementId));}}
function FillDescriptions(variantName)
{this.Disambiguate(document.getElementById("a_"+variantName));}
function Disambiguate(aTag)
{var nameBase=aTag.id.replace(/a_/,"");nameBase=nameBase.replace(/_id-?\d+/,"");var popup=document.getElementById("popup_"+nameBase);var ul=document.getElementById("ul_"+nameBase);var header=document.getElementById("header_"+nameBase);var close=document.getElementById("close_"+nameBase);var top=document.getElementById("top_"+nameBase);var left=document.getElementById("left_"+nameBase);var right=document.getElementById("right_"+nameBase);var bottom=document.getElementById("bottom_"+nameBase);var pointer=document.getElementById("point_"+nameBase);var leftBackgroundPosition=ul.offsetHeight-492+25;left.style.cssText="background-image: url("+zodWidgetsUriAuthority+"images/"+zodBackgroundImage+"); background-position: 0px "+leftBackgroundPosition.toString()+"px; height: "+(ul.offsetHeight+25)+"px; width: 25px; position: absolute; top: 25px; left: 0px;";right.style.cssText="background-image: url("+zodWidgetsUriAuthority+"images/"+zodBackgroundImage+");background-position: -529px 0px; height: "+(ul.offsetHeight+25)+"px; width: 25px; position: absolute; left: 243px; top: 0px;";bottom.style.cssText="background-image: url("+zodWidgetsUriAuthority+"images/"+zodBackgroundImage+"); background-position: -311px -467px; height: 25px; width: 243px; position: absolute; top: "+(ul.offsetHeight+25)+"px; left: 25px;";var popupTop="";var popupLeft="";var pointerBackgroundPos="";var pointerTop="";var pointerLeft="";var linkYPosition=YAHOO.util.Dom.getY(aTag);var linkXPosition=YAHOO.util.Dom.getX(aTag);if((ul.offsetHeight+25)>linkYPosition-getScrollY()||linkYPosition-ul.offsetHeight-25<this.topHardline)
{popupTop=linkYPosition+20;pointerBackgroundPos="-40px -328px";pointerTop="-6";}
else
{popupTop=linkYPosition-ul.offsetHeight-aTag.offsetHeight-40;pointerBackgroundPos="-40px -399px";pointerTop=ul.offsetHeight+40;}
if(linkXPosition>this.rightHardline)
{popupLeft=linkXPosition-ul.offsetWidth+30;pointerLeft=ul.offsetWidth-30;}
else
{popupLeft=linkXPosition;pointerLeft="40"}
popup.style.cssText="position:absolute;left:"+popupLeft+"px;top:"+popupTop+"px;";pointer.style.cssText="background-image: url("+zodWidgetsUriAuthority+"images/"+zodBackgroundImage+"); background-position: "+pointerBackgroundPos+"; top: "+pointerTop+"px; left: "+pointerLeft+"px; height: 15px; width: 40px; position: absolute;";}
function getRealPos(element,direction)
{(direction=="x")?pos=element.offsetLeft:pos=element.offsetTop;if(direction!="x")
{tempEle=element.offsetParent;while(tempEle!=null)
{pos+=(direction=="x")?tempEle.offsetLeft:tempEle.offsetTop;tempEle=tempEle.offsetParent;}}
return pos;}
function getScrollY()
{if(window.pageYOffset!=null)
{return window.pageYOffset;}
else
{if(document.documentElement.scrollTop>0)
{return document.documentElement.scrollTop;}
return document.body.scrollTop;}}
function IterateDOM(parent,inherit)
{var infuse=inherit;if(ArrayContains(this.ExcludedTags,parent.nodeName))
{return;}
if(parent.className!=undefined&&parent.className.indexOf("infuse")>-1)
{infuse=true;}
if(parent.className!=undefined&&parent.className.indexOf("noinfuse")>-1)
{infuse=false;}
for(var i=0;i<parent.childNodes.length;i++)
{if(parent.childNodes[i]!=null&&parent.childNodes[i].className!="infusionLink"&&parent.childNodes[i].className!="infusionPopup")
{if(parent.childNodes[i].nodeType==1)
{this.IterateDOM(parent.childNodes[i],infuse);}
else if(parent.childNodes[i].nodeType==3&&infuse&&parent.childNodes[i].nodeValue.search(/\S/i)>-1)
{this.InfuseTextNode(parent.childNodes[i],parent);}}}}
function getJavaScriptBeaconCall(entity)
{var tag='InfusionJS';if(arguments.length>1)
{tag=arguments[1];}
return'zodJump(\''+
zodWidgetsUriAuthority+'images/_jump.gif?tag='+tag+"&url="+getZodUrlEncoded(this.URLGenerator(entity["entityTypeId"],entity["localId"],entity["displayName"],entity["landingPageId"]))+"&gsid="+entity["globalSemanticId"]+"&entitytypeid="+entity["entityTypeId"]+
(isUndefinedOrNull(entity["localId"])?"":"&lid="+entity["localId"])+
(isUndefinedOrNull(entity["displayName"])?"":"&title="+getZodUrlEncoded(entity["displayName"]))+
(isUndefinedOrNull(entity["description"])?"":"&description="+getZodUrlEncoded(entity["description"]))+"&zodid="+zodClientId+'\')';}
function InfuseTextNode(textNode,parentNode)
{var str=textNode.nodeValue;for(var j=0;j<zodEntities.length;j++)
{if(zodEntities[j]["entities"].length==0)
{continue;}
if(this.popUpBehaviour=="Never"&&zodEntities[j]["entities"].length>1)
{continue;}
var searchString="/\\b"+zodEntities[j]["variant"].replace("/","\\/")+"\\b/m";if(zodEntities[j]["variant"].search(/"/)==0)
{searchString="/"+zodEntities[j]["variant"].replace("/","\\/").replace(/^"/,"\"\\b").replace(/\.?"$/,"\\b.?\"")+"/m";}
if(this.caseInsensitive)
{searchString=searchString+"i";}
var offset=str.search(eval(searchString));if(offset>-1)
{var nameEntry=zodEntities[j];var entitySet=nameEntry["entities"];var variantName=nameEntry["variant"];var splitStr=new Array();var strToSplit=" "+str+" ";splitStr=strToSplit.split("\"");if(splitStr.length%2==0&&splitStr.length>1)
{continue;}
if(nameEntry["infusedCount"]==undefined)
{nameEntry["infusedCount"]=this.infuseInstances-1;}
else
{nameEntry["infusedCount"]=nameEntry["infusedCount"]-1;}
if(nameEntry["infusedCount"]==0)
{zodEntities.splice(j,1);}
var anchor=document.createElement("a");if(entitySet.length==1&&this.popUpBehaviour.toLowerCase()!="always")
{anchor.setAttribute("href",this.URLGenerator(entitySet[0]["entityTypeId"],entitySet[0]["localId"],entitySet[0]["displayName"],entitySet[0]["landingPageId"]));anchor.setAttribute("alt",entitySet[0]["displayName"]);anchor.setAttribute('omd',this.getJavaScriptBeaconCall(entitySet[0]));anchor.onmousedown=function(){eval(this.getAttribute('omd'))};anchor.className="infusionLink";if(this.infusionType.toLowerCase()!="keyword")
{this.RemoveOccurancesOfEntityId(entitySet[0]["globalSemanticId"]);}}
else
{anchor.setAttribute("id","a_"+variantName+"_id"+nameEntry["infusedCount"]);anchor.setAttribute("alt","Please click for options");anchor.setAttribute("onclick","javascript:"+this.Name+".FillDescriptions('"+variantName+"_id"+nameEntry["infusedCount"]+"');return false;");anchor.setAttribute("href","javascript:"+this.Name+".FillDescriptions('"+variantName+"_id"+nameEntry["infusedCount"]+"');");anchor.setAttribute('omd',"zodJump('"+zodWidgetsUriAuthority+"images/_jump.gif?tag=InfusionDisambiguation&title="+getZodUrlEncoded(variantName)+"&zodid="+zodClientId+"')");anchor.onmousedown=function(){eval(this.getAttribute('omd'))};var ieFixMouseOver=this.Name+".MouseOver('a_"+variantName+"');";anchor.onmouseover=function(){eval(ieFixMouseOver);};var ieFixMouseOut=this.Name+".MouseOut('a_"+variantName+"');";anchor.onmouseout=function(){eval(ieFixMouseOut);};anchor.className="infusionLink";if(parentNode.nodeName.toLowerCase()=="a"&&this.existingLinkBehaviour.toLowerCase()=="popup")
{var popup=this.GeneratePopup(variantName,entitySet,parentNode);}
else
{var popup=this.GeneratePopup(variantName,entitySet);}
parentNode.parentNode.appendChild(popup);if(this.infusionType.toLowerCase()!="keyword")
{for(var i=0;i<entitySet.length;i++)
{this.RemoveOccurancesOfEntityId(entitySet[i]["globalSemanticId"]);}}}
anchor.appendChild(document.createTextNode(str.substring(offset,offset+variantName.length)));if(offset>0)
{if(parentNode.nodeName.toLowerCase()!="a")
{var preAnchor=document.createTextNode(str.substring(0,offset));parentNode.insertBefore(preAnchor,textNode);}
else
{var preAnchor=parentNode.cloneNode(false);if(preAnchor.id!=null)
{preAnchor.id=preAnchor.id+"_preinfusion";}
preAnchor.appendChild(document.createTextNode(str.substring(0,offset)));parentNode.parentNode.insertBefore(preAnchor,parentNode);}}
if(parentNode.nodeName.toLowerCase()!="a")
{parentNode.insertBefore(anchor,textNode);}
else
{parentNode.parentNode.insertBefore(anchor,parentNode);}
if(offset+variantName.length<str.length)
{if(parentNode.nodeName.toLowerCase()!="a")
{var postAnchor=document.createTextNode(str.substring(offset+variantName.length,str.length));parentNode.insertBefore(postAnchor,textNode);}
else
{var postAnchor=parentNode.cloneNode(false);if(postAnchor.id!=null)
{postAnchor.id=postAnchor.id+"_postinfusion";}
postAnchor.appendChild(document.createTextNode(str.substring(offset+variantName.length,str.length)));parentNode.parentNode.insertBefore(postAnchor,parentNode);}}
if(parentNode.nodeName.toLowerCase()!="a")
{parentNode.removeChild(textNode);}
else
{var grandParent=parentNode.parentNode;grandParent.removeChild(parentNode);parentNode=grandParent;}
if(preAnchor!=undefined)
{if(preAnchor.nodeType==1)
{this.IterateDOM(preAnchor,true);}
else
{this.InfuseTextNode(preAnchor,parentNode);}}
if(postAnchor!=undefined)
{if(postAnchor.nodeType==1)
{this.IterateDOM(postAnchor,true);}
else
{this.InfuseTextNode(postAnchor,parentNode);}}
return true;}}}
function RemoveOccurancesOfEntityId(globalSemanticID)
{for(var i=0;i<zodEntities.length;i++)
{for(var j=0;j<zodEntities[i]["entities"].length;j++)
{var thisGlobalID=zodEntities[i]["entities"][j]["globalSemanticId"];if(thisGlobalID==globalSemanticID)
{zodEntities.splice(i,1);break;}}}}
function GeneratePopup(variantName,entitySet)
{var popup=document.createElement("div");popup.style.cssText="position:absolute;left:-200em;top:-200em;";popup.setAttribute("id","popup_"+variantName);popup.className="infusionPopup";var header=document.createElement("div");header.style.cssText="position: absolute; left: 20px; background-color: #FFFFFF; top: 13px; padding-left:4px; width: 228px; height: 20px; z-index: 1;font-weight:bold;";header.setAttribute("id","header_"+variantName);header.appendChild(document.createTextNode(this.popUpTitle));header.className="infusionPopupHeader";popup.appendChild(header);var close=document.createElement("div");close.style.cssText='overflow: hidden; background-image: url('+zodWidgetsUriAuthority+'images/'+zodBackgroundImage+'); background-position: -95px -398px; position: absolute; left: 239px; top: 18px; width: 11px; height: 11px; cursor: pointer; z-index: 5;" title="Close" onclick="this.parentNode.style.left = \'-100em\';"';close.setAttribute("title","Close");close.onclick=function(){this.parentNode.style.left='-100em';};close.setAttribute("id","close_"+variantName);popup.appendChild(close);var top=document.createElement("div");top.style.cssText="background-image: url("+zodWidgetsUriAuthority+"images/"+zodBackgroundImage+"); height: 25px; width: 243px; position: absolute; top: 0px; left: 0px; background-position-x: 0px";top.setAttribute("id","top_"+variantName);popup.appendChild(top);var right=document.createElement("div");right.style.cssText="background-image: url("+zodWidgetsUriAuthority+"images/"+zodBackgroundImage+");background-position: -529px 0px; height: 100px; width: 25px; position: absolute; left: 243px; top: 0px;";right.setAttribute("id","right_"+variantName);popup.appendChild(right);var left=document.createElement("div");left.style.cssText="background-image: url("+zodWidgetsUriAuthority+"images/"+zodBackgroundImage+"); background-position: 0px -379px; height: 100px; width: 25px; position: absolute; top: 25px; left: 0px;";left.setAttribute("id","left_"+variantName);popup.appendChild(left);var bottom=document.createElement("div");bottom.style.cssText="background-image: url("+zodWidgetsUriAuthority+"images/"+zodBackgroundImage+"); background-position: -311px -467px; height: 25px; width: 243px; position: absolute; top: 100px; left: 25px;";bottom.setAttribute("id","bottom_"+variantName);popup.appendChild(bottom);var point=document.createElement("div");if(zodInfusionIE6)
{point.style.cssText="background-image: url("+zodWidgetsUriAuthority+"images/"+zodBackgroundImage+"); background-position: -40px -328px; top: -8px; left: 40px; height: 15px; width: 40px; position: absolute;";}
else
{point.style.cssText="background-image: url("+zodWidgetsUriAuthority+"images/"+zodBackgroundImage+"); background-position: -40px -328px; top: -6px; left: 40px; height: 15px; width: 40px; position: absolute;";}
point.setAttribute("id","point_"+variantName);popup.appendChild(point);var con=document.createElement("div");con.style.cssText="overflow:hidden;";var ul=document.createElement("ul");ul.style.cssText="position:absolute; top:15px;left: 23px; width:228px;padding:4px;margin-left:0px;margin-top:15px;list-style:none;background-color:white;";ul.setAttribute("id","ul_"+variantName);entitySet.sort(function(a,b)
{var x=Math.pow(2,10);var y=x;if(!isUndefinedOrNull(a["sortOrder"]))
{x=parseInt(a["sortOrder"]);}
if(!isUndefinedOrNull(b["sortOrder"]))
{y=parseInt(b["sortOrder"]);}
return((x<y)?-1:((x>y)?1:0));});for(var k=0;k<entitySet.length&&k<this.popUpMaxEntries;k++)
{var li=document.createElement("li");var liA=document.createElement("a");liA.setAttribute("href",this.URLGenerator(entitySet[k]["entityTypeId"],entitySet[k]["localId"],entitySet[k]["displayName"],entitySet[k]["landingPageId"]));liA.setAttribute("alt",entitySet[k]["displayName"]);liA.setAttribute('omd',this.getJavaScriptBeaconCall(entitySet[k],'InfusionJSPP'));liA.onmousedown=function(){eval(this.getAttribute('omd'))};switch(entitySet[k]["entityTypeId"])
{case"11":liA.appendChild(document.createTextNode("(Co) "+entitySet[k]["displayName"]));break;case"14":liA.appendChild(document.createTextNode("(Tv) "+entitySet[k]["displayName"]));break;case"15":liA.appendChild(document.createTextNode("(Film) "+entitySet[k]["displayName"]));break;case"16":liA.appendChild(document.createTextNode("(Person) "+entitySet[k]["displayName"]));break;default:liA.appendChild(document.createTextNode(entitySet[k]["displayName"]));}
li.appendChild(liA);if(this.additionalDisambiguationContent&&entitySet[k]["description"]!=null)
{var liDiv=document.createElement("div");liDiv.setAttribute("id","li_"+variantName+"_"+k);liDiv.className="disambig_desc";liDiv.appendChild(document.createTextNode(entitySet[k]["description"]));li.appendChild(liDiv);}
ul.appendChild(li);}
if(arguments.length==3&&this.existingLinkBehaviour.toLowerCase()=="popup")
{var li=document.createElement("li");var liA=arguments[2].cloneNode(true);li.appendChild(liA);ul.appendChild(li);}
con.appendChild(ul);popup.appendChild(con);return popup;}
function Infuse()
{if(zodEntityLoaded)
{zodEntities.sort(function(a,b){return((a.variant.length>b.variant.length)?-1:((a.variant.length<b.variant.length)?1:0));});this.timeSinceLastUiUpdate=new Date().getTime();this.IterateDOM(document.body,false);}
else
{setTimeout(this.Name+".Infuse()",200);}}}