This javascript code is inserted into Magento app/design/frontend/default/default/template/catalog/product/new.phtml