shouldn't it check currentLongitude/currentLatitude instead of longitude/latitude?
The following line below could be affected:
<pre>
map.setCenter(new google.maps.LatLng( currentLatitude, currentLongitude ));
</pre>