 Graham
 Graham
        
                     Lordeagle
 Lordeagle This seems to work  it creates the style tag and the classes anyway
this has to read the value directly from the form 
if you want it to take its value from the submitted search variable 
change 
var kwd = document.forms["srchfrm"]["srch"].value;
to
var kwd = "{_$srch|}";
<script type="text/javascript">
function searchFiles(){
var kwd = document.forms["srchfrm"]["srch"].value;
if (kwd==null || kwd==""){return false;}
var clasis = kwd.split(" ");
var styl = document.createElement("style");
for(i=0;i<clasis.length;i++){
var tmp = document.createTextNode("."+clasis[i]+"{display:block}");
styl.appendChild(tmp);}
document.head.appendChild(styl);}
</script>
Copy code