MSV FM

dot.antimicrobial@66.96.161.157: ~ $
Path : /hermes/sb_web/b1536/advancedfunctions.co/genericWebsiteCode/
File Upload :
Current < : //hermes/sb_web/b1536/advancedfunctions.co/genericWebsiteCode/searchBarMultiple.js

var showSearchUi=[];
function getSearchBarUi(showSearchBar,index){
if(showSearchBar==true){
return "<div id='searchUi"+index+"' style='display:block;'><input id='searchInput"+index+"' onclick='javascript:toggleUiVisible(&#39;"+index+"&#39;)' placeholder='&#x1F50E; &nbsp;Search' style='background-color:lightgray;outline:none;padding: 15px;width:100%;margin:5px;border:0px;-moz-border-radius:10px;-webkit-border-radius:10px;border-radius:10px;font:20px Calibri;' onkeyup='javascript:filter(&#39;"+index+"&#39;)'><div id='recordList"+index+"' style='background-color:lightgray;width:100%;margin:5px;-moz-border-radius:10px;-webkit-border-radius:10px;border-radius:10px;'></div></div>";}
else{return '';}
}

function toggleUiVisible(index){
if(showSearchUi[index]==undefined){
showSearchUi[index]=true;}
if(showSearchUi[index]==true){
document.getElementById('recordList'+index).innerHTML=recordToSearch[index];
showSearchUi[index]=false;
document.getElementById('recordList'+index).style.display='block';}else{
showSearchUi[index]=true;
document.getElementById('recordList'+index).style.display='none';}

}

var recordItem=[];
var recordToSearch=[];

function setRecordToSearch(records,index){
recordToSearch[index]='';
for(var i=0;i<records.length;i++){
recordItem[index]=records[i].split('^*^');
recordToSearch[index]=recordToSearch[index]+"<div  class='onSearchHover' style='cursor:pointer;padding:15px 12px;font:20px Calibri;' onclick='javascript:{document.getElementById(&#39;searchInput"+index+"&#39;).value=&#39;"+recordItem[index][0].trim()+"&#39;; toggleUiVisible("+index+");}' >"+recordItem[index][0].trim()+"</div>";

}
//toggleUiVisible(index);
}

var searchText=[];
var list=[];
function filter(index){
searchText[index]=document.getElementById('searchInput'+index).value.toLowerCase();
list[index]=(document.getElementById('recordList'+index)).getElementsByTagName('div');

for(var i=0;i<list[index].length;i++){
if((list[index][i].innerHTML.toLowerCase()).indexOf(searchText[index])>-1){
list[index][i].style.display='';
}
else{
list[index][i].style.display='none';}
}

}