>Can a script like this be used in the skins? Hi Mary...
No, you can't run scripts from the templates, at least not without some decent programing knowledge.
It has to do with the script already running when called, then needing to "run again" to process the second script...Basically, it's a logic problem.