um. that's probably the worst way; way too much code going on, very hard to maintain. the solutions above are much better.