Tested in IE 6+, Chrome, Firefox, Safari & Opera.
You have my full express permission to use this script on any website you wish. Feel free to edit/copy/reproduce or what ever to this code. I would like you to leave the comment in at the top but it is not require or needed! As always if you are using this for a uni/school project remember to reference it, this is for your own sake not mine!
You need to specify a width and height for the div for this to work!