What you should setup is called Safe Z. It is under General Config. No script needed.
Lee
View Tag Cloud
Forum Rules