js script to generate sprite image + css rules from a html bloc element