var searchHighLight={searchString:'',init:function(){if(searchHighLight.checkHighLight()==true){this.attachObjEvent(window,'load',searchHighLight.highLight,false);}},attachObjEvent:function(target,event,func,p){if(target.addEventListener){target.addEventListener(event,func,p);return true;}else if(target.attachEvent){target.attachEvent('on'+event,func,p);return true;}
return false;},getQueryVariable:function(variable){var query=window.location.search.substring(1);var vars=query.split("&");for(var i=0;i<vars.length;i++){var pair=vars[i].split('=');if(pair[0]==variable){return pair[1];}}
return false;},getRewriteVariable:function(variable){var vars=window.location.pathname.split('/').reverse();for(var i=0;i<vars.length;i++){var pair=vars[i].split('-');if(pair[0]==variable){return pair[1];}}
return false;},checkHighLight:function(){var q=searchHighLight.getRewriteVariable('q');if(!q){q=searchHighLight.getQueryVariable('q');}
if(q){searchHighLight.searchString=q;return true;}
return false;},highLight:function(){searchHighLight.searchString=searchHighLight._utf8_decode(unescape(searchHighLight.searchString));searchArray=searchHighLight.searchString.split(" ");if(!document.body||typeof(document.body.innerHTML)=="undefined"){return false;}
var bodyText=document.body.innerHTML;for(var i=0;i<searchArray.length;i++){bodyText=searchHighLight.doHighlight(bodyText,searchArray[i]);}
document.body.innerHTML=bodyText;return true;},doHighlight:function(bodyText,searchTerm){highlightStartTag="<font style='color:blue; background-color:yellow;'>";highlightEndTag="</font>";var newText="";var i=-1;var lcSearchTerm=searchTerm.toLowerCase();var lcBodyText=bodyText.toLowerCase();while(bodyText.length>0){i=lcBodyText.indexOf(lcSearchTerm,i+1);if(i<0){newText+=bodyText;bodyText="";}else{if(bodyText.lastIndexOf(">",i)>=bodyText.lastIndexOf("<",i)){if(lcBodyText.lastIndexOf("/script>",i)>=lcBodyText.lastIndexOf("<script",i)){newText+=bodyText.substring(0,i)+highlightStartTag+bodyText.substr(i,searchTerm.length)+highlightEndTag;bodyText=bodyText.substr(i+searchTerm.length);lcBodyText=bodyText.toLowerCase();i=-1;}}}}
return newText;},_utf8_encode:function(string){string=string.replace(/\r\n/g,"\n");var utftext="";for(var n=0;n<string.length;n++){var c=string.charCodeAt(n);if(c<128){utftext+=String.fromCharCode(c);}else if((c>127)&&(c<2048)){utftext+=String.fromCharCode((c>>6)|192);utftext+=String.fromCharCode((c&63)|128);}else{utftext+=String.fromCharCode((c>>12)|224);utftext+=String.fromCharCode(((c>>6)&63)|128);utftext+=String.fromCharCode((c&63)|128);}}
return utftext;},_utf8_decode:function(utftext){var string="";var i=0;var c=c1=c2=0;while(i<utftext.length){c=utftext.charCodeAt(i);if(c<128){string+=String.fromCharCode(c);i++;}else if((c>191)&&(c<224)){c2=utftext.charCodeAt(i+1);string+=String.fromCharCode(((c&31)<<6)|(c2&63));i+=2;}else{c2=utftext.charCodeAt(i+1);c3=utftext.charCodeAt(i+2);string+=String.fromCharCode(((c&15)<<12)|((c2&63)<<6)|(c3&63));i+=3;}}
return string;}}
searchHighLight.init();