I'm writing a very powerful search engine.. the boolean operators are not actual words but are easy to remember...

QAND,QOR,QNOT... My problem is this, the search query is pretty heavy, so I want to limit the number of words / phrases to 5 and pop up an alert if the number is greater than 5...

word QAND phrase QAND idea QNOT microsoft would pass word QAND MS QOR Micro QNOT Site QAND Cool QOR Wow would not pass...

I know how the script needs to be written just don't know how to write it...

The boolean operators will only work surrounded with a space on each side.. so what I need the JS to do (Netscape AND IE compatibility here) is replace each boolean operator with a comma (,) or whatever... The $ appears nowhere in the Bible which is my search base so that would be a good delimiter.. Anyway it needs to make a list of it and then ListLen() it.. If JS does not have a listlen function, what that is, is it counts the number of elements in a list (at least in cold fusion)... If the number is greater than 5, alert, and then abort the form submit, if not, go on...

Any help very greatly appreciated,
Tony Hicks