add sample code from yui cookbook chapter1