It looks like you don't need most of those IF/gosub statements.. It might be easier if you pulled the subroutines up into the IF statements.

It LOOKS like you might have a problem with the endselect.

Where in the script is it giving the error message?

_________________________
How to ask questions the smart way <-----------> Before you ask