function advstSc(){
this.conteneurName=[];this.conteneurElt=[];this.doc=document;
this.wordR=[];this.wordP=[];
this.noSc=['script','option','iframe','noscript','style','meta'];
this.perti=new Array();this.perti['strong']=2;this.perti['b']=2;this.perti['font-weight']=2;this.perti['title']=2;
this.done=false;

this.inArr=function(arr,val) {for(var i = 0; i < arr.length; i++) { if(arr[i] == val) {return true;}}return false;};
this.trim=function(str){return str.replace(/(^\s*)|(\s*$)/g,"");};
this.clean=function(str){if(typeof(str)!='string'){return '';};return this.trim(str.replace(/[^0-9a-zA-Zיטךכאשחפ-]|-{2,}|[0-9]{1,}/gi,' ').replace(/ {2,}/gi,' ')).toLowerCase().replace(new RegExp('\\b('+advst_mot_strip.join('|')+')\\b','gi'),'');};
this.getMeta=function(p){m=this.doc.getElementsByTagName('META');for(i=0;i<m.length;i++){if(m[i].name.match(/keywords|description|classification/gi)){this.processTxt(m[i].content,p);}}};
this.getTxt=function(obj,p){for (var i=0; i<obj.childNodes.length; i++) {childObj=obj.childNodes[i];if(childObj.nodeType==3){this.processTxt(childObj.nodeValue,p);}if(!this.inArr(this.noSc,childObj.nodeName.toLowerCase())){if(typeof(this.perti[childObj.nodeName.toLowerCase()])!='undefined'){p+=this.perti[childObj.nodeName.toLowerCase()];}this.getTxt(childObj,p);}}};
this.processTxt=function(str,p){str=this.trim(str);if(str.length > 2){if(!this.wordP[p]){this.wordP[p]=[];}this.wordP[p]+=str+' ';}};
this.choose=function(){wordTemp={};tri=[];for(var k=0;k<this.wordP.length;k++){t=this.clean(this.wordP[k]).split(' ');for(i=0;i<t.length;i++){if(t[i].length>2){if(wordTemp[t[i]]){wordTemp[t[i]]+=parseInt(k);}else{wordTemp[t[i]]=parseInt(k);}}}}for(i in wordTemp){tri.push(wordTemp[i]);};tri.sort(function(a,b){return(b-a);});tri=tri.splice(0,20);for(var i=0;i<tri.length;i++){for(k in wordTemp){if(wordTemp[k] == tri[i]){wordTemp[k]=0;this.wordR.push(k);break;}}}this.wordP=null;this.doc=null;};
}
advstSc.prototype.Scan=function(v){if(v[0]!=null){elts=document.getElementsByTagName(v[0]);}else if(v[1]){elts=document.getElementsByName(v[1]);}else{elts=document.getElementsByName('advstScan');}if(elts.length==0){this.getMeta(5);this.getTxt(document.getElementsByTagName('HTML')[0],1);}else{for(var i=0;i<elts.length;i++){this.getTxt(elts[i],1);}}this.choose();return this.wordR;};
advstSc.prototype.getResAsUrlParam=function(v){return v+'='+this.wordR.join(',');};
advstSc.prototype.encode=function(str){return escape(str);};