// widgetloader / MediaRiver, Inc. // Script Generated At: Fri, 03 Jul 2009 01:05:42 GMT // Library TTL = 525600 // Expires: Sat, 03 Jul 2010 01:05:42 GMT // Library script: library-2.0a_Obfs if(window.epals_forums_v5_1_watsonLogQueue==null){var epals_forums_v5_1_watsonLogQueue=new Array();}if(window.epals_forums_v5_1_library_ap==null){var epals_forums_v5_1_library_ap=new Object();epals_forums_v5_1_library_ap.ax=new Array();epals_forums_v5_1_library_ap.hL=new Array();}if(epals_forums_v5_1_WatsonSource==null){var epals_forums_v5_1_WatsonSource=new Object();}epals_forums_v5_1_WatsonSource.initialize=function(){this.source=arguments[1];this.watsonSearch=arguments[0];this.watsonWebWidget=this.watsonSearch.watsonWebWidget;var gv=this.watsonWebWidget.al.fD();this.M=String(this.watsonSearch.getID()+"-"+this.source+"-"+gv);this.aF=this.watsonSearch.aF;this.U=this.watsonSearch.U;this.ad=this.watsonSearch.ad;this.queryTermArray=this.watsonSearch.queryTermArray;this.J=String();this.bB=String();this.json={};this.bf=new Object();this.bc=new Object();this.ak=this.watsonSearch.ak;this.resultsCallback=this.watsonSearch.resultsCallback;this.resultsCallbackArray=new Array();this.gO=this.watsonSearch.resultsCallback;this.aH=this.watsonSearch.aH;this.cn=this.watsonSearch.cn;this.ap=this.watsonSearch.ap;this.gS=this.watsonSearch.gS;this.hX=false;this.F=this.watsonSearch.F;this.K=new Object();this.hF=Number(1440);this.bT=this.watsonSearch.bT;this.aC=this.watsonSearch.aC;this.aX=this.watsonSearch.aX;this.gU=this.watsonSearch.gU;this.cp=String("");this.aS={};this.I=new Object();this.cf=new Object();this.hC=Boolean(false);this.hj=Boolean(true);};epals_forums_v5_1_WatsonSource.initialize.prototype.getParentWatsonSearch=function(){return this.watsonSearch;};epals_forums_v5_1_WatsonSource.initialize.prototype.getWatsonWebWidget=function(){return this.watsonWebWidget;};epals_forums_v5_1_WatsonSource.initialize.prototype.getContextSignatureHash=function(){if(!this.gU){this.gU=this.getParentWatsonSearch().getContextSignatureHash();}return this.gU;};epals_forums_v5_1_WatsonSource.initialize.prototype.setContextSignatureHash=function(){this.gU=arguments[0];};epals_forums_v5_1_WatsonSource.initialize.prototype.setResultContainer=function(){this.ak=arguments[0];};epals_forums_v5_1_WatsonSource.initialize.prototype.getResultContainer=function(){return this.ak;};epals_forums_v5_1_WatsonSource.initialize.prototype.setNumResults=function(){if(isNaN(arguments[0])==false&&arguments[0]>0){this.U=arguments[0];}};epals_forums_v5_1_WatsonSource.initialize.prototype.getNumResults=function(){return this.U;};epals_forums_v5_1_WatsonSource.initialize.prototype.setMaxQueryTerms=function(){if(isNaN(arguments[0])==false&&arguments[0]>0){this.aF=arguments[0];}};epals_forums_v5_1_WatsonSource.initialize.prototype.getMaxQueryTerms=function(){return this.aF;};epals_forums_v5_1_WatsonSource.initialize.prototype.setSource=function(){this.source=arguments[0];};epals_forums_v5_1_WatsonSource.initialize.prototype.getSource=function(){return this.source;};epals_forums_v5_1_WatsonSource.initialize.prototype.setID=function(){this.M=arguments[0];};epals_forums_v5_1_WatsonSource.initialize.prototype.getID=function(){return this.M;};epals_forums_v5_1_WatsonSource.initialize.prototype.getQueryString=function(){return this.J;};epals_forums_v5_1_WatsonSource.initialize.prototype.setQueryString=function(){this.J=arguments[0];};epals_forums_v5_1_WatsonSource.initialize.prototype.getJSONUrl=function(){return this.bB;};epals_forums_v5_1_WatsonSource.initialize.prototype.setJSONUrl=function(){this.bB=arguments[0];};epals_forums_v5_1_WatsonSource.initialize.prototype.getJSON=function(){return this.json;};epals_forums_v5_1_WatsonSource.initialize.prototype.setJSON=function(){this.json=arguments[0];};epals_forums_v5_1_WatsonSource.initialize.prototype.getTermWeightMap=function(){return this.K;};epals_forums_v5_1_WatsonSource.initialize.prototype.setTermWeightMap=function(){this.K=arguments[0];};epals_forums_v5_1_WatsonSource.initialize.prototype.setFastPathMode=function(){this.hX=arguments[0];};epals_forums_v5_1_WatsonSource.initialize.prototype.getFastPathMode=function(){return this.hX;};epals_forums_v5_1_WatsonSource.initialize.prototype.getSendContextSignatureWithProxyCalls=function(){return this.hj;};epals_forums_v5_1_WatsonSource.initialize.prototype.setSendContextSignatureWithProxyCalls=function(){this.hj=arguments[0];};epals_forums_v5_1_WatsonSource.initialize.prototype.prepend=function(){this.watsonWebWidget.al.dE(arguments[0],arguments[1],this.bf);};epals_forums_v5_1_WatsonSource.initialize.prototype.append=function(){this.watsonWebWidget.al.dE(arguments[0],arguments[1],this.bc);};epals_forums_v5_1_WatsonSource.initialize.prototype.setSearchTerms=function(){if(arguments[0]!=null&&arguments[0]!=""){this.queryTermArray=this.watsonWebWidget.al.bE(arguments[0]);var aC=true;var dB=true;if(arguments[1]!=null&&typeof(arguments[1])=="boolean"){aC=arguments[1];}if(arguments[2]!=null&&typeof(arguments[2])=="boolean"){dB=arguments[2];}this.bT=true;this.aC=aC;this.aX=dB;}};epals_forums_v5_1_WatsonSource.initialize.prototype.setParameter=function(){if(arguments[0]!=null){this.I["$"+arguments[0]]=arguments[1];}};epals_forums_v5_1_WatsonSource.initialize.prototype.getParameter=function(){if(arguments[0]!=null){return this.I["$"+arguments[0]];}return null;};epals_forums_v5_1_WatsonSource.initialize.prototype.setProperty=function(){if(arguments[0]!=null){this.cf["$"+arguments[0]]=arguments[1];}};epals_forums_v5_1_WatsonSource.initialize.prototype.getProperty=function(){if(arguments[0]!=null){return this.cf["$"+arguments[0]];}return null;};epals_forums_v5_1_WatsonSource.initialize.prototype.setStoplist=function(){this.aS=arguments[0];};epals_forums_v5_1_WatsonSource.initialize.prototype.addStopword=function(){if(arguments[0]!=null&&arguments[0]!=""){var bU=arguments[0].toLowerCase();if(arguments[1]!=null&&arguments[1]==true){bU=this.getWatsonWebWidget().cJ.cZ(bU);}this.aS["$"+bU]="";}};epals_forums_v5_1_WatsonSource.initialize.prototype.addStopwordArray=function(){if(arguments[0]!=null&&String(typeof(arguments[0]))=="object"){var cE=arguments[0];if(cE.length&&cE.length>0){for(var i=0;i=0){this.hF=arguments[0];}};epals_forums_v5_1_WatsonSource.initialize.prototype.setQueryCallback=function(){this.aH=arguments[0];};epals_forums_v5_1_WatsonSource.initialize.prototype.setResultsCallback=function(){this.resultsCallback=arguments[0];};epals_forums_v5_1_WatsonSource.initialize.prototype.addResultsCallback=function(){this.resultsCallbackArray.push(arguments[0]);};epals_forums_v5_1_WatsonSource.initialize.prototype.setJSONCallback=function(){this.cn=arguments[0];};epals_forums_v5_1_WatsonSource.initialize.prototype.setSearchCompleteCallback=function(){this.ap=arguments[0];};epals_forums_v5_1_WatsonSource.initialize.prototype.eJ=function(){var ff=new Array();for(var cX in this.K){if([].propertyIsEnumerable!=undefined&&this.K.propertyIsEnumerable(cX)==false){continue;}ff.push(cX);}var ao=this.watsonWebWidget.al.aq(ff,this.K);var gu=this.K;this.K=null;this.K=new Object();for(var i=0;i0){aU=eO.concat(aU);}var fa=new Array();for(var value in this.bc){if([].propertyIsEnumerable!=undefined&&this.bc.propertyIsEnumerable(value)==false){continue;}fa.push(value.substring(1));if(this.bc[value]==true){var eG=this.K[value];if(eG==null){var gb=aT[aT.length-1];this.K[value]=this.K["$"+gb];cd=true;}}}if(fa.length>0){aU=aU.concat(fa);}if(cd==true){this.eJ();}var fR=" ";if(this.cp!=null&&this.cp!=""&&this.cp!=" "){fR=" "+this.cp+" ";}this.J=aU.join(fR);if(this.aH!=null){try{eval(this.aH).call(this,this.J);}catch(e){epals_forums_v5_1_debugOutput("Exception calling query callback:\n\n"+e.message,3);}}var aB=new Object();aB.ev="query";aB.sid=this.source;aB.q=this.J;aB.x=String(this.U);epals_forums_v5_1_logeventEx(aB,true);this.eJ();var af=encodeURI(this.J);af=af.replace(/\&/g,"%26");this.bB=this.ad+"?query="+af+"&output=json&ttl="+this.getTTL()+"&r=";if(this.getSendContextSignatureWithProxyCalls()==true){if(this.getWatsonWebWidget().getIFrameSupportEnabled()&&this.getWatsonWebWidget().getInIFrame()){this.bB+=this.getWatsonWebWidget().getContextSignatureHash(null,false,this.getWatsonWebWidget().getDocumentURL(),true,false);}else{this.bB+=escape(this.getContextSignatureHash());}}this.bB+="¶meters=";var aa="";for(var aY in this.I){if([].propertyIsEnumerable!=undefined&&this.I.propertyIsEnumerable(aY)==false){continue;}var fh=encodeURI(aY.substring(1));fh=fh.replace(/\&/g,"%26");var fq=encodeURI(this.I[aY]);fq=fq.replace(/\&/g,"%26");aa+=fh+","+fq+",";}if(aa!=""){this.bB+=aa.substring(0,aa.length-1);}var eH=encodeURI(this.source);eH=eH.replace(/\&/g,"%26");this.bB+="&source="+eH+"&results="+this.U;this.bB+="&callback=epals_forums_v5_1_library_ap.ax["+bp+"].fV";this.bB+="&tw=";var maxLength=this.watsonWebWidget.getMaxJSONUrlLength();var bH=maxLength-this.bB.length;var cg=false;for(var cX in this.K){if([].propertyIsEnumerable!=undefined&&this.K.propertyIsEnumerable(cX)==false){continue;}if(isNaN(this.K[cX])==true){continue;}var gM=cX.substring(1);if(cX!=null&&cX!=""){var eY=encodeURI(gM);eY=eY.replace(/\&/g,"%26");var cQ=eY+","+this.K[cX]+",";if(cQ.length0){this.watsonSearch.dD-=1;}if(this.watsonSearch.dD==0&&this.watsonSearch.ap!=null&&this.watsonSearch.ap!=""&&this.hC!=true){try{var bZ=this.watsonSearch.ap;bZ.call(this.watsonSearch);}catch(e){try{bZ=eval(this.watsonSearch.ap);bZ.call(this.watsonSearch);}catch(aE){}}}this.hC=true;setTimeout(this.getWatsonWebWidget().fr,1);};epals_forums_v5_1_WatsonSource.initialize.prototype.gQ=function(fn){var fI=typeof(fn);if(fI!="function"&&fI!="string"){var gC=new epals_forums_v5_1_WatsonWebWidget.initialize("",true);this.resultsCallback=gC.resultsCallback;gC=null;}try{var bZ=fn;bZ.call(this,this.getJSON(),this.getResultContainer());}catch(e){try{bZ=eval(fn);bZ.call(this,this.getJSON(),this.getResultContainer());}catch(aE){epals_forums_v5_1_debugOutput("Watson Web Widget error:\n\nException calling "+"results callback function\n\n"+"Reason: "+aE.message,3);}}};if(epals_forums_v5_1_WatsonSearch==null){var epals_forums_v5_1_WatsonSearch=new Object();}epals_forums_v5_1_WatsonSearch.initialize=function(){this.watsonWebWidget=arguments[0];this.ad=this.watsonWebWidget.ad;this.ay=String(this.watsonWebWidget.Y);this.aF=this.watsonWebWidget.aF;this.U=this.watsonWebWidget.U;this.useShortQuery=this.watsonWebWidget.useShortQuery;this.aV=this.watsonWebWidget.aV;this.O=this.eT(arguments[0]);this.aH=null;this.resultsCallback=null;this.ap=null;this.cn=String();this.bf=new Object();this.bc=new Object();this.ak=String();var gv=this.watsonWebWidget.al.fD();this.F=String(gv);this.aC=Boolean(false);this.bT=Boolean(false);this.aX=Boolean(false);this.queryTermArray=new Array();this.K=new Object();this.aS={};this.cf=new Object();this.dD=Number(0);this.gU=null;this.gY=null;};epals_forums_v5_1_WatsonSearch.initialize.prototype.getWatsonWebWidget=function(){return this.watsonWebWidget;};epals_forums_v5_1_WatsonSearch.initialize.prototype.hc=function(){if(this.gY!=null){return this.gY;}var G=this.getWatsonWebWidget().Y;if(this.ay!=null&&this.ay!=""){G=this.ay;}if(this.getWatsonWebWidget().getIFrameSupportEnabled()&&this.getWatsonWebWidget().getInIFrame()){if(typeof(G)=="string"&&G.indexOf("document.")==0){if(G="document.body"){G=this.getWatsonWebWidget().getDocument().body;}else{G=G.substring(9);}}else if(typeof(G)=="object"&&G==document.body){G=this.getWatsonWebWidget().getDocument().body;}}var D=G;if(typeof(G)=="string"){D=this.getWatsonWebWidget().getDocument().getElementById(G);}if(D==null){try{D=eval(G);}catch(e){return null;}}this.gY=D;return D;};epals_forums_v5_1_WatsonSearch.initialize.prototype.getContextSignatureHash=function(){if(!this.gU){this.gU=this.getWatsonWebWidget().getContextSignatureHash(this.hc());}return this.gU;};epals_forums_v5_1_WatsonSearch.initialize.prototype.setContextSignatureHash=function(){this.gU=arguments[0];};epals_forums_v5_1_WatsonSearch.initialize.prototype.eT=function(){var watson=arguments[0];var cI=new Array();if(watson.aI.length>0){for(var i=0;i0){for(var i=0;i0&&document.referrer!=""){this.hQ=true;this.ia=document.referrer;}}catch(e){if(top!=self&&document.referrer!=""){this.hQ=true;this.ia=document.referrer;}}this.getDocumentContentsScriptURL=this.aK+"/getdocument/";this.gK=arguments[3];this.hV=1440;if(arguments[4]!=undefined&&isNaN(arguments[4])==false&&Number(arguments[4])>=0){this.hV=arguments[4];}this.getDocumentMaxResponseSizeK=150;if(arguments[5]!=undefined&&isNaN(arguments[5])==false&&Number(arguments[5])>=0){this.getDocumentMaxResponseSizeK=arguments[5];}this.showDocumentAnalysisStatistics=Boolean(false);this.useTermFrequencyQueryFormation=Boolean(false);this.removePagewiseDuplicateResults=Boolean(true);this.enableSelectedTextSupport=Boolean(false);this.dm=Boolean(true);this.H=new Array();this.U=Number(10);this.aF=Number(5);this.useShortQuery=Boolean(false);this.aV=Number(0.20);this.aM=String("div");this.aL=String("watson:Results");this.Y=String("document.body");this.aS=new epals_forums_v5_1_StopList.initialize("English");this.bn=new Array();this.bn.push(new epals_forums_v5_1_library_bf.initialize(this));this.ca=new epals_forums_v5_1_library_aX.initialize(this);this.bQ=new epals_forums_v5_1_library_aU.initialize(this);this.T=Number(5000);this.hs=3;this.eR=Number(2000);this.blnUseMultiplesInSpanWeightCalculation=Boolean(true);this.al=new epals_forums_v5_1_library_aC.initialize(this);this.cJ=new epals_forums_v5_1_library_by.initialize();this.aI=new Array();this.aD=new Array();this.fb=null;this.cf=new Object();this.eq=function(){};this.gR=Boolean(true);var hl=this.getDocumentURL();var ha=this.aK.indexOf("://")> -1;if((this.aK.indexOf("origin-")> -1&&this.aK.indexOf(".intellext.com")> -1)||(this.aK.indexOf("origin-")> -1&&this.aK.indexOf(".mediariver.com")> -1)||(ha==false&&(hl.indexOf("origin-")> -1&&hl.indexOf(".intellext.com")> -1))||(ha==false&&(hl.indexOf("origin-")> -1&&hl.indexOf(".mediariver.com")> -1))){this.gR=false;}this.cw=Number(0);this.ce=Boolean(true);this.gN=null;if(this.getIFrameSupportEnabled()==true&&this.getInIFrame()==true){this.ib();}};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.getInIFrame=function(){return this.hQ;};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.setInIFrame=function(){this.hQ=arguments[0];};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.getIFrameSupportEnabled=function(){return this.hJ;};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.setIFrameSupportEnabled=function(){this.hJ=arguments[0];};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.wait=function(iM){var iE=new Date();var ix=iE.getTime()+iM;while(true){iE=new Date();if(iE.getTime()>ix){return;}}};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.il=function(iB){var error=iB.Doc.Error;if(error){epals_forums_v5_1_debugOutput(error,3);if(this.gK){try{this.gK.call(this);}catch(e){epals_forums_v5_1_debugOutput("Exception calling document complete callback:\n\n"+e,3);}}return;}var hO=iB.Doc.Payload;if(hO){var iC=new RegExp(/[\s\S]*/gim);if(iC.test(hO)==false&&iI.test(hO)==true){if(this.gK){try{this.gK.call(this);}catch(e){epals_forums_v5_1_debugOutput("Exception calling document complete callback:\n\n"+e,3);}}return;}var iO=new RegExp(/[\s\S]*([\s\S]*<\/body>)[\s\S]*/gmi);var iN=iO.exec(hO);if(iN&&iN.length>1&&iN[1]!=""){hO=iN[1];}this.dv=document.createElement("iframe");this.dv.id="CS_Referrer_IFrame";this.dv.setAttribute("name","CS_Referrer_IFrame");this.dv.style.visibility="hidden";this.dv.style.display="none";this.dv.style.width="0px";this.dv.style.height="0px";this.dv.style.border="0px";this.dv.frameBorder=0;var hm=this;function hW(){var dT=true;var iK=hm.dv.readyState;if(iK&&iK!="interactive"){dT=false;}if(dT){if(navigator.userAgent.indexOf("Macintosh")> -1&&navigator.userAgent.indexOf("Safari")> -1){hm.dv.innerHTML=hO;hm.hI=hm.dv;}if(hm.dv.contentDocument){hm.dv.contentDocument.body.innerHTML=hO;hm.hI=hm.dv.contentDocument;}else if(hm.dv.contentWindow){hm.wait(150);hm.dv.contentWindow.document.body.innerHTML=hO;hm.hI=hm.dv.contentWindow.document;}else if(hm.dv.document){hm.dv.document.body.innerHTML=hO;hm.hI=hm.dv.document;}if(hm.gK){try{hm.gK.call(hm);}catch(e){epals_forums_v5_1_debugOutput("Exception calling document complete callback:\n\n"+e,3);}}}};if(navigator.appName.indexOf("Internet Explorer")> -1){this.dv.onreadystatechange=hW;}else{this.dv.onload=hW;}document.body.appendChild(this.dv);}};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.getDocumentURL=function(){return this.ia;};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.getDocument=function(){return this.hI;};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.getVersion=function(){return this.version;};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.getSearches=function(){return this.H;};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.setMaxCharsToAnalyze=function(){if(typeof(arguments[0])=="number"){this.T=arguments[0];}};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.setNumResults=function(){if(isNaN(arguments[0])==false&&arguments[0]>0){this.U=arguments[0];}};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.setMaxQueryTerms=function(){if(isNaN(arguments[0])==false&&arguments[0]>0){this.aF=arguments[0];}};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.setProperty=function(){if(arguments[0]!=null){this.cf["$"+arguments[0]]=arguments[1];}};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.getProperty=function(){if(arguments[0]!=null){return this.cf["$"+arguments[0]];}return null;};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.setSearchDefinitionElement=function(){this.aM=arguments[0];};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.setSearchDefinitionElementClass=function(){this.aL=arguments[0];};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.setDefaultElementToAnalyze=function(){this.Y=arguments[0];};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.setFastPathEnabled=function(){this.gR=arguments[0];};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.getFastPathEnabled=function(){return this.gR;};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.setProxyServerRoot=function(){this.aK=arguments[0];};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.setStoplist=function(){this.aS=arguments[0];};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.addStopword=function(){if(arguments[0]!=null&&arguments[0]!=""){var bU=arguments[0].toLowerCase();if(arguments[1]!=null&&arguments[1]==true){bU=this.cJ.cZ(bU);}this.aS["$"+bU]="";}};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.addStopwordArray=function(){if(arguments[0]!=null&&String(typeof(arguments[0]))=="object"){var cE=arguments[0];if(cE.length&&cE.length>0){for(var i=0;i -1)||(it&&typeof(it)=="string"&&it.indexOf("ad")> -1)){return false;}var children=fW.childNodes;if(children){var iy=children.length;for(var iu=0;iu0){var hP="";for(var iv=0,iG=hN.length;ivhP.length){hP=iq;}}}if(hP!=""){hf+=hP;}}}var iA=hg*2+4;if(hf==""||(hf.lengthhv){gL=gL.substring(0,hv);}var hB=hv-gL.length;for(var i=0;i0){this.eR=arguments[0];}};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.setMinTokenLength=function(){if(isNaN(arguments[0])==false&&arguments[0]>0){this.hs=arguments[0];}};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.addSearch=function(){var newepals_forums_v5_1_WatsonSearch=new epals_forums_v5_1_WatsonSearch.initialize(this);this.H.push(newepals_forums_v5_1_WatsonSearch);return newepals_forums_v5_1_WatsonSearch;};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.setBehaviorSearchCallback=function(){this.eq=arguments[0];};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.addBehavior=function(ge){var er=new epals_forums_v5_1_WatsonBehavior.initialize(ge,this);for(var y=0;y=0){this.hV=hD;}};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.getGetDocumentMaxResponseSizeK=function(){return this.getDocumentMaxResponseSizeK;};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.setGetDocumentMaxResponseSizeK=function(){var iF=Number(arguments[0]);if(isNaN(iF)==false&&iF>=0){this.getDocumentMaxResponseSizeK=iF;}};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.ib=function(){var bp=epals_forums_v5_1_library_ap.hL.length;if(bp!=null&&bp>=0){var aB=new Object();aB.ev="getdocument";aB.u=encodeURIComponent(this.getDocumentURL());epals_forums_v5_1_logeventEx(aB,true);var hH=this.getDocumentContentsScriptURL;hH+="?u="+encodeURIComponent(this.getDocumentURL());hH+="&r="+this.getContextSignatureHash(null,false,this.getDocumentURL(),true,false);hH+="&ttl="+this.getIFrameDocTTL();hH+="&mdsk="+this.getGetDocumentMaxResponseSizeK();hH+="&c="+encodeURIComponent("epals_forums_v5_1_library_ap.hL["+bp+"].il");var aW=document.createElement("script");aW.src=encodeURI(hH);var iw=this;epals_forums_v5_1_library_ap.hL[bp]=iw;document.body.appendChild(aW);}};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.gV=function(){for(var i=0;i0){var i=String(Math.round(Math.random()*10000000));setTimeout("var img"+i+" = new Image(); img"+i+".onload = function() {return true;}; img"+i+".src = \""+epals_forums_v5_1_watsonLogQueue.pop()+"\";",1);}}};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.hi=function(watsonSearch,gX){for(var i=0;i=0){epals_forums_v5_1_library_ap.ax[bp]=aZ;}}else{aZ.load();}}};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.gW=function(){if(this.cw==0){if(this.gN!=null){clearInterval(this.gN);this.gN=null;}var hA="";if(this.ce==false){this.gT();hA="Using analysis path";}else{hA="Using fast path";}}};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.hd=function(json,dw){var cu=json.ResultSet;var he=true;if(this.getWatsonWebWidget().cw>0){this.getWatsonWebWidget().cw-=1;}if(cu==null){var error=json.Error;if(error!=null){var code=error.Code;var message=error.Message;if(code!=null&&message!=null&&code=="-1"&&message=="NC"){this.getWatsonWebWidget().ce=false;he=false;}}}else{if(cu.query!=null){this.setSearchTerms(cu.query);}if(cu.tw!=null){var hn=cu.tw.split(",");for(var i=0;i"+title+"";fz.innerHTML+=dz;}};epals_forums_v5_1_WatsonWebWidget.initialize.prototype.fe=function(){var dy=this.addBehavior("MSNSpaces");dy.setAppliesToThisContextFunction(function(dG){if(dG.getWatsonWebWidget().getDocumentURL().toLowerCase().indexOf("spaces.live.com")!= -1){return true;}return false;});dy.setResultsCallback(this.resultsCallback);for(var i=0;i0){for(var j=0;jbX metrics:
"+"=======================================
";}for(var i=0;ibK){aO=dp;}aO+=fL;aO+=(gf-aO)/2;var au=as.Emphasis;var at="medium";if(au!=null&&au!=""){at=au;}if(au==null||au==""){var bR=m.r.bq[i-1];var bM=m.r.bq[i+1];if(as.cG==true){at="low";if(cT>aO){at="high";}else{if(i>0&&i!=bt-1){if(bR!=null&&bM!=null&&bR.cG==false&&bM.cG==false&&bR.bX.length>bx&&bM.bX.length>bx){at="medium";}}}}else{if(cT>aO){at="high";}else if(cT0&&i!=bt-1){if(at=="medium"&&bR!=null&&bM!=null&&bR.cG==true&&bM.cG==true&&as.bX.lengtheS&&i!=bt-(eS+1))){var ep=0;for(var gE=i+1;gE!=i+(eS+1);gE++){var fg=m.r.bq[gE];if(fg!=null&&fg.cG==true){ep+=1;}else{if(fg!=null&&fg.bX.length>bx){break;}}}if(ep>=fu){at="medium";}}m.r.bq[i].Emphasis=at;}m.r.bq[i].cV=Math.round(this.watsonWebWidget.al.cv(at,bY));if(this.watsonWebWidget.showDocumentAnalysisStatistics==true){cl+=m.r.bq[i].bX+"

