const compaMax=5; const compaList=document.body.getElementsByClassName('compaList'); const compaListingViewed=document.body.getElementsByClassName('compa_listing_viewed'); if(compaList&&compaListingViewed){ var compaListArray=new Array(); function cptbl_init(){ for( i=0; i'+listArray[i1][0]+''; //html=html+'
'; html=html+'
'; html=html+'
'; showAll=false; founded=0; viewed=0; for( i2=2; i2compaMax&&hidden===true) showAll=true; if(i2>compaMax&&hidden===true) display=' style="display:none;"'; else viewed++; html=html+''+listArray[i1][i2]+'
'; founded++; } html=html+''; if(founded>compaMax) html=html+'
'; html=html+'
'; } _idx.innerHTML=html; } function cptbl_search(keyword,elem,kuda,hidden){ _cptbl_searchtext=document.getElementById('cptbl_searchtext_'+elem); keyword=_cptbl_searchtext.value.toUpperCase(); _cptbl_founded=document.getElementById(kuda+elem); new_html=''; display=''; founded=0; viewed=0; for( i1=2; i1compaMax&&hidden===true) display=' style="display:none;"'; else viewed++; new_html=new_html+''+compaListArray[elem][i1]+''; founded++; } } _cptbl_founded.innerHTML=new_html; _cptbl_button=document.getElementById('cptbl_button_'+elem); if(viewed>compaMax&&display=='') _cptbl_button.innerHTML=''; else if(viewed<=compaMax&&i1>compaMax&&founded>compaMax) _cptbl_button.innerHTML=''; else _cptbl_button.innerHTML=''; } cptbl_init(); }