title = new Object(); desc = new Object(); links= new Object(); matched= new Object(); keywords= new Object(); found= new Object(); var temp=0; // actual location or the item to be searched // description of he location // actual link // percentage match found // keywords as parsed from the input // # of titles present in the database title[0]=22 //no of keywords after parsing keywords[0]=0 //no of matches found. found[0]=0 title[1]="Agenda: Programação - nossa programação de apesentações" desc[1]="Agenda: Programação, apresentação do grupo " links[1]="http://www.artdancing.hpg.com.br/agenda.html" matched[1]=0 title[2]="Anuncie: Veja como é fácil anunciar e barato" desc[2]="Anuncie: anuncie seu banner conosco " links[2]="http://www.artdancing.hpg.com.br/anuncie.html" matched[2]=0 title[3]="Apresentação: Apresentação - release Art dancing" desc[3]="Apresentação: Apresentação" links[3]="http://www.artdancing.hpg.com.br/apresentacao.html" matched[3]=0 title[4]="Coreografias: Nossas coreografias" desc[4]="Coreografias: veja algumas de nossas coreografias" links[4]="http://www.artdancing.hpg.com.br/coreografias.html" matched[4]=0 title[5]="Dicas para bailarinos (as)" desc[5]="veja algumas dicas" links[5]="http://www.artdancing.hpg.com.br/dicas.html" matched[5]=0 title[6]="Editorial - veja quem são os publicadores " desc[6]="Editorial: webdesigner e tecnologia" links[6]="http://www.artdancing.hpg.com.br/editorial.html" matched[6]=0 title[7]="Estilos que o Art Dancing executa" desc[7]="Estilos do Art Dancing" links[7]="http://www.artdancing.hpg.com.br/estilos.html" matched[7]=0 title[8]="Estilos de dança" desc[8]="Estilos de daça que são conhecidos" links[8]="http://www.artdancing.hpg.com.br/estilosdanca.html" matched[8]=0 title[9]="Fotos do grupo, pessoal e ensaios" desc[9]="Fotos - Veja o grupo, coreografias, pessoal, ensaios" links[9]="http://www.artdancing.hpg.com.br/fotos.html" matched[9]=0 title[10]="Home - Apresentação do grupo, materias e muito mais" desc[10]="home sobre a dança" links[10]="http://www.artdancing.hpg.com.br/home.htm" matched[10]=0 title[11]="Integrantes - veja os bailarinos e bailarinas" desc[11]="Integrantes - bailarinos, bailarinas, coreografo" links[11]="http://www.artdancing.hpg.com.br/integrantes.html" matched[11]=0 title[12]="Links" desc[12]="Links - veja o que indicamos para você" links[12]="http://www.artdancing.hpg.com.br/links.html" matched[12]=0 title[13]="Reciclagem palestra palestras amostra cursos curso atividades atividade" desc[13]="Reciclagem - para aqueles que querem melhorar o curso que fizeram" links[13]="http://www.fitzroy.com.br/reciclagem.html" matched[13]=0 title[14]="O mundo da dança - veja como é esse mundo maravilhoso" desc[14]="O mundo da dança e seu contexto" links[14]="http://www.artdancing.hpg.com.br/mundodanca.html" matched[14]=0 title[15]=" Patrocinio - apoie nosso grupo" desc[15]="Patrocinio - lembre-se do incentivo fiscal para que patrocina cultura" links[15]="http://www.artdancing.hpg.com.br/patrocinio.html" matched[15]=0 title[16]="Pontos de direção - saiba onde você esta na hora em que esta dançando" desc[16]="Pontos de direção onde você está no palco" links[16]="http://www.artdancing.hpg.com.br/pontos.html" matched[16]=0 title[17]="Posições básicas que é preciso saber na hora de dançar " desc[17]="Posições básicas- saiba quais são as primeiras posições" links[17]="http://www.artdancing.hpg.com.br/posicoes.html" matched[17]=0 title[18]="Prêmios que o Art Dancing conquistou" desc[18]="Veja os prêmios que o grupo conquistou nos festivais" links[18]="http://www.artdancing.hpg.com.br/premios.html" matched[18]=0 title[19]="Significados e termos sobre o ballet, posição ,pés, braços, cabeça, joelhos, nomes " desc[19]="Significados termos dicas sobre ballet classico e muito mais" links[19]="http://www.artdancing.hpg.com/significados.html" matched[19]=0 title[20]="BRAZILMAX PARTNER LINKS partner links link" desc[20]="BRAZILMAX PARTNER LINKS" links[20]="http://www.brazilmax.com/maxpartnerlinks.html" matched[20]=0 title[21]="Artist of the month: Flávio Emanuel flavio artist" desc[21]="Artist of the month: Flávio Emanuel" links[21]="http://www.brazilmax.com/femanuel.html" matched[21]=0 title[22]="Artist of the month: Washington Santana artist" desc[22]="Artist of the month: Washington Santana" links[22]="http://www.brazilmax.com/wsantana.html" matched[22]=0 function searchns4(){ // get the input from the input by the user and strip it into keywords // var skeyword=document.searchengine.keywords.value.toLowerCase(); var check=1; var pos=0; var i=0; var j=0; var itemp=0; var config=''; while (true) { if (skeyword.indexOf("+") == -1 ) { keywords[check]=skeyword; break; } pos=skeyword.indexOf("+"); if (skeyword !="+") { keywords[check]=skeyword.substring(0,pos); check++; } else { check--; break; } skeyword=skeyword.substring(pos+1, skeyword.length); if (skeyword.length ==0) { check--; break; } } // the keywords have been put in keywords object. keywords[0]=check; //alert(check); // matching and storing the matches in matched for ( i=1; i<=keywords[0];i++) { for (j=1;j<=title[0];j++) { if (title[j].toLowerCase().indexOf(keywords[i]) > -1 ) { matched[j]++; } } } // putting all the indexes of the matched records in found for (i=1;i<=title[0];i++) { if (matched[i] > 0 ) { found[0]++; // increment the found found[found[0]]=i; } } //alert("found 0 " + found[0]); // sort the list as per max percentage of matches for (i=1;i<=found[0]-1;i++) { for(j=i+1;j<=found[0];j++) { if ( matched[found[i]]< matched[found[j]] ) { temp= found[j]; found[j]=found[i]; found[i]=temp; } } } config='toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes' output = window.open ("","outputwindow",config) //output.document.write('