> -----Original Message-----
> Could someone help me to convert this snippet of PHP code to
> JavaScript?


If by "help me" you mean "do it for me" than I can tell you that nobody
is going to do it. Start working on it, and ask questions when you get
stuck, we're here to help, not do your job

Brady