In case the OP is interested here is a more complete implementation (others are welcome to comment): http://codepad.org/drIhqb7Z Enjoy :) cheers James -- -- -- "Problems are solved by method"