var searchhi_string="";function highlightWord(b,c){if(b.hasChildNodes){var a;for(a=0;a<b.childNodes.length;a++){highlightWord(b.childNodes[a],c)}}if(b.nodeType==3){tempNodeVal=b.nodeValue.toLowerCase();tempWordVal=c.toLowerCase();if(tempNodeVal.indexOf(tempWordVal)!=-1){pn=b.parentNode;if(pn.className!="searchword"){nv=b.nodeValue;ni=tempNodeVal.indexOf(tempWordVal);before=document.createTextNode(nv.substr(0,ni));docWordVal=nv.substr(ni,c.length);after=document.createTextNode(nv.substr(ni+c.length));hiwordtext=document.createTextNode(docWordVal);hiword=document.createElement("span");hiword.className="searchword";hiword.appendChild(hiwordtext);pn.insertBefore(before,b);pn.insertBefore(hiword,b);pn.insertBefore(after,b);pn.removeChild(b)}}}}function unhighlightWord(b,c){if(b.hasChildNodes){var a;for(a=0;a<b.childNodes.length;a++){highlightWord(b.childNodes[a],c)}}if(b.nodeType==3){tempNodeVal=b.nodeValue.toLowerCase();tempWordVal=c.toLowerCase();if(tempNodeVal.indexOf(tempWordVal)!=-1){pn=b.parentNode;if(pn.className=="searchword"){prevSib=pn.previousSibling;nextSib=pn.nextSibling;nextSib.nodeValue=prevSib.nodeValue+b.nodeValue+nextSib.nodeValue;prevSib.nodeValue="";b.nodeValue=""}}}}function unhighlight(b){if(b.hasChildNodes){var a;for(a=0;a<b.childNodes.length;a++){unhighlight(b.childNodes[a])}}if(b.nodeType==3){pn=b.parentNode;if(pn.className=="searchword"){prevSib=pn.previousSibling;nextSib=pn.nextSibling;nextSib.nodeValue=prevSib.nodeValue+b.nodeValue+nextSib.nodeValue;prevSib.nodeValue="";b.nodeValue=""}}}function googleSearchHighlight(){if(!document.createElement){return}ref=document.referrer;ref=ref.replace(/\/search\/web\//,"?search&q=");if(ref.indexOf("?")==-1){return}qs=ref.substr(ref.indexOf("?")+1);qsa=qs.split("#");qs=qsa[0];qs=qs.replace(/(^|&)p=Q&ts=e&/,"&");qs=qs.replace(/(^|&)query=/,"&q=");qs=qs.replace(/(^|&)key=/,"&q=");qs=qs.replace(/(^|&)keywords=/i,"&q=");qs=qs.replace(/(^|&)searchfor=/,"&q=");qs=qs.replace(/(^|&)qt=/,"&q=");qs=qs.replace(/(^|&)s=/,"&q=");qsa=qs.split("&");for(i=0;i<qsa.length;i++){qsip=qsa[i].split("=");if(qsip.length==1){continue}if(qsip[0]=="q"||qsip[0]=="p"||qsip[0]=="w"){qsip[1]=unescape(qsip[1]).replace(/^\s+|\s+$/g,"");if(qsip[1]==""){continue}phrases=qsip[1].replace(/\+/g," ").split(/\"/);for(p=0;p<phrases.length;p++){phrases[p]=unescape(phrases[p]).replace(/^\s+|\s+$/g,"");if(phrases[p]==""){continue}if(p%2==0){words=phrases[p].replace(/([+,()]|%(29|28)|\W+(AND|OR)\W+)/g," ").split(/\s+/)}else{words=Array(1);words[0]=phrases[p]}for(w=0;w<words.length;w++){if(words[w]==""){continue}highlightWord(document.getElementsByTagName("body")[0],words[w]);if(p%2==0){searchhi_string=searchhi_string+" "+words[w]}else{searchhi_string=searchhi_string+' "'+words[w]+'"'}}}}}}function localSearchHighlight(a){if(!document.createElement){return}if(a==""){return}if(a.indexOf("?")==-1){qs=a.substr(0)}else{qs=a.substr(1)}qsa=qs.split("&");for(i=0;i<qsa.length;i++){qsip=qsa[i].split("=");if(qsip.length==1){continue}if(qsip[0]=="highlight"){qsip[1]=unescape(qsip[1]).replace(/^\s+|\s+$/g,"");if(qsip[1]==""){continue}phrases=qsip[1].replace(/\+/g," ").split(/\"/);for(p=0;p<phrases.length;p++){phrases[p]=unescape(phrases[p]).replace(/^\s+|\s+$/g,"");if(phrases[p]==""){continue}if(p%2==0){words=phrases[p].replace(/([+,()]|%(29|28)|\W+(AND|OR)\W+)/g," ").split(/\s+/)}else{words=Array(1);words[0]=phrases[p]}for(w=0;w<words.length;w++){if(words[w]==""){continue}highlightWord(document.getElementsByTagName("body")[0],words[w]);if(p%2==0){searchhi_string=searchhi_string+" "+words[w]}else{searchhi_string=searchhi_string+' "'+words[w]+'"'}}}}}}function SearchHighlight(){googleSearchHighlight();localSearchHighlight(location.search);searchhi_string=searchhi_string.replace(/^\s+|\s+$/g,"");if(location.hash.length>1){location.hash=location.hash}}function SmartHighlight(){var d=new Date();var e=d.getUTCSeconds();var g=document.cookie;var c=g.split("; ");for(var b=0;b<c.length;b++){var a=c[b].split("=");if(a[0].toString()=="SHTS"){var f=parseInt(a[1])}else{if(a[0].toString()=="SHTSP"){var h=a[1]}}}if(h&&f&&h==escape(location.href)&&Math.abs(e-f)<5){searchhi_unl=0}else{SearchHighlight()}}function SmartHLUnload(){if(searchhi_unl>0){var a=new Date();var b=a.getUTCSeconds();document.cookie="SHTS="+b+";";document.cookie="SHTSP="+escape(location.href)+";"}else{document.cookie="SHTS=;";document.cookie="SHTSP=;"}}function NotRefreshHL(){searchhi_unl=0;return true}var searchhi_unl=1;