"+""+""+""+""+""+"
cV"+m.r.bq[i].cV+"
Emphasis"+m.r.bq[i].Emphasis+"
Font size"+m.r.bq[i].eQ+"
cG"+m.r.bq[i].cG+"
";if(i!=bt-1){cl+="---------------------------------------
";}}}if(this.watsonWebWidget.showDocumentAnalysisStatistics==true){var o=document.getElementById("WatsonDocumentStatistics");if(o){o.parentNode.removeChild(o);o=null;}if(o==null){o=document.createElement("div");o.className="WatsonDocumentStatistics";var fY="border: solid 1px black;"+"z-index:100000;"+"background-color:white;"+"width:600px;"+"text-align:left;"+"padding:5px;"+"position:absolute;"+"left:0;";o.setAttribute("style",fY);o.style.cssText=fY;o.id="WatsonDocumentStatistics";o.setAttribute("watson_Emphasis","ignore");document.body.appendChild(o);}o.innerHTML+=cl;o.innerHTML+="=======================================";var output="
Document statistics:

"+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+""+"
Total iB length"+bY+"
Total # spans"+bt+"
Total # linked spans"+cj+"
Total # unlinked spans"+bS+"
Longest unlinked span"+ai+"
Link cT"+dn+"
Mean unlinked span length"+bx+"
Median unlinked span length"+bm+"
Mean linked span length"+ci+"
 
