Random movement for ghosts in Pacman

Hi,

Can anyone explain me how to create random movement for ghosts in pacman?
http://oos.moxiecode.com/tut_07/index.html

I found the tutorial here to be incomplete.

A game similar to
http://www.mediakitchen.co.uk/chomper1.html

Plzzzzzzzzz reply.
Thanks