modified version of the following JS fiddle -- http://jsfiddle.net/Masau/7WRHM/
No-Library (pure JS), HTML, CSS, JavaScript