Changed javascript to support Openlayers 2.12