Comparsion metriceQ
Min "+gw+"
1st bd (low weight)"+cs+"
2nd bd (median - medium weight)"+dj+"
3rd bd"+bK+"
Max "+gf+"
Mode"+gr+"
Mean"+dp+"
Std. Deviation"+fL+"
High weight metric"+aO+"
";o.innerHTML+=output;}this.es.length=0;return m;};epals_forums_v5_1_library_aU.initialize.prototype.hK=function(di){var at="";if(di.nodeType!=3&&di.nodeType!=4){try{at=di.getAttribute("watson_Emphasis");if(at==null){at=di.getAttribute("watson:Emphasis");}if(at!=null&&at!=""){at=at.toLowerCase();}}catch(e){}}return at;};epals_forums_v5_1_library_aU.initialize.prototype.ek=function(ej){if(ej.parentNode.style!=null&&(ej.parentNode.style.visibility=="hidden")||(ej.parentNode.style.display=="none")){var at=this.hK(ej.parentNode);if(at!=""&&at!="ignore"){return false;}return true;}var dU=ej.parentNode;var en=false;while(dU!=null){if(dU.nodeName&&dU.nodeName.toLowerCase()=="html"){break;}var dW=null;var dV=null;if(dU.currentStyle){dW=dU.currentStyle["display"];dV=dU.currentStyle["visibility"];}else if(window.getComputedStyle){dW=window.getComputedStyle(dU,null).getPropertyValue("display");dV=window.getComputedStyle(dU,null).getPropertyValue("visibility");}if((dW!=null&&dW=="none")||(dV!=null&&dV=="hidden")){var at=this.hK(ej.parentNode);if(at!=""&&at!="ignore"){en=false;}else{en=true;}break;}dU=dU.parentNode;}return en;};epals_forums_v5_1_library_aU.initialize.prototype.getSelectedText=function(){var gz="";if(window.getSelection){gz=window.getSelection();}else if(document.getSelection){gz=document.getSelection();}else if(document.selection){gz=document.selection.createRange().text;}return String(gz);};epals_forums_v5_1_library_aU.initialize.prototype.eF=function(span){for(var i=0;i=this.watsonWebWidget.T)){return;}if(this.es.eM(di)==true){return;}else{this.es.push(di);}if(di.id&&di.id=="WatsonDocumentStatistics"){return;}var aN=false;for(var i=0;i=this.watsonWebWidget.T){aN=true;break;}}if(aN==false){var bA=at;if(bv.nodeType!=3&&bv.nodeType!=4){try{var bV=bv.getAttribute("watson_Emphasis");if(bV==null){bV=bv.getAttribute("watson:Emphasis");}if(bV!=null&&bV!=""&&this.watsonWebWidget.dm==true){bA=bV.toLowerCase();}}catch(e){}}if(bv.childNodes!=null&&bv.childNodes.length>0){this.cS(bv,m,bA,eE);}}}};epals_forums_v5_1_library_aU.initialize.prototype.fK=function(bv,bN,dC){if(dC==null||dC==""){dC=16;}var fontSize=this.watsonWebWidget.al.gi(bN);if(fontSize==null||fontSize==""){return dC;}fontSize=fontSize.toLowerCase();var gk=fontSize.indexOf("px");if(gk!= -1){return Number(fontSize.substring(0,gk));}var eK=fontSize.indexOf("mm");if(eK!= -1){return Number(fontSize.substring(0,eK)*3.57142857);}var eK=fontSize.indexOf("cm");if(eK!= -1){return Number(fontSize.substring(0,eK)*35.7142857);}var gA=fontSize.indexOf("in");if(gA!= -1){return Number(fontSize.substring(0,eK)*(2.54*35.7142857));}var gn=fontSize.indexOf("pc");if(gn!= -1){return Number(fontSize.substring(0,gn)*(12*1.3));}var gj=fontSize.indexOf("pt");if(gj!= -1){return Number(fontSize.substring(0,gj)*1.3);}var gp=fontSize.indexOf("em");if(gp!= -1){return Number(fontSize.substring(0,gp)*16);}var gc=fontSize.indexOf("%");if(gc!= -1){var gI=Number(fontSize.substring(0,gc)/100);return Number(gI*dC);}var ed=fontSize.charAt(0);var eC=0;if(ed=="+"||ed=="-"){eC=Number(fontSize.substring(1));}else{ed=null;eC=Number(fontSize);}if(isNaN(eC)==false){if(ed!=null&&ed=="-"&&eC>2){fontSize="-2";}else if(ed!=null&&ed=="+"&&eC>4){fontSize="+4";}else if(ed==null&&eC>7){fontSize="7";}}if(this.P[fontSize]!=null){return Number(this.P[fontSize]);}if(isNaN(fontSize)==true){fontSize="10";}return fontSize;};if(window.epals_forums_v5_1_library_bf==null){var epals_forums_v5_1_library_bf=new Object();}epals_forums_v5_1_library_bf.initialize=function(){this.watsonWebWidget=arguments[0];};epals_forums_v5_1_library_bf.initialize.prototype.av=function(watsonSearch,m){if(watsonSearch.queryTermArray.length>0||m==undefined||m.r.bq.length==0){return;}var bu=new Object();var eI=new Object();var cq=new Array();for(var i=0;i"+gM+""+watsonSearch.K[cX]+" "+eI[cX]+"";}}el+="";o.innerHTML+=el;}}var aV=0;if(watsonSearch.useShortQuery==true){aV=watsonSearch.aV;}var Z=watsonSearch.aF;if(ao.length=eg){be.push(cy);watsonSearch.queryTermArray.push(ao[i].substring(1));cC+=1;}else{break;}}if(cC==Z){break;}}};if(window.epals_forums_v5_1_library_aX==null){var epals_forums_v5_1_library_aX=new Object();}epals_forums_v5_1_library_aX.initialize=function(){this.watsonWebWidget=arguments[0];};epals_forums_v5_1_library_aX.initialize.prototype.cr=function(as,ba,ah,by){var aA="";var bj="";var span=as.bX;for(var i=0;i0){if(this.watsonWebWidget.al.cc(span.charAt(i-1))==true&&this.watsonWebWidget.al.cc(span.charAt(i+1))==true){aA+=c;if(i==span.length-1){bj=this.bz(aA,as.cV,ba,ah,by,bj);}}}else{bj=this.bz(aA,as.cV,ba,ah,by,bj);aA="";}}else{bj=this.bz(aA,as.cV,ba,ah,by,bj);aA="";}}else{aA+=c;if(i==span.length-1){bj=this.bz(aA,as.cV,ba,ah,by,bj);}}}}};epals_forums_v5_1_library_aX.initialize.prototype.bz=function(aA,aP,ba,ah,by,bj){aA=aA.toLowerCase();if(this.watsonWebWidget.al.dg(aA)==false){return "";}if(aA.length4){return 0;}if(bd==0){return cI[0];}if(bd==4){return cI[cI.length-1];}var k=Math.round((bd/4)*((cI.length-1)+1));var f=((bd/4)*(cI.length-1))-Math.floor((bd/4)*(cI.length-1));return cI[k-1]+(f*(cI[k]-cI[k-1]));};epals_forums_v5_1_library_aC.initialize.prototype.mode=function(cI){if(!cI||cI.length==0){return 0;}var eP=new Object();for(var i=0;i0){return fB[0];}else{return 0;}};epals_forums_v5_1_library_aC.initialize.prototype.gD=function(cI){var gx=0;for(var i=0;i0){do{if(this[i]===item){return true;}}while(i--);}return false;};epals_forums_v5_1_library_aC.initialize.prototype.fD=function(){var g="{";for(var i=0;i<32;i++){g+=Math.floor(Math.random()*0xF).toString(0xF)+(i==8||i==12||i==16||i==20?"-":"")}return g+"}";};epals_forums_v5_1_library_aC.initialize.prototype.cR=function(c){if((c==' ')||(c=='\t')||(c=='\n')||(c=='\r')||(c.charCodeAt(0)==160)||(c=='\xCA')){return true;}return false;};epals_forums_v5_1_library_aC.initialize.prototype.cc=function(c){return this.hk.test(c);};epals_forums_v5_1_library_aC.initialize.prototype.dg=function(c){return this.hq.test(c);};epals_forums_v5_1_library_aC.initialize.prototype.de=function(c){return(this.cR(c)==false&&this.cc(c)==false);};epals_forums_v5_1_library_aC.initialize.prototype.cO=function(c){return(c=='.'||c=='_');};epals_forums_v5_1_library_aC.initialize.prototype.ct=function(dI){var result=dI.match(/^\s*(.*\S)\s*$/);if(result!==null&&result.length===2){return result[1];}else{return dI;}};if(window.epals_forums_v5_1_StopList==null){var epals_forums_v5_1_StopList=new Object();}epals_forums_v5_1_StopList.initialize=function(){var aS={};if(arguments[0]!=null&&arguments[0].toLowerCase()=="english"){aS={"$a":"","$a's":"","$able":"","$about":"","$above":"","$according":"","$accordingly":"","$across":"","$actually":"","$after":"","$afterwards":"","$again":"","$against":"","$ain't":"","$all":"","$allow":"","$allows":"","$almost":"","$alone":"","$along":"","$already":"","$also":"","$although":"","$always":"","$am":"","$among":"","$amongst":"","$an":"","$and":"","$another":"","$any":"","$anybody":"","$anyhow":"","$anyone":"","$anything":"","$anyway":"","$anyways":"","$anywhere":"","$apart":"","$appear":"","$appreciate":"","$appropriate":"","$are":"","$aren't":"","$around":"","$as":"","$aside":"","$ask":"","$asking":"","$associated":"","$at":"","$available":"","$away":"","$awfully":"","$b":"","$be":"","$became":"","$because":"","$become":"","$becomes":"","$becoming":"","$been":"","$before":"","$beforehand":"","$behind":"","$being":"","$believe":"","$below":"","$beside":"","$besides":"","$best":"","$better":"","$between":"","$beyond":"","$both":"","$brief":"","$but":"","$by":"","$c":"","$c'mon":"","$c's":"","$came":"","$can":"","$can't":"","$cannot":"","$cant":"","$cause":"","$causes":"","$certain":"","$certainly":"","$changes":"","$checkout":"","$clearly":"","$co":"","$com":"","$come":"","$comes":"","$concerning":"","$consequently":"","$consider":"","$considering":"","$contain":"","$containing":"","$contains":"","$corresponding":"","$could":"","$couldn't":"","$course":"","$currently":"","$d":"","$de":"","$definitely":"","$described":"","$despite":"","$did":"","$didn't":"","$different":"","$do":"","$does":"","$doesn't":"","$doing":"","$don't":"","$done":"","$down":"","$downwards":"","$during":"","$e":"","$each":"","$edu":"","$eg":"","$eight":"","$either":"","$else":"","$elsewhere":"","$enough":"","$entirely":"","$especially":"","$et":"","$etc":"","$even":"","$ever":"","$every":"","$everybody":"","$everyone":"","$everything":"","$everywhere":"","$ex":"","$exactly":"","$example":"","$except":"","$f":"","$far":"","$few":"","$fifth":"","$first":"","$five":"","$followed":"","$following":"","$follows":"","$for":"","$former":"","$formerly":"","$forth":"","$four":"","$from":"","$further":"","$furthermore":"","$g":"","$get":"","$gets":"","$getting":"","$given":"","$gives":"","$go":"","$goes":"","$going":"","$gone":"","$got":"","$gotten":"","$greetings":"","$h":"","$had":"","$hadn't":"","$happens":"","$hardly":"","$has":"","$hasn't":"","$have":"","$haven't":"","$having":"","$he":"","$he's":"","$hello":"","$help":"","$hence":"","$her":"","$here":"","$here's":"","$hereafter":"","$hereby":"","$herein":"","$hereupon":"","$hers":"","$herself":"","$hi":"","$him":"","$himself":"","$his":"","$hither":"","$hopefully":"","$how":"","$howbeit":"","$however":"","$i":"","$i'd":"","$i'll":"","$i'm":"","$i've":"","$ie":"","$if":"","$ignored":"","$immediate":"","$in":"","$inasmuch":"","$inc":"","$indeed":"","$indicate":"","$indicated":"","$indicates":"","$inner":"","$insofar":"","$instead":"","$into":"","$inward":"","$is":"","$isn't":"","$it":"","$it'd":"","$it'll":"","$it's":"","$it’s":"","$its":"","$itself":"","$j":"","$just":"","$k":"","$keep":"","$keeps":"","$kept":"","$know":"","$knows":"","$known":"","$l":"","$last":"","$lately":"","$later":"","$latter":"","$latterly":"","$least":"","$less":"","$lest":"","$let":"","$let's":"","$like":"","$liked":"","$likely":"","$little":"","$look":"","$looking":"","$looks":"","$ltd":"","$m":"","$mainly":"","$many":"","$may":"","$maybe":"","$me":"","$mean":"","$meanwhile":"","$merely":"","$might":"","$more":"","$moreover":"","$most":"","$mostly":"","$much":"","$must":"","$my":"","$myself":"","$n":"","$name":"","$namely":"","$nd":"","$near":"","$nearly":"","$necessary":"","$need":"","$needs":"","$neither":"","$never":"","$nevertheless":"","$new":"","$next":"","$nine":"","$no":"","$nobody":"","$non":"","$none":"","$noone":"","$nor":"","$normally":"","$not":"","$nothing":"","$novel":"","$now":"","$nowhere":"","$o":"","$obviously":"","$of":"","$off":"","$often":"","$oh":"","$ok":"","$okay":"","$old":"","$on":"","$once":"","$one":"","$ones":"","$only":"","$onto":"","$or":"","$other":"","$others":"","$otherwise":"","$ought":"","$our":"","$ours":"","$ourselves":"","$out":"","$outside":"","$over":"","$overall":"","$own":"","$p":"","$particular":"","$particularly":"","$per":"","$perhaps":"","$placed":"","$please":"","$plus":"","$possible":"","$presumably":"","$probably":"","$provides":"","$q":"","$que":"","$quite":"","$qv":"","$r":"","$rather":"","$rd":"","$re":"","$really":"","$reasonably":"","$regarding":"","$regardless":"","$regards":"","$relatively":"","$respectively":"","$right":"","$s":"","$said":"","$same":"","$saw":"","$say":"","$saying":"","$says":"","$second":"","$secondly":"","$see":"","$seeing":"","$seem":"","$seemed":"","$seeming":"","$seems":"","$seen":"","$self":"","$selves":"","$sensible":"","$sent":"","$serious":"","$seriously":"","$seven":"","$several":"","$shall":"","$she":"","$she's":"","$should":"","$shouldn't":"","$since":"","$six":"","$so":"","$some":"","$somebody":"","$somehow":"","$someone":"","$something":"","$sometime":"","$sometimes":"","$somewhat":"","$somewhere":"","$soon":"","$sorry":"","$specified":"","$specify":"","$specifying":"","$still":"","$sub":"","$such":"","$sup":"","$sure":"","$t":"","$t's":"","$take":"","$taken":"","$tell":"","$tends":"","$th":"","$than":"","$thank":"","$thanks":"","$thanx":"","$that":"","$that's":"","$thats":"","$the":"","$their":"","$theirs":"","$them":"","$themselves":"","$then":"","$thence":"","$there":"","$there's":"","$thereafter":"","$thereby":"","$therefore":"","$therein":"","$theres":"","$thereupon":"","$these":"","$they":"","$they'd":"","$they'll":"","$they'ae":"","$they've":"","$think":"","$third":"","$this":"","$thorough":"","$thoroughly":"","$those":"","$though":"","$three":"","$through":"","$throughout":"","$thru":"","$thus":"","$to":"","$together":"","$too":"","$took":"","$toward":"","$towards":"","$tried":"","$tries":"","$truly":"","$try":"","$trying":"","$twice":"","$two":"","$u":"","$un":"","$under":"","$unfortunately":"","$unless":"","$unlikely":"","$until":"","$unto":"","$up":"","$upon":"","$us":"","$use":"","$used":"","$useful":"","$uses":"","$using":"","$usually":"","$uucp":"","$v":"","$value":"","$various":"","$very":"","$via":"","$viz":"","$vs":"","$w":"","$want":"","$wants":"","$was":"","$wasn't":"","$way":"","$we":"","$we'd":"","$we'll":"","$we'ae":"","$we've":"","$welcome":"","$well":"","$went":"","$were":"","$weren't":"","$what":"","$what's":"","$whatever":"","$when":"","$whence":"","$whenever":"","$where":"","$where's":"","$whereafter":"","$whereas":"","$whereby":"","$wherein":"","$whereupon":"","$wherever":"","$whether":"","$which":"","$while":"","$whither":"","$who":"","$who's":"","$whoever":"","$whole":"","$whom":"","$whose":"","$why":"","$will":"","$willing":"","$wish":"","$with":"","$within":"","$without":"","$won't":"","$wonder":"","$would":"","$would":"","$wouldn't":"","$x":"","$y":"","$yes":"","$yet":"","$you":"","$you'd":"","$you'll":"","$you'ae":"","$you've":"","$your":"","$yours":"","$yourself":"","$yourselves":"","$z":"","$zero":"","$jan":"","$feb":"","$mar":"","$apr":"","$jun":"","$jul":"","$aug":"","$sep":"","$nov":"","$dec":"","$www":"","$http":"","$htm":"","$html":"","$mon":"","$tue":"","$wed":"","$thu":"","$fri":"","$sat":"","$monday":"","$tuesday":"","$wednesday":"","$thursday":"","$friday":"","$saturday":"","$sunday":"","$tag":"","$item":"","$shipping":"","$auction":"","$store":"","$seller":"","$contact":"","$bid":"","$buyer":"","$payment":"","$winning":"","$listed":"","$reserve":"","$reg":"","$req'd":""};}return aS;};if(window.epals_forums_v5_1_WatsonBehavior==null){var epals_forums_v5_1_WatsonBehavior=new Object();}epals_forums_v5_1_WatsonBehavior.initialize=function(){this.name=arguments[0];this.watsonWebWidget=arguments[1];this.O=new Array();this.aQ=new Array();this.cz=true;this.bk=null;this.bl=null;this.resultsCallback=this.watsonWebWidget.resultsCallback;};epals_forums_v5_1_WatsonBehavior.initialize.prototype.setResultsCallback=function(){this.resultsCallback=arguments[0];};epals_forums_v5_1_WatsonBehavior.initialize.prototype.getWatsonWebWidget=function(){return this.watsonWebWidget;};epals_forums_v5_1_WatsonBehavior.initialize.prototype.addSearch=function(){var search=this.watsonWebWidget.addSearch();this.aQ.push(search);return search;};epals_forums_v5_1_WatsonBehavior.initialize.prototype.setAppliesToThisContextFunction=function(){this.bk=arguments[0];};epals_forums_v5_1_WatsonBehavior.initialize.prototype.appliesToThisContext=function(){var io=false;try{io=this.bk(this);}catch(e){epals_forums_v5_1_debugOutput("Exception calling "+this.getName()+" applies to ay function:\n\n"+e,3);}return io;};epals_forums_v5_1_WatsonBehavior.initialize.prototype.setSearchGenerationFunction=function(){this.bl=arguments[0];};epals_forums_v5_1_WatsonBehavior.initialize.prototype.generateSearches=function(){try{this.bl(this);}catch(e){epals_forums_v5_1_debugOutput("Exception calling "+this.getName()+" search generation function:\n\n"+e,3);}};epals_forums_v5_1_WatsonBehavior.initialize.prototype.addSource=function(){this.O.push(arguments[0]);};epals_forums_v5_1_WatsonBehavior.initialize.prototype.getSources=function(){return this.O;};epals_forums_v5_1_WatsonBehavior.initialize.prototype.getName=function(){return this.name;};epals_forums_v5_1_WatsonBehavior.initialize.prototype.isActive=function(){return this.cz;};epals_forums_v5_1_WatsonBehavior.initialize.prototype.setActive=function(){this.cz=arguments[0];};epals_forums_v5_1_WatsonBehavior.initialize.prototype.gd=function(){return this.aQ;};if(epals_forums_v5_1_library_by==null){var epals_forums_v5_1_library_by=new Object();}epals_forums_v5_1_library_by.initialize=function(){this.B=new Array();this.B["ational"]="ate";this.B["tional"]="tion";this.B["enci"]="ence";this.B["anci"]="ance";this.B["izer"]="ize";this.B["bli"]="ble";this.B["alli"]="al";this.B["entli"]="ent";this.B["eli"]="e";this.B["ousli"]="ous";this.B["ization"]="ize";this.B["ation"]="ate";this.B["ator"]="ate";this.B["alism"]="al";this.B["iveness"]="ive";this.B["fulness"]="ful";this.B["ousness"]="ous";this.B["aliti"]="al";this.B["iviti"]="ive";this.B["biliti"]="ble";this.B["logi"]="log";this.aJ=new Array();this.aJ["icate"]="ic";this.aJ["ative"]="";this.aJ["alize"]="al";this.aJ["iciti"]="ic";this.aJ["ical"]="ic";this.aJ["ful"]="";this.aJ["ness"]="";this.c="[^aeiou]";this.v="[aeiouy]";this.C=this.c+"[^aeiouy]*";this.V=this.v+"[aeiou]*";this.da="^("+this.C+")?"+this.V+this.C;this.du="^("+this.C+")?"+this.V+this.C+"("+this.V+")?$";this.cU="^("+this.C+")?"+this.V+this.C+this.V+this.C;this.dq="^("+this.C+")?"+this.v;};epals_forums_v5_1_library_by.initialize.prototype.cZ=function(w){var az;var cF;var cb;var ds=w;if(w.length<3){return w;}var ae;var bD;var dc;var dr;cb=w.substring(0,1);if(cb=="y"){w=cb.toUpperCase()+w.substr(1);}ae=/^(.+?)(ss|i)es$/;bD=/^(.+?)([^s])s$/;if(ae.test(w)){w=w.replace(ae,"$1$2");}else if(bD.test(w)){w=w.replace(bD,"$1$2");}ae=/^(.+?)eed$/;bD=/^(.+?)(ed|ing)$/;if(ae.test(w)){var fp=ae.exec(w);ae=new RegExp(this.da);if(ae.test(fp[1])){ae=/.$/;w=w.replace(ae,"");}}else if(bD.test(w)){var fp=bD.exec(w);az=fp[1];bD=new RegExp(this.dq);if(bD.test(az)){w=az;bD=/(at|bl|iz)$/;dc=new RegExp("([^aeiouylsz])\\1$");dr=new RegExp("^"+this.C+this.v+"[^aeiouwxy]$");if(bD.test(w)){w=w+"e";}else if(dc.test(w)){ae=/.$/;w=w.replace(ae,"");}else if(dr.test(w)){w=w+"e";}}}ae=/^(.+?)y$/;if(ae.test(w)){var fp=ae.exec(w);az=fp[1];ae=new RegExp(this.dq);if(ae.test(az)){w=az+"i";}}ae=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;if(ae.test(w)){var fp=ae.exec(w);az=fp[1];cF=fp[2];ae=new RegExp(this.da);if(ae.test(az)){w=az+this.B[cF];}}ae=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;if(ae.test(w)){var fp=ae.exec(w);az=fp[1];cF=fp[2];ae=new RegExp(this.da);if(ae.test(az)){w=az+this.aJ[cF];}}ae=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;bD=/^(.+?)(s|t)(ion)$/;if(ae.test(w)){var fp=ae.exec(w);az=fp[1];ae=new RegExp(this.cU);if(ae.test(az)){w=az;}}else if(bD.test(w)){var fp=bD.exec(w);az=fp[1]+fp[2];bD=new RegExp(this.cU);if(bD.test(az)){w=az;}}ae=/^(.+?)e$/;if(ae.test(w)){var fp=ae.exec(w);az=fp[1];ae=new RegExp(this.cU);bD=new RegExp(this.du);dc=new RegExp("^"+this.C+this.v+"[^aeiouwxy]$");if(ae.test(az)||(bD.test(az)&& !(dc.test(az)))){w=az;}}ae=/ll$/;bD=new RegExp(this.cU);if(ae.test(w)&&bD.test(w)){ae=/.$/;w=w.replace(ae,"");}if(cb=="y"){w=cb.toLowerCase()+w.substr(1);}return w;};if(window.epals_forums_v5_1_WATSON_VERSION==null){window.epals_forums_v5_1_WATSON_VERSION="2.0b";}if(window.epals_forums_v5_1_LOG_PIXEL_LOCATION==null){window.epals_forums_v5_1_LOG_PIXEL_LOCATION="http://csi.mediariver.com/l.gif?";}if(window.epals_forums_v5_1_logeventEx==null){function epals_forums_v5_1_logeventEx(aB,gs,ho){aB.p="MEDIARIVER";aB.n="unknown";aB.c="unknown";aB.v="unknown";if(window.epals_forums_v5_1_WATSON_PARTNERID!=null){aB.p=window.epals_forums_v5_1_WATSON_PARTNERID;}if(window.epals_forums_v5_1_WATSON_WIDGET_NAME!=null){aB.n=window.epals_forums_v5_1_WATSON_WIDGET_NAME;}if(window.epals_forums_v5_1_WATSON_CONFIG_VER!=null){aB.c=window.epals_forums_v5_1_WATSON_CONFIG_VER;}if(window.epals_forums_v5_1_WATSON_VERSION!=null){aB.v=window.epals_forums_v5_1_WATSON_VERSION;}if(window.epals_forums_v5_1_WATSON_SESSIONID!=null){aB.s=window.epals_forums_v5_1_WATSON_SESSIONID;}var X="http://csi.mediariver.com/l.gif?";if(window.epals_forums_v5_1_LOG_PIXEL_LOCATION!=null){X=window.epals_forums_v5_1_LOG_PIXEL_LOCATION;}X+="r="+escape(location.hostname+location.pathname);if(aB.u!=null){X+="&u="+escape(aB.u.replace("http://",""));}var name;for(name in aB){if([].propertyIsEnumerable!=undefined&&aB.propertyIsEnumerable(name)==false){continue;}if((name=="u")||(name=="q")){continue;}X+="&"+name+"="+escape(aB[name]);}X+="&q="+escape(aB.q);X+="&date="+String(new Date().getTime())+"&rnd="+String(Math.random());if(gs){epals_forums_v5_1_watsonLogQueue.push(X);}else{var img=new Image();if(aB.u!=null){if(ho!=null&&ho==true){img.onload=function(){window.open(aB.u,'_new',',,,,menubar,toolbar,location,resizable,scrollbars,status');};}else{img.onload=function(){window.location=aB.u;};}}img.src=X;}}}if(window.epals_forums_v5_1_logevent==null){function epals_forums_v5_1_logevent(dh,df,dk){var aB=new Object();aB.ev=dh;aB.sid=df;var gs=true;if(dh=="query"){aB.q=dk;}else if((dh=="view")||(dh=="click")){aB.i=String(dk);if(dh=="click"){gs=false;}}epals_forums_v5_1_logeventEx(aB,gs);}}if(window.epals_forums_v5_1_debugOutput==null){var epals_forums_v5_1_debugOutput=function(hA,hw){if(window.epals_forums_v5_1_CS_DEBUG!=undefined&&window.epals_forums_v5_1_CS_DEBUG==true){try{if(window.console||console.firebug){var hp=Number(hw);if(isNaN(hp)||hp==1){console.debug(hA);}else if(hp==2){console.warn(hA);}else if(hp==3){console.error(hA);}}}catch(e){}}}}var epals_forums_v5_1_addLoadEvent=(function(){var global=this;var base=null;var dS=false;var dO=(global.addEventListener&&2)||(global.attachEvent&&3)||0;function gJ(dL,dP,dQ,dR,dN){var next=null;function l(ev){dL((ev?ev:global.event),dP,dQ,dR,dN);if(next)next=next(ev);return(dP=dQ=dR=dN=dL=null);};l.dM=function(d){if(next){next.dM(d);}else{next=d;}};return l;};return(function(dL,dP,dQ,dR,dN){if(base){base.dM(gJ(dL,dP,dQ,dR,dN));}else{base=gJ(dL,dP,dQ,dR,dN);}if(!dS){switch(dO){case 2:global.addEventListener("load",base,false);dS=true;break;case 3:global.attachEvent("onload",base);dS=true;break;default:if(global.onload!=base){if(global.onload){base.dM(gJ(global.onload));}global.onload=base;}break;}}});})();var epals_forums_v5_1_addDOMReadyEvent=function(fn){function hy(){if(arguments.callee.hE){return;}arguments.callee.hE=true;if(epals_forums_v5_1_library_gK){clearInterval(epals_forums_v5_1_library_gK);epals_forums_v5_1_library_gK=null;}fn();};if(document.addEventListener){document.addEventListener("DOMContentLoaded",hy,false);}if(/WebKit/i.test(navigator.userAgent)){var epals_forums_v5_1_library_gK=setInterval(function(){if(/loaded|complete/.test(document.readyState)){hy();}},10);}epals_forums_v5_1_addLoadEvent(hy);};var epals_forums_v5_1_WATSON_SESSIONID=String(new Date().getTime()+"-"+Math.round(Math.random()*10000000));var epals_forums_v5_1_startWidget=function(fn,mode){var aB=new Object();aB.ev="widgetview";epals_forums_v5_1_logeventEx(aB,false);var hz=Number(mode);if(isNaN(hz)==false&&hz==1){epals_forums_v5_1_addLoadEvent(fn);}else{epals_forums_v5_1_addDOMReadyEvent(fn);}}; // Config URL: http://localhost:50096/widgets/ePals/scripts/epals-config-v5-1.js //////////////////////////////////////////////////////////////////////////////// // // ClickSurge Widget Configuration // // ePals v5.1 // // Copyright (C) 2008 MediaRiver, Inc. // All Rights Reserved. // Patents Pending. // //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // CSS styles and element IDs //////////////////////////////////////////////////////////////////////////////// // HTML result container IDs and class names var epals_forums_v5_1_resultsDivId = "mediaRiver"; // id of MR result container var epals_forums_v5_1_backupDivId = "mediaRiverReplacement"; // id of MR backup result container var epals_forums_v5_1_resultULClassName = "mediaRiverUL"; // CSS class for result list var epals_forums_v5_1_resultLIClassName = "mediaRiverLI"; // CSS class for list item var epals_forums_v5_1_resultLIDivClassName = "mediaRiverLIDiv"; // CSS class for div in LI var epals_forums_v5_1_resultAClassName = "title"; // CSS class for result anchor var epals_forums_v5_1_resultThumbnailSpanClassName = "thumbnail"; // CSS class for result thumbnail var epals_forums_v5_1_resultSummarySpanClassName = "description"; // CSS class for result summary var epals_forums_v5_1_resultSourceSpanClassName = "source"; // CSS class for result source // Prefixes for pre-annotated forum page components // These IDs aren't looked up exactly, but instead get combined with a running // counter to account for multiple elements per page. // Example: forumPostingTopic1, forumPostingTopic2, etc. var epals_forums_v5_1_forumTopicIDPrefix = "forumPostingTopic"; var epals_forums_v5_1_forumSubjectIDPrefix = "forumSubjectText"; var epals_forums_v5_1_forumPostingBodyIDPrefix = "forumPostingBody"; // epals stop words var epals_forums_v5_1_epalsStopWords = ["mom", "moms", "mother", "mothers", "classroom", "classrooms", "project", "projects", "hurt", "hurts", "year", "years", "hey", "from", "subjects", "subject", "posted", "post", "posts", "talk", "talks", "teacher", "teachers", "epals", "epal", "reply", "replies", "students", "student", "classes", "class", "topic", "topics", "teen", "teens", "preteen", "preteens", "young", "porn", "pornography", "prostitution", "prostitute", "wanted", "love", "loves", "sex", "sexy", "pregnancy", "pregnant", "contraception", "condoms", "condom", "drugs", "drug", "guns", "gun", "bombs", "bomb", "gambling", "gamble", "alcohol", "pedophilia", "pedophile", "year", "years", "suicide", "suicidal", "marijuana", "terrorist", "terrorism", "gang", "shouldn't", "play"]; //////////////////////////////////////////////////////////////////////////////// // Source controls //////////////////////////////////////////////////////////////////////////////// // Check if sources are specified via HTTP parameters var epals_forums_v5_1_specedSources = epals_forums_v5_1_gup("sources"); var epals_forums_v5_1_blnSourcesSpecifiedViaHTTPParameters = false; var epals_forums_v5_1_blnExternalUseImageSource = false; // Do not modify these values var epals_forums_v5_1_blnExternalUseVideoSource = false; var epals_forums_v5_1_blnExternalUseTextSource = false; if(epals_forums_v5_1_specedSources && epals_forums_v5_1_specedSources.length > 0) { epals_forums_v5_1_blnSourcesSpecifiedViaHTTPParameters = true; epals_forums_v5_1_specedSources = epals_forums_v5_1_specedSources.toLowerCase(); if(epals_forums_v5_1_specedSources.indexOf("i") > -1) { epals_forums_v5_1_blnExternalUseImageSource = true; } if(epals_forums_v5_1_specedSources.indexOf("v") > -1) { //epals_forums_v5_1_blnExternalUseVideoSource = true; } if(epals_forums_v5_1_specedSources.indexOf("t") > -1) { epals_forums_v5_1_blnExternalUseTextSource = true; } if(epals_forums_v5_1_blnExternalUseImageSource == false && epals_forums_v5_1_blnExternalUseVideoSource == false && epals_forums_v5_1_blnExternalUseTextSource == false) { epals_forums_v5_1_blnSourcesSpecifiedViaHTTPParameters = false; } } epals_forums_v5_1_blnExternalUseVideoSource = false; // A map from source identifier : display name var epals_forums_v5_1_WatsonWebWidgetSourcesToUse = new Object(); // To permanently disable a source, comment out its entry. // Alternatively, the sources to use may be specified via an HTTP parameter to the // script. Prototype: // config.js?sources=t,v,i (t=text, v=video, i=images) // Examples: // config.js (all sources used) // config.js?sources= (all sources used) // config.js?sources=t (text only) // config.js?sources=t,v (text and video only) if(epals_forums_v5_1_blnSourcesSpecifiedViaHTTPParameters == false) { epals_forums_v5_1_WatsonWebWidgetSourcesToUse["epals-links"] = "National Geographic"; epals_forums_v5_1_WatsonWebWidgetSourcesToUse["epals-video"] = "National Geographic Video"; epals_forums_v5_1_WatsonWebWidgetSourcesToUse["epals-images"] = "National Geographic Images"; } else { if(epals_forums_v5_1_blnExternalUseImageSource == true) { epals_forums_v5_1_WatsonWebWidgetSourcesToUse["epals-images"] = "National Geographic Images"; } if(epals_forums_v5_1_blnExternalUseVideoSource == true) { epals_forums_v5_1_WatsonWebWidgetSourcesToUse["epals-video"] = "National Geographic Video"; } if(epals_forums_v5_1_blnExternalUseTextSource == true) { epals_forums_v5_1_WatsonWebWidgetSourcesToUse["epals-links"] = "National Geographic"; } } // Maximum number of results to retrieve per source var epals_forums_v5_1_maxResultsPerSource = 30; //////////////////////////////////////////////////////////////////////////////// // Result filter controls //////////////////////////////////////////////////////////////////////////////// // If on, throw out NatGeo news results unless newer than the below date var epals_forums_v5_1_blnNatGeoNewsDateFilterOn = true; var epals_forums_v5_1_natGeoNewsYearThreshold = "2005"; // provide year in 4 char format var epals_forums_v5_1_natGeoNewsMonthThreshold = "01"; // provide month in 2 char format // filter results that contain one of the following terms in their title (lowercase) var epals_forums_v5_1_resultTitleFilterTerms = ["teen", "teens", "preteen", "preteens", "young", "porn", "pornography", "prostitution", "prostitute", "love", "loves", "sex", "sexy", "pregnancy", "pregnant", "contraception", "condoms", "condom", "drugs", "drug", "guns", "gun", "bombs", "bomb", "gambling", "gamble", "alcohol", "pedophilia", "pedophile", "suicide", "suicidal", "marijuana", "terrorist", "terrorism", "gang"]; //////////////////////////////////////////////////////////////////////////////// // Search controls //////////////////////////////////////////////////////////////////////////////// // Enable/disable particular search types var epals_forums_v5_1_blnAddCountrySearch = true; var epals_forums_v5_1_blnAddTextSearch = true; var epals_forums_v5_1_blnAddTextSearchForMemberProfilePages = false; var epals_forums_v5_1_blnAddTopicSearch = true; var epals_forums_v5_1_blnAddSubjectSearch = true; // Limit the number of posts that can be analyzed var epals_forums_v5_1_maxPostsToAnalyze = 10; // Maximum number of results to display overall var epals_forums_v5_1_maxResultsToDisplay = 20; // Display all available results no matter what after this timeout var epals_forums_v5_1_WatsonWebWidgetDisplayTimeoutInterval = 10000; // Show backup display if the total number of results is less than below var epals_forums_v5_1_gWatsonWebWidgetResultsDisplayThreshold = 2; //////////////////////////////////////////////////////////////////////////////// // Tracking controls //////////////////////////////////////////////////////////////////////////////// // Value gets prepended to each result URL. Useful for click tracking via redirect processors (e.g. DoubleClick). var epals_forums_v5_1_urlClickUrlPrefix = ""; // Value gets appended to each result URL as an HTTP parameter. Useful for click tracking by analytic systems (e.g. Omniture). var epals_forums_v5_1_urlClickUrlTrackingParam = "msc=mediariver"; //////////////////////////////////////////////////////////////////////////////// // DO NOT MODIFY BELOW THIS LINE FOR BASIC FUNCTIONALITY //////////////////////////////////////////////////////////////////////////////// // Revision History // 01/25/08 - v1.0 // 02/01/08 - v1.1 - opens up more results for country. fixes issue with extended char RegExps // 02/04/08 - v1.2 - opens up more results for subject // 02/20/08 - v1.3 - ensures non-NatGeo videos aren't displayed // 05/16/08 - v5.1 - adds grouped sources to include Smithsonian, Thinkfinit, etc. Supports CS forums, remains backward compatible. Uses new DNS and new platform. //Setting logging parameters Parameters. window.epals_forums_v5_1_WATSON_WIDGET_NAME="ePals_Forums"; window.epals_forums_v5_1_WATSON_PARTNERID="EPALS"; window.epals_forums_v5_1_WATSON_CONFIG_VER="5.1"; // override pixel logging location window.epals_forums_v5_1_LOG_PIXEL_LOCATION = "http://epals-csi.mediariver.com/l.gif?"; // Location of the Watson Web Widget server var epals_forums_v5_1_WATSON_SERVER_ROOT = "http://epals.mediariver.com/ePals"; // TTL for search results (2 weeks) var epals_forums_v5_1_NatGeoTTL = 20160; // Increment to break cache via proxy.aspx r value var epals_forums_v5_1_proxyRValuePrefix = "2"; // show debugging output in Firefox // needs to change during production window.epals_forums_v5_1_CS_DEBUG = false; var epals_forums_v5_1_WatsonWebWidgetDisplayTimeout = null; var epals_forums_v5_1_gWatsonWebWidgetResults = new Array(); var epals_forums_v5_1_gWatsonWebWidgetSourcesPending = 0; function execepals_forums_v5_1_WatsonWebWidget() { var Watson = new epals_forums_v5_1_WatsonWebWidget.initialize(epals_forums_v5_1_WATSON_SERVER_ROOT, true); Watson.addStopwordArray(epals_forums_v5_1_epalsStopWords); Watson.setFastPathEnabled(false); // Flags get set to signal page type var foundForumPosting = false; var foundForumTitle = false; var foundForumTopic = false; var blnOnMemberProfilePage = false; // Determine if we have a pre-annotated page before attempting to do DOM traversal. // determine where to start if (document.getElementById(epals_forums_v5_1_forumPostingBodyIDPrefix + "0")) { var postCounter = "0"; } else { var postCounter = "1"; } epals_forums_v5_1_debugOutput("Starting with Post " + postCounter); var topicElement = document.getElementById(epals_forums_v5_1_forumTopicIDPrefix + postCounter); var titleElement = document.getElementById(epals_forums_v5_1_forumSubjectIDPrefix + postCounter); var bodyElement = document.getElementById(epals_forums_v5_1_forumPostingBodyIDPrefix + postCounter); // If not pre-annotated, dive into the DOM //if(topicElement == null || titleElement == null || bodyElement == null) if(titleElement == null || bodyElement == null) { // annotate forum posting page, if we're on one var cells = document.getElementsByTagName("table"); for (var i=0; i var country = ""; var state = ""; var city = ""; var paras = profileTables[i].getElementsByTagName("p"); for(var pc=0, pl=paras.length; pccountry") > -1) { country = ih; foundForumTitle = true; } if(ih.indexOf("state/province") > -1) { state = ih; } if(ih.indexOf("city/town") > -1) { city = ih; } } } if(foundForumTitle) { var valRE = /\s*\w+\W?\w+<\/b>\s*(\w+)\s*/; country = valRE.exec(country)[1]; state = valRE.exec(state)[1]; city = valRE.exec(city)[1]; // construct query from var query = "\"" + country + "\" \"" + city + "\" \"" + state + "\""; // for now, construct a hidden DIV with the country var countryDiv = document.createElement("div"); countryDiv.id = epals_forums_v5_1_forumSubjectIDPrefix + postCounter; titleElement = countryDiv; countryDiv.style.display = "none"; countryDiv.setAttribute("watson_Emphasis", "high"); countryDiv.innerHTML = query; //document.body.appendChild(countryDiv); break; } } } } // Not on a forum or profile page? Set up document.body search. if(foundForumPosting == false && foundForumTitle == false && foundForumTopic == false && blnOnMemberProfilePage == false) { var watsonSearch = Watson.addSearch(); watsonSearch.setID("body"); watsonSearch.setContext(document.body); for(var uid in epals_forums_v5_1_WatsonWebWidgetSourcesToUse) { if([].propertyIsEnumerable != undefined && epals_forums_v5_1_WatsonWebWidgetSourcesToUse.propertyIsEnumerable(uid) == false) { continue; } var watsonSource = watsonSearch.addSource(uid); // increment video source R value due to non-NatGeo results if(uid == "epals-video") { watsonSource.setContextSignatureHash(epals_forums_v5_1_proxyRValuePrefix + "_" + watsonSource.getContextSignatureHash()); } epals_forums_v5_1_gWatsonWebWidgetSourcesPending++; watsonSource.setTTL(epals_forums_v5_1_NatGeoTTL); watsonSource.setMaxQueryTerms(3); watsonSource.setNumResults(epals_forums_v5_1_maxResultsPerSource); watsonSearch.setResultsCallback(epals_forums_v5_1_rcb); } } else { // now that the right sections on the page are annotated, continue // loop through what could be multiple posts // var numPostsAnalyzed = 0; while(titleElement != null && bodyElement != null) // topicElement could be null if on a profile page { var countryText = ""; var subjectText = ""; var topicText = ""; var countrySearch = null; var watsonSearch = null; var topicSearch = null; var subjectSearch = null; if ((titleElement != null) && (titleElement != "")) { var titleText = titleElement.innerText || titleElement.textContent; subjectText = titleText; // get substr from last , to end and search on that (country) for forum pages if(blnOnMemberProfilePage == false) { if (titleText.indexOf(",") >= 0) { var idxLastComma = titleText.lastIndexOf(","); if(idxLastComma >= -1) { countryText = titleText.substring(idxLastComma+1, titleText.length); } countryText = epals_forums_v5_1_trimWhitespace(countryText); } } // for member profile pages, we have pre-assembled the country text else { countryText = titleText; } // strip reply prefix (Re:) from subject if(subjectText.toLowerCase().indexOf("re:") == 0) { subjectText = subjectText.substring(3); } if (countryText != "") { var idxLastComma = subjectText.lastIndexOf(","); if(idxLastComma >= -1) { subjectText = subjectText.substring(0, idxLastComma); } subjectText = epals_forums_v5_1_trimWhitespace(subjectText); } epals_forums_v5_1_debugOutput("location = " + countryText); epals_forums_v5_1_debugOutput("subject = " + subjectText); if ((subjectText != "") && (subjectText != null) && (numPostsAnalyzed == 0)) { // add subject text to hidden div in forum posting body var subjDiv = document.createElement("div"); subjDiv.id = "forumPostingSubject_cs_internal"; subjDiv.style.display = "none"; subjDiv.setAttribute("watson_Emphasis", "high"); subjDiv.innerHTML = subjectText + " " + subjectText; if (bodyElement == null) { document.body.appendChild(subjDiv); } else { bodyElement.appendChild(subjDiv); } // Add separate subject search if(epals_forums_v5_1_blnAddSubjectSearch) { subjectSearch = Watson.addSearch(); subjectSearch.setID("subject"); // use TWs from page subjectSearch.setContext(bodyElement); //subjectSearch.setContext(subjDiv); // but use explicit subject query subjectSearch.setQueryCallback(function(query) { subjectText = subjectText.replace(/[\n\r\t\v\0\`\~\!\@\#\$\%\^\&\*\(\)\_\-\+\=\|\\\/\}\[\]\{\:\;\?\>\.\<\,\']/g," ").toLowerCase(); // remove short words var newText = ""; var terms = subjectText.split(" "); for(var qj=0; qj < terms.length; qj++) { if (terms[qj].length > 3) { if (this.getWatsonWebWidget().getStoplist()["$" + terms[qj].toLowerCase()] == undefined) { newText = newText + " " + terms[qj]; } } } newText = epals_forums_v5_1_trimWhitespace(newText); subjectText = newText; this.setSearchTerms(subjectText, false, true); this.setQueryString(subjectText); // due to a bug in when setSearchTerms is processed, // the search terms in newQ will not actually be added to the TWs. // manually add the terms now var terms = subjectText.split(" "); // don't count negated terms if(subjectText.indexOf("-") > -1) { var newQTArr = new Array(); for(var qi=0; qi 0) { terms = newQTArr; } } var twMap = this.getTermWeightMap(); var highestWeight = 1000; for(var term in twMap) { if([].propertyIsEnumerable != undefined && twMap.propertyIsEnumerable(term) == false) { continue; } highestWeight = Number(twMap[term]); break; } for(tc=0; tc" + firstPostHTML + ""; // set search context bodyDiv = document.getElementById("watson_hiddenBodyDiv"); watsonSearch = Watson.addSearch(); watsonSearch.setID("body_ext"); watsonSearch.setContext(bodyDiv); // might consider stripping terms in qcb for terms that appear in less than half the posts } else { // just inject content into the hidden DIV var bodyDiv = document.getElementById("watson_hiddenBodyDiv"); bodyDiv.innerHTML += "
" + bodyElement.innerHTML + "
"; } } } if ((epals_forums_v5_1_blnAddCountrySearch == true) && (countryText != "") && (numPostsAnalyzed == 0)) { countrySearch = Watson.addSearch(); countrySearch.setID("country"); // use TWs from description countrySearch.setContext(bodyElement); // but use explicit country query countrySearch.setQueryCallback(function(query) { var queryToUse = countryText; queryToUse = queryToUse.replace(/[\n\r\t\v\0\`\~\!\@\#\$\%\^\&\*\(\)\_\-\+\=\|\\\/\}\[\]\{\:\;\?\>\.\<\,\']/g," "); // modify USA query for video source if(((this.getSource() == "epals-video") || (this.getSource() == "epals-images")) && ((countryText == "USA") || (countryText == "United States") || (countryText == "US"))) { queryToUse = "Introduction America"; } // $RBD set add to doc tw = false this.setSearchTerms(queryToUse, false, false); this.setQueryString(queryToUse); // due to a bug in when setSearchTerms is processed, // the search terms in newQ will not actually be added to the TWs. // manually add the terms now var terms = queryToUse.split(" "); // don't count negated terms if(queryToUse.indexOf("-") > -1) { var newQTArr = new Array(); for(var qi=0; qi 0) { terms = newQTArr; } } var twMap = this.getTermWeightMap(); var highestWeight = 1000; for(var term in twMap) { if([].propertyIsEnumerable != undefined && twMap.propertyIsEnumerable(term) == false) { continue; } highestWeight = Number(twMap[term]); break; } for(tc=0; tc\.\<\,\']/g," "); this.setSearchTerms(queryToUse, false, true); this.setQueryString(queryToUse); // due to a bug in when setSearchTerms is processed, // the search terms in newQ will not actually be added to the TWs. // manually add the terms now var terms = queryToUse.split(" "); // don't count negated terms if(queryToUse.indexOf("-") > -1) { var newQTArr = new Array(); for(var qi=0; qi 0) { terms = newQTArr; } } var twMap = this.getTermWeightMap(); var highestWeight = 1000; for(var term in twMap) { if([].propertyIsEnumerable != undefined && twMap.propertyIsEnumerable(term) == false) { continue; } highestWeight = Number(twMap[term]); break; } for(tc=0; tc= epals_forums_v5_1_maxPostsToAnalyze) break; // now increment counter to look for next post, which won't be there on a single-post page postCounter = String(Number(postCounter) + 1); topicElement = document.getElementById(epals_forums_v5_1_forumTopicIDPrefix + postCounter); titleElement = document.getElementById(epals_forums_v5_1_forumSubjectIDPrefix + postCounter); bodyElement = document.getElementById(epals_forums_v5_1_forumPostingBodyIDPrefix + postCounter); } } // setup timer for bailout if (epals_forums_v5_1_WatsonWebWidgetDisplayTimeout != null) { window.clearTimeout(epals_forums_v5_1_WatsonWebWidgetDisplayTimeout); } epals_forums_v5_1_WatsonWebWidgetDisplayTimeout = window.setTimeout("epals_forums_v5_1_displayResults(true)", epals_forums_v5_1_WatsonWebWidgetDisplayTimeoutInterval); // start searches Watson.startSearch(); } function epals_forums_v5_1_rcb(json, outputDiv) { // The JSON result set var resultSet = json.ResultSet; // should we decrement epals_forums_v5_1_gWatsonWebWidgetSourcesPending? set false var blnConsiderSourceFinished = false; epals_forums_v5_1_debugOutput("epals_forums_v5_1_rcb " + json); var searchID = this.getParentWatsonSearch().getID(); epals_forums_v5_1_debugOutput("search id " + searchID); // Handle errors if(resultSet == null) { var errorMessage = "ClickSurge Widget unknown error"; var error = json.Error; if(error != null) { var code = error.Code; var message = error.Message; if(code != null && message != null) { errorMessage = "ClickSurge Widget error:\n\n" + message + "\n\nCode: " + code; } if((code == "1" && message.indexOf("operation timed out") > -1) || (code == "2" && message.indexOf("Couldn't load connector") > -1)) { blnConsiderSourceFinished = true; } blnConsiderSourceFinished = true; } epals_forums_v5_1_debugOutput(errorMessage); if(blnConsiderSourceFinished) { epals_forums_v5_1_debugOutput("sourcespending-- in error"); epals_forums_v5_1_gWatsonWebWidgetSourcesPending--; if(epals_forums_v5_1_gWatsonWebWidgetSourcesPending == 0) { epals_forums_v5_1_displayResults(); } } return; } // Enumerate valid result objects, adding to output var results = resultSet.Result; var uid = "unknown"; if(results.length > 0) { uid = results[0].UID; } epals_forums_v5_1_debugOutput("Got " + results.length + " results from " + uid); for(var i=0; i -1) { for(var qi=0; qi 0) { qt = newQTArr; } } epals_forums_v5_1_debugOutput("title " + results[i].TITLE); epals_forums_v5_1_debugOutput("MT.len " + mt.length + " MT " + results[i].MATCHTERMS); epals_forums_v5_1_debugOutput("qt.len " + qt.length + " QT " + resultSet.query); epals_forums_v5_1_debugOutput("LONGESTSTR " + results[i].LONGESTSTR); //epals_forums_v5_1_debugOutput("RANK " + results[i].RANK); // results[i].RANK = Number(results[i].RANK) / (1+ results[i].LONGESTSTR.split(" ").length); // epals_forums_v5_1_debugOutput("RANK " + results[i].RANK); if ((qt.length < 2) || (mt.length < 3)) { // if mt is short and no qt in title or URL then discard var j; var qtMatch = false; for (j=0; j < qt.length; j++) { epals_forums_v5_1_debugOutput("Checking result. QUERY:" + resultSet.query + ", URL:" + results[i].URL.toLowerCase() + ", TITLE:" + results[i].TITLE.toLowerCase()); if ((results[i].TITLE.toLowerCase().indexOf(qt[j]) > -1) || (results[i].URL.toLowerCase().indexOf(qt[j]) > -1)) { epals_forums_v5_1_debugOutput("got qt title or URL match " + qt[j]); qtMatch = true; break; } } if (qtMatch == false) { epals_forums_v5_1_debugOutput("removing " + results[i].TITLE); continue; } } if (results[i].URL.match(/\.rss$/)) { epals_forum