fixed bugs in js file for joomla 2,